GCM issues on the android client - android

I have an android app that was working previously, I had to set up the dev environment on a new PC. Everything compiles fine (i'm using Android Studio), but I get the following error:
11-26 15:25:22.737 15132-15132/com.sample E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gcm.GCMRegistrar
at com.sample.views.loginregistration.LoginManager.handleRegistration(LoginManager.java:147)
at com.sample.views.loginregistration.LoginViewFragment.onCreateView(LoginViewFragment.java:74)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:871)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1083)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:635)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1431)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:523)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1171)
at android.app.Activity.performStart(Activity.java:5143)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5103)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
It's saying it cannot find gcm.jar which is clearly in the project and in a folder called libs. These were the common issues that people reported in other SO posts. The app basically launches and then crashes on the spot... But i'm confused as the setup is correct.
Is there anything else that could be wrong with this?

It might be a build.gradle issue. You should have this in your build.gradle file
dependencies {
compile files('libs/gcm.jar')
}
Once you've added that, go to Tools -> Android -> Sync Project with Gradle Files

Related

Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: load_library[1098]: Library '/system/lib/libhoudini.so' not found

I updated Android Studio to 3.0.0 and Gradle to 3.0.0
After run my app on emulator Genymotion (API 16-19) crashed.
Error:
E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at android.support.v4.app.SupportActivity.<init>(SupportActivity.java:68)
at android.support.v4.app.BaseFragmentActivityGingerbread.<init>(BaseFragmentActivityGingerbread.java:37)
at android.support.v4.app.BaseFragmentActivityHoneycomb.<init>(BaseFragmentActivityHoneycomb.java:29)
at android.support.v4.app.BaseFragmentActivityJB.<init>(BaseFragmentActivityJB.java:30)
at android.support.v4.app.FragmentActivity.<init>(FragmentActivity.java:79)
at android.support.v7.app.AppCompatActivity.<init>(AppCompatActivity.java:61)
at com.myapp.start.BaseActivity.<init>(BaseActivity.java:37)
at com.myapp.start.StartActivity.<init>(StartActivity.java:40)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: load_library[1098]: Library '/system/lib/libhoudini.so' not found
Native methods in my app not using. What could be the problem?
Check your advanced profiling Run-->Edit Configurations.. --> Profiling Tab
--> Uncheck (Enable advanced profiling)

Crashlytics NoClassDefFoundError: com.crashlytics.android.answers.Answers

I get a project from other developer to fix minor issues in app, when I'm running my app on device I'm getting an error:
15142-15142/com.etripconcept E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.crashlytics.android.answers.Answers
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:224)
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:207)
at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:202)
at com.etripconcept.SplashScreenActivity.onCreate(SplashScreenActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5163)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2061)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2122)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1228)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
I'm new in Android development, so it may be stupid question, but Google doesn't say anything about it. I use Android Studio 1.2.2 on Win 8.1

Facebook apk for emulator constantly crashing

Facebook apk delivered with sdk 4.1.0 doesn't not work in emulators where it supposed to work(sdk emulator and genymotion)
It always crashes with the same exception
05-08 08:42:42.022 3279-3279/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: could find DSO to load: libbreakpad.so
at com.facebook.soloader.SoLoader.a(SoLoader.java:179)
at com.facebook.soloader.SoLoader.a(SoLoader.java:144)
at com.facebook.breakpad.BreakpadManager.a(BreakpadManager.java:55)
at com.facebook.breakpad.BreakpadManager.b(BreakpadManager.java:78)
at com.facebook.breakpad.BreakpadManager.a(BreakpadManager.java:82)
at com.facebook.katana.app.FacebookApplication.b(FacebookApplication.java:169)
at com.facebook.base.app.DelegatingApplication.attachBaseContext(DelegatingApplication.java:62)
at android.app.Application.attach(Application.java:146)
at android.app.Instrumentation.newApplication(Instrumentation.java:983)
at android.app.Instrumentation.newApplication(Instrumentation.java:967)
at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4124)
at android.app.ActivityThread.access$1300(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1255)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Any solution?
Change your avd image from x86 to Arm.
It should work with you now.

My application can't find a library class though it is in it

In the android application I am writing, I am using a custom android project. Both compiles fine : particularly I could import the file_explorer_library-release aar in my application project.
But when launching the application in an emulator, I am getting an error saying that a library class could not be found, though when seeking for it in the integrated aar, I found the requested class (FileExplorerActivity) :
01-30 14:55:24.859 2132-2132/com.loloof64.android.chess_position_manager E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.loloof64.android.file_explorer_library.FileExplorerActivity
at com.loloof64.android.chess_position_manager.MainActivity.onCreate(MainActivity.java:61)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
My main concern is that it is an error from my library coding or from my library management inside ChessPositionManager project, but which ?
Notice that both projects are built inside Android Studio (1.0) : what I did is placing the built FileExplorer aar into the libs folder of ChessPositionManager app module, and adapted the app module gradle script (changes are already reflected in the repository).

How to use a fragment from one application in another?

I'm part of a team developing several android applications for a combined system. The system contains administration tools, games and other kind of applications.
The users has requested that they from one application can access the settings of all apps in the system.
My initial idea was that each application could implement a settings fragment following a predefined interface which i then could load to show in my settings application.
I found this post, with a fairly new answer Use external application fragment/activity inside application, and this is how I thought this could be implemented.
I tried implementing the example given by #sandrstar by it gives me the following error
04-24 07:02:36.596 1715-1715/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
at dalvik.system.DexFile.defineClass(Native Method)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:211)
at dalvik.system.DexPathList.findClass(DexPathList.java:315)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at dk.giraf.launcher.test.mainapplication.MainActivity.onCreate(MainActivity.java:46)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Is what I am attemping even possible? Other suggestions for implementations are welcome.

Categories

Resources