libiconv.so: has text relocations error in cn1 - codenameone

I've used zbarscanner lib in cn1 and it worked fine. I have recently updated the app and has the following bug that cause app crash. The error occured in nougat nokia 5 device. I checked the previous version of the app which works fine.
02-08 16:24:58.792 592-592/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.capitaleyenepal.lenovo, PID: 592
java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.capitaleyenepal.lenovo-2/lib/arm/libiconv.so: has text relocations
at java.lang.Runtime.loadLibrary0(Runtime.java:989)
at java.lang.System.loadLibrary(System.java:1562)
at com.dm.zbar.android.scanner.ZBarScannerActivity.<clinit>(ZBarScannerActivity.java:28)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2558)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6121)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

This seems to be a problem with recent updates of Android and the little monkey QR code scanner. The solution is to get a newly compiled version of the library that fixes that issue and integrate it into the cn1lib. I think you should open an issue on that project.

I know it's a late reply but as I have come to the same issue I am posting confirmation that the issue can be solved.
In summary, for me using the ZBar library through QRScanner from the QRScanner.cn1lib library was working fine and then stopped working, with the same error that I could see from the android logs as fatal level error (libiconv.so: has text relocations).
The following has been done (I am using the latest vs of CodenameOne):
Remove build hint android.xapplication (containing the ZBarScannerActivity)
Remove cn1-codescan.cn1lib and QRScanner.cn1lib, refresh project lib (not entirely sure that this was necessary, but anyway the stubs file was newer on the repos)
Download latest cn1-codescan.cn1lib and QRScanner.cn1lib, refresh project lib
Download .so compiled files from the above link
Manual copy each couple of files into the respective architecture
folders, within the ZBarScannerLibrary.aar
Codenameone build for android
It is now working again.
Thanks Shai for your advice by email re. the build hint.

Related

Getting Errors Trying to Load SqlServerSpatial140.dll

I am using SqlGeography in a project that was working but now is not. The only thing that has changed that I can think of is that Windows 10 did an update to my PC but I am unsure that that is the source of the problem.
I used NuGet to remove and then re-add the reference to SqlServer140.dll and got this message:
Errors were detected when processing \packages\microsoft.sqlserver.types. 14.0.1016.290\nativebinaries\x64\SQLSERVERPARTIAL140.dll. Please make sure that the file eis accesible, and that it is a valid assembly or COM component.
I used this SO thread to work on this problem. I downloaded Dependency Walker and ran it against SqlServerSpastial140.dll and got this error message:
Errors were detected when processing that . See the log window for details.
Unfortunately, the help file for Dependency Walker is not included in the download (I downloaded both form its home page and also a link at Microsoft - the help was missing from both) so I do not know how to read the result. Here is an image of the result:
Assuming the "log window" is the one at the very bottom, it is not helpful. What do I have to do to restore the SqlGeography functionality. I've also tried other suggestions from the link mentioned above but nothing has worked.
What worked for me was to go to this file location below and copy the SqlServerSpatial140.dll to my project bin folder.
C:\Users<user>.nuget\packages\microsoft.sqlserver.types\14.0.1016.290\nativeBinaries\x64

Permanently resolve Unable to watch for file changes in this large workspace

To resolve this issue I got there to the link provided by vscode
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
Ok, this, corrects the error, But when I restart the Linux and again open my React project,
I get the Same error.
max_user_watches file again gets the value of 8192 as no. of max files.
My react server is not starting due to this issue.
Then I again follow the same step of the link provided, this sometimes gets frustrating.
Any permanent Help I could get from you.
A workaround:
Just disable this built-in extension: TypeScript and JavaScript Language Features

ANDROID: java.util.MissingResourceException: Can't find resource for bundle 'org.eclipse.paho.client.mqttv3.internal.nls.logcat_en_US', key ''

There seems to be countless reports of this bug in Stack Overflow. None of the suggestions worked. In my case it is almost identical to this stack overflow report
SPRING
except this case is in Android being built in Android Studio. It only happens in release mode with proguard. Proguard corrupts it somehow. And yes I have done the following in proguard:
-keep class org.eclipse.paho.client.mqttv3.logging.JSR47Logger { *; }
-keep class org.eclipse.paho.** { *; }
I have also parsed the jars downloaded by gradle. I cannot update to 1.2.1 because that only works with the latest versions of Android ... according to comments made by the developers. If I could get the source code for 1.1.0 maybe I could stop it from calling a resource that does not exist.
Anyone solve this problem or is it a bug in proguard/paho?
Looking at the apks generated by release builds (uses proguard) and debug builds (no proguard) shows that proguard is taking the org.eclipse.... package name of the properties and changing the 'org' to some letter like 'c'. The mqtt paho client is looking for the property file using the full package name and therefore cannot find it, no matter what you include or exclude in proguard. I looked at an apk made a few months ago (I have not done anything with the paho client or that part of the code using the paho client ... it has worked fine and I have had no need to change it). I see in that old release apk that the 'org' is there as it should be.
So the problem is in proguard. All I could do to move forward is take the source files for 1.1.0, create a new java project module, and tediously comment out every 'log' and getLogger in the source code. Its a temporary and unpleasant fix but it works. When proguard (R8) fixes this, then I can go back to what I had.
So I guess the only real fix is to submit a bug to R8. That I have not done.

'CoreVideo/CoreVideo.h' file not found

When I run a iOS App on my device , This error will appear
'CoreVideo/CoreVideo.h' file not found
not matter what project even though create a new project , once run the app on my device this error will appear
but the Simulator will be OK~
and I can't find some frameworks in
Target--Build Phase--Link Binary With Librares--add
like AVFoundation.framework AudioToolBox.framework
Should i reinstall the xcode on my mac~???
Make certain you've added the CoreVideo framework to your project.
Here's how I do it in my own projects:
If you need help figuring out where it is (it's hidden within the XCode app package itself), let me know and I can show you.
Also, make certain "Target Membership" is checked for CoreVideo in the File Inspector of your project. It looks like this:

jTwitter, oAuth, and Google App Engine. NoClassDefFoundError

I'm trying to use jTwitter to get an oauth instance to twitter with my consumer key/secret and access token/secret. This is well documented in the javadoc here. I have downloaded signpost, signpost-jetty, and the jtwitter library, but after deploying and running the servlet, I get a error java.lang.NoClassDefFoundError: winterwell/jtwitter/OAuthSignpostClient Eclipse isn't complaining about the class not being there, because it is there-- I can see it in the JAR file itself, which is in my project. So, I said forget it, I'll try out OAuthScribeClient instead, but this generated a VERY SIMILAR ERROR java.lang.NoClassDefFoundError: org/scribe/oauth/Token This one confuses me even further because I have the following code in my java file, and it compiles without error or warning:
import org.scribe.oauth.Token;
Token token = new Token("myaccesstokeninfo", "accesstokensecret");
Clearly, I'm missing something very fundamental, but I am at an absolute loss as to what it may be. Thanks.
Usually "NoClassDefFoundError" happens when you forget to copy all jar-files to your "/war/WEB-INF/lib" directory, so those libs will be unavailable from server-side.
Xo4yHaMope is probably right.
If you're working from Eclipse but running using a web container, then your runtime classpath might be different from your project classpath - which can cause this error.
In order to complete Ben Winters answer what I actually did and worked is add the jar in
the libs folder within the project
see also here about folder hierarchy.
When you do this eclipse will normally add the jar to the android dependencies before launching the application. What I realise is that adding a jar in the build path will make classes available only during the build

Resources