Sinch Android chatt app Bug - android

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

Related

Couldn't load alljoyn_java from loader dalvik.system

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

Why would i get the below error(java.lang.UnsatisfiedLinkError) while running app authenticity in Android

I created an android app and I have put a code for app authenticity in it .
I followed the below URLs to Implement it.
application-authenticity-protection
application-authenticity-protection-native-android-applications
I am getting an error while testing it.
Can some body tell me when would we get the below error.
FATAL EXCEPTION: pool-3-thread-1
Process: com.mtb.mbk_vpn, PID: 10084
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mtb.mbk_vpn-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mtb.mbk_vpn-1/lib/x86, /data/app/com.mtb.mbk_vpn-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libauthjni.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at com.worklight.common.security.AppAuthenticityToken.<init>(AppAuthenticityToken.java:30)
at com.worklight.wlclient.challengehandler.AuthenticityChallengeHandler.handleChallenge(AuthenticityChallengeHandler.java:81)
at com.worklight.wlclient.challengehandler.AuthenticityChallengeHandler.handleChallenge(AuthenticityChallengeHandler.java:32)
at com.worklight.wlclient.api.challengehandler.BaseChallengeHandler.startHandleChallenge(BaseChallengeHandler.java:71)
at com.worklight.wlclient.WLRequest.checkResponseForChallenges(WLRequest.java:626)
at com.worklight.wlclient.WLRequest.requestFinished(WLRequest.java:292)
at com.worklight.wlclient.WLRequestSender.run(WLRequestSender.java:52)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
couldn't find "libauthjni.so" at java.lang.Runtime.loadLibrary
Looks to me like you did not copy all required SDK files from the NativeAPI you've created via CLI/Studio, into your native project in Android Studio/Eclipse.
Make sure you've done that.

Unexplainable crash error

My app crashes when I try to run it. I don't know what could be causing this error... It might be related to my previous question but that post wasn't very good so I'll post the new error here.
FATAL EXCEPTION: main
Process: com.myapp, PID: 12693
java.lang.NoSuchFieldError: No static field AppCompatTheme of type [I in class Landroid/support/v7/appcompat/R$styleable; or its superclasses (declaration of 'android.support.v7.appcompat.R$styleable' appears in /data/data/com.myapp/files/instant-run/dex/slice-slice_4_13f90a0ab4d497a8a87e7463d225d6b3993606ba-classes.dex)
at android.support.v7.app.AppCompatDelegateImplV7.createSubDecor(AppCompatDelegateImplV7.java:336)
at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:309)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:273)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.myapp.activity.MainActivity.onCreate(MainActivity.java:24)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
at android.app.ActivityThread.access$900(ActivityThread.java:181)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6117)
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:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
I can't find any information on this error anywhere else, which is really weird.
I ran in to this error now when upgrading my build tools from 23.0.1 to 23.0.2. I spent an hour investigating how I can solve this problem (I did several cleans and rebuilds and none worked).
Eventually, I took 19lymers advice and deleted the app and reinstalled it and then it got fixed.
EDITED:
I don't know whether this is also related or not but before I did the deletion, my app was already buggy - icons which were suppose to be displayed in one location ended up displaying in another location. I think the resource.xml got corrupted. When that happens, best to delete and reinstall. That's the quickest way to solve this issue.

Need Stacktrace error logs from Debug Android App without Google Play

I need the Error logs with stack trace from my users with my Android App (Debug, deployed via DeployGate). I've tried DeployGate SDK and RemoteLogCat. RemoteLogCat and DeployGate only send Log messages that I've put in myself, but I need the current LogCat data (as if it would be hooked up to my own PC) with LogLevel "Error".
This is what I need:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: www.myapp.nl.simpelfragmentvoorbeeld, PID: 5020
java.lang.RuntimeException: NullPointerException
at www.myapp.nl.MainActivity$1.onClick(MainActivity.java:87)
at android.view.View.performClick(View.java:5197)
at android.view.View$PerformClick.run(View.java:20926)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5944)
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:1389)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1184)
Many thanks guys!
The solution is using ACRA
ACRA is a library enabling Android Application to automatically post their crash reports to a GoogleDoc form. It is targetted to android applications developers to help them get data from their applications when they crash or behave erroneously.

I've problems with "sinch app to app messaging" on my phone

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.

Categories

Resources