I wanna implement sinch app to app instant messaging funcitionality to my existing app. I followed github and tutorials I added sdks to my library. I can run my app on emulator. I can login and sign up and send messaging to another account which I also created on emulator. But when I try to run my app on real phone, i've faced with problems. When I click the login and sign up button, my app has stopped. After I rerun my project on emulator, I realized that I was able to sign up on my phone. When I enter my app again, it has crushed. Briefly, my app works on emulator but not on real phone now. I need your help, please help me!!
Below is my logcat.
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec E/art﹕ dlopen("/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so", RTLD_LAZY) failed: dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" is too small to be an ELF executable: only found 0 bytes
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec D/AndroidRuntime﹕ Shutting down VM
09-24 17:06:16.991 17061-17061/com.meliksah.cakir.buec E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.meliksah.cakir.buec, PID: 17061
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" is too small to be an ELF executable: only found 0 bytes
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:989)
at com.sinch.android.rtc.internal.client.DefaultSinchClient.<clinit>(DefaultSinchClient.java:72)
at com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClientFactory.java:17)
at com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
at com.meliksah.cakir.buec.MessageService.startSinchClient(MessageService.java:48)
at com.meliksah.cakir.buec.MessageService.onStartCommand(MessageService.java:39)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3307)
at android.app.ActivityThread.access$2200(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1546)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
This error:
dlopen failed: "/data/app/com.meliksah.cakir.buec-1/lib/arm/libsinch-android-rtc.so" \
is too small to be an ELF executable: only found 0 bytes
means that you have a zero-length file with above path.
Either you made a mistake while copying it to your phone, or something truncates it after it's copied. Fixing that problem is almost definitely the required first step in getting your application working.
Related
My Android App works fine in Emulator and on physical devices connected to the computer, but it (app) crashes when APK installed through Google Drive on the same device.
My app has two activities: Main and Game Play. On the main screen (activity) there is a Play button that starts the second activity (game play). I have a physical device (Galaxy Tab E) connected to my computer. When I test my app on the emulator and on the physical device, the app works fine without any problems. However, when I generate an APK for Google Play Store and uploading it on my Google Drive, and installing it on the same physical device, it crashes when I click/tap the Play button. Don't know how to debug it and I don't know what am I missing. Is there any difference between Android Studio package that tests on the emulator and the generated apk?
I don't know how to get any generated error to add here for troubleshooting, as the device is not connected to the computer.
I expect the APK to work exactly as on the emulator or USB-connected device. Any help is greatly appreciated.
Edit:
After connecting the cable, I got the following errors when pressing the Play button:
08-15 12:15:23.762 14689-14689/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: ca.simapp.kids, PID: 14689
java.lang.VerifyError: c/b/b/a/e/a/VJ
at c.b.b.a.e.a._J.f()
at c.b.b.a.e.a._m.a()
at c.b.b.a.e.a.oD.a(:16)
at c.b.b.a.e.a.CZ.a(:3)
at ca.simapp.kids.Game.onCreate(:5)
at android.app.Activity.performCreate(Activity.java:5447)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$800(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
08-15 12:15:24.083 588-14754/? E/android.os.Debug: !#Dumpstate > sdumpstate -k -t -z -d -m 14689 -o /data/log/dumpstate_app_error
08-15 12:15:25.994 588-666/? E/ViewRootImpl: sendUserActionEvent() mView == null
08-15 12:15:26.105 588-721/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
08-15 12:15:31.720 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0
08-15 12:15:33.101 588-990/? E/WifiService: SEC_COMMAND_ID_SET_WIFI_SCAN_WITH_P2P : Start scan, start assoc
08-15 12:15:39.197 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0
Line 5 in the error points to
import android.content.SharedPreferences;
Hi check this link it seems that some classes has changed between compile and runtime. Now i would suggest to debug by adding and removing libraries which you suspect and create APKs to see which one is causing the error. And keep internet connection proper so you don't get obfuscated log messages.
BTW you can still read obfuscated log using proguard file use that to find the name of the class causing error.
I running my react native application with react-native run-android. nothing wrong here, i already got message BUILD SUCCESSFUL. but after that, my application failed open and instantly force stop. and when i try to reopen app, it's keeps failed to open.
i've tried to see logcat by running on Android Studio, and so i can see logcat why it's happen in my project.
and this is the logcat after my app crashed
--------- beginning of crash
2019-04-04 14:27:12.120 9507-9507/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.timahfrontend, PID: 9507
java.lang.NoSuchMethodError: No static method com_google_firebase_components_ComponentRuntime$$Lambda$1_lambda$new$0(Lcom/google/firebase/components/ComponentRuntime;Lcom/google/firebase/components/Component;)Ljava/lang/Object; in class Lcom/google/firebase/components/ComponentRuntime; or its super classes (declaration of 'com.google.firebase.components.ComponentRuntime' appears in /data/app/com.timahfrontend-1/base.apk)
at com.google.firebase.components.ComponentRuntime$$Lambda$1.get(com.google.firebase:firebase-common##16.1.0)
at com.google.firebase.components.Lazy.get(com.google.firebase:firebase-common##16.1.0:53)
at com.google.firebase.components.AbstractComponentContainer.get(com.google.firebase:firebase-common##16.1.0:27)
at com.google.firebase.components.ComponentRuntime.get(com.google.firebase:firebase-common##16.1.0:36)
at com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common##16.1.0:554)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.1.0:365)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.1.0:332)
at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common##16.1.0:316)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common##16.1.0:53)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1759)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1734)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common##16.1.0:47)
at android.app.ActivityThread.installProvider(ActivityThread.java:6420)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6012)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5951)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1518)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
i expect the application running properly, how to solve this. in my case its look like the problem is from firebase. but i don't know how to solve it. but now the actual process is i running react-native run-android then build successful, but with instantly my app stop, and even i try to open again. its keeps stopping
I have a really simple android app. I want to load a shared library called 'libcamera.so' and then call methods via JNI.
I do not own this library and I do not have access to the source code. It was originally compiled for ARM.
An x86 version is not available.
The project can detect the library and correctly shows it in the jniLibs folder.
Within my main activity I am trying to load the 3rd party library like so:
static {
System.loadLibrary("camera");
}
When this line executes, logcat shows the following:
02-06 14:11:38.517 4455-4455/uk.co.test.myApp E/art: dlopen("/data/app/uk.co.test.myApp-2/lib/x86/libcamera.so", RTLD_LAZY) failed: dlopen failed: "/data/app/uk.co.test.myApp-2/lib/x86/libcamera.so" has unexpected e_machine: 40
02-06 14:11:38.519 4455-4455/uk.co.test.myApp E/AndroidRuntime: FATAL EXCEPTION: main
Process: uk.co.test.myApp, PID: 4455
java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/uk.co.test.myApp-2/lib/x86/libcamera.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:988)
at uk.co.test.myApp.MainActivity.<clinit>(MainActivity.java:17)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1603)
at android.app.Instrumentation.newActivity(Instrumentation.java:1066)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5258)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Other 3rd party apps which use this library can run on my x86 device (Epson BT350) so I feel like this should be possible.
I have become aware of something called 'Houdini' which allows ARM apps to run on x86 - I have checked and my device has this library so im confused why its not doing its job. But its also quite likely I dont really understand how Houdini works!
I have tried running on an x86 emulator - same error.
Any ideas would be greatly appreciated.
I solved the problem by forcing my app to only build an armeabi version. I did this by using an abifilter within gradle. I added the following to my defaultConfig
ndk {
abiFilters "armeabi"
}
This will then run on my x86 device because Houdini will kick in and do the translation. Its not ideal because this translation affects performance - but its a start and gets me to the next stage.
i am creating a chat application by using Alljoyn framework and am getting the following error can somebody please help me. The alljoyn jars are already set up!!!
FATAL EXCEPTION: main
Process: com.example.vikesh.chat_application, PID: 4326
java.lang.UnsatisfiedLinkError: Couldn't load alljoyn_java from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.vikesh.chat_application-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.vikesh.chat_application-1, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.example.vikesh.chat_application.AlljoynService.<clinit>(AlljoynService.java:1252)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2553)
at android.app.ActivityThread.access$1800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
You need to put the AllJoyn liballjoyn_java.so file within your project.
For example, in Android Studio, the usual location for this file is:
[your_project_dir]/app/src/main/jniLibs/armeabi/
The armeabi portion of the above path is assuming that the AllJoyn .so file that you have previously built is targeted for the 'arm' CPU (the armeabi instruction set).
Note: When I deleted the .so file from my app, I got the same error that you are reporting. When I put the .so file back I still got the same error. I had to uninstall the app from my Android device, and in Android Studio I had to clean and rebuild the app, before I was able to get past this error.
Some other things to consider...
Make sure in your App that you are calling
static {
System.loadLibrary("alljoyn_java");
}
Make sure that the liballjoyn_java.so you previously built matches the cpu instruction set of your Android device. You can verify your Android's instruction set by using an app such as Droid Info, for example. Assuming that it is armeabi, then when you build the AllJoyn core project, you need to specify at a minimum the following switches in your scons build command....
scons BINDINGS="cpp,java,c" OS=android CPU=arm VARIANT=release
Finally, the following Stackoverflow link discusses general reasons the error you are seeing can occur:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader
I'm working on Android chat app and everything was going fine. I've managed to add users to the parse database and display users on a friends fragment.
But then came Sinch. I added the SDK to my project as instructed on their website and added a service class which I've declared in the manifest like:
<service android:name=".services.MessageService" />
inside the application tag.
However I am experiencing a fatal error. The app runs fine until I run the service.
I run the service the moment the user logs in or registers successfully, also when already logged in. I think I have an idea of what's happening.
Something to do with:
java.lang.UnsatisfiedLinkError:
dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/com.landagmail.josemaria.chatapp-1/base.apk"],nativeLibraryDirectories=[/vendor/lib,
/system/lib]]]
When creating the sinch client.
I think it has something to do with Android not finding some kind of library? A sinch one? (UnsatisfiedLinkError)
Any help would be greatly appreciated =) Regards, Jose Maria Landa
Here's the output:
06-14 20:30:26.052 21498-21498/com.landagmail.josemaria.chatapp
E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.landagmail.josemaria.chatapp, PID: 21498
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file
"/data/app/com.landagmail.josemaria.chatapp-1/base.apk"],nativeLibraryDirectories=[/vendor/lib,
/system/lib]]] couldn't find "libsinch-android-rtc.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.sinch.android.rtc.internal.client.DefaultSinchClient.(DefaultSinchClient.java:72)
at com.sinch.android.rtc.internal.client.InternalSinchClientFactory.createSinchClient(InternalSinchClientFactory.java:17)
at com.sinch.android.rtc.DefaultSinchClientBuilder.build(DefaultSinchClientBuilder.java:95)
at com.landagmail.josemaria.chatapp.services.MessageService.startSinchClient(MessageService.java:45)
at com.landagmail.josemaria.chatapp.services.MessageService.onStartCommand(MessageService.java:34)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2893)
at android.app.ActivityThread.access$2200(ActivityThread.java:147)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1394)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:898)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:693)
forgot it. i solved it. the jniLbis folder was in the wrong directory. should have been in src directory not alongside libs