Latest Google Services (v. 21) ANE + AIRMobile native extension failed resolving interface - android

I am trying to add latest Google Plus (google-play-services.jar) support to an Air mobile app by creating a native extension.
The code doesn't have compile-time errors or warnings, the JAR is exported fine, ANE is built and included in project without problems,
but when I run my apk, it crushes. In device-crush-logs I can see following error:
12-04 11:08:18.602 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.602 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
At first I tried to build an extension from empty project, all by myself.
After that I found an extension with open source at github github.com/alextel69/google-play-game-services-ane/
I build that extension and include in my AIR mobile project and it works fine, but the google-play-services.jar is too old and doesn't contain classes I need,
so i tried to replace it's libs/google-play-services.jar and libs/android-support-v4.jar with the newest ones that I got in my Android SDK Manager.
And that caused the above errors.
In this way, I did not modify a single code line, or ANT's build.xml, or anything else, I just switched old android-support-v4.jar + google-play-services.jar (works fine!) with newer android-support-v4.jar + google-play-services.jar (fails). I mean the ANE is built fine, even the extension is created and some of it's methods work and return values, but as I referense to google-service code, I get that strange error.
Though interfaces in both old and new JARs seem to be equal: dl.dropboxusercontent.com/u/13839683/ane/jars_compare.png .
By the way, these errors seem to appear in AIR mobile only. Pure native application using these android-support-v4.jar + google-play-services.jar have no problems.
Here is a brief scheme of my native extension:
dl.dropboxusercontent.com/u/13839683/ane/scheme.png
And here is a complete device log from extension's birth and till it's crush :
12-04 11:08:18.602 23195 23195 I ~ANE~ : ------------- INITIALIZE MY EXTENSION -------------
12-04 11:08:18.602 23195 23195 I ~ANE~ : ------------- CREATE MY EXTENSION -------------
12-04 11:08:18.602 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.602 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.602 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.602 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.602 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.onStop, referenced from method com.google.api.games.Context.dispose
12-04 11:08:18.602 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6754: Lcom/google/example/games/basegameutils/GameHelper;.onStop ()V
12-04 11:08:18.602 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.602 23195 23195 W dalvikvm: VFY: unable to resolve static field 2701 (Leaderboards) in Lcom/google/android/gms/games/Games;
12-04 11:08:18.602 23195 23195 D dalvikvm: VFY: replacing opcode 0x62 at 0x0000
12-04 11:08:18.612 23195 23195 W dalvikvm: VFY: unable to resolve static field 2700 (Achievements) in Lcom/google/android/gms/games/Games;
12-04 11:08:18.612 23195 23195 D dalvikvm: VFY: replacing opcode 0x62 at 0x0000
12-04 11:08:18.612 23195 23195 W dalvikvm: VFY: unable to resolve static field 2700 (Achievements) in Lcom/google/android/gms/games/Games;
12-04 11:08:18.612 23195 23195 D dalvikvm: VFY: replacing opcode 0x62 at 0x0000
12-04 11:08:18.612 23195 23195 W dalvikvm: VFY: unable to resolve static field 2700 (Achievements) in Lcom/google/android/gms/games/Games;
12-04 11:08:18.612 23195 23195 D dalvikvm: VFY: replacing opcode 0x62 at 0x0000
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.612 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.beginUserInitiatedSignIn, referenced from method com.google.api.games.Context$beginUserInitiatedSignIn.call
12-04 11:08:18.612 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6715: Lcom/google/example/games/basegameutils/GameHelper;.beginUserInitiatedSignIn ()V
12-04 11:08:18.612 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0009
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.612 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.signOut, referenced from method com.google.api.games.Context$signOut.call
12-04 11:08:18.612 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6767: Lcom/google/example/games/basegameutils/GameHelper;.signOut ()V
12-04 11:08:18.612 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0009
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.612 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.612 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.622 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.isSignedIn, referenced from method com.google.api.games.Context$isSignedIn.call
12-04 11:08:18.622 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6740: Lcom/google/example/games/basegameutils/GameHelper;.isSignedIn ()Z
12-04 11:08:18.622 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x000a
12-04 11:08:18.622 23195 23195 I ~ANE~ : Context :: testANE.call
12-04 11:08:18.622 23195 23195 I ~ANE~ : Context :: promptUserToSignInOnStartup.call
12-04 11:08:18.622 23195 23195 I ~ANE~~ : Context :: Extension.autoSignIn = true
12-04 11:08:18.622 23195 23195 I ~ANE~ : Context :: start.call
12-04 11:08:18.622 23195 23195 I ~ANE~~ : Context :: start.call[END]
12-04 11:08:18.622 480 26966 I ActivityManager: START u0 {cmp=air.com.sq.kitchen/com.google.api.games.SignInActivity} from pid 23195
12-04 11:08:18.712 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6728: Lcom/google/example/games/basegameutils/GameHelper;.getInvitationId ()Ljava/lang/String;
12-04 11:08:18.712 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.712 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.712 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.712 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.712 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.712 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.getSignInError, referenced from method com.google.example.games.basegameutils.BaseGameActivity.getSignInError
12-04 11:08:18.712 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6731: Lcom/google/example/games/basegameutils/GameHelper;.getSignInError ()Lcom/google/example/games/basegameutils/GameHelper$SignInFailureReason;
12-04 11:08:18.712 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.732 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.732 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.742 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.742 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.762 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.762 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.762 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.makeSimpleDialog, referenced from method com.google.example.games.basegameutils.BaseGameActivity.showAlert
12-04 11:08:18.762 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6746: Lcom/google/example/games/basegameutils/GameHelper;.makeSimpleDialog (Ljava/lang/String;Ljava/lang/String;)Landroid/app/Dialog;
12-04 11:08:18.762 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.762 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.762 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.762 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 I dalvikvm: Could not find method com.google.example.games.basegameutils.GameHelper.signOut, referenced from method com.google.example.games.basegameutils.BaseGameActivity.signOut
12-04 11:08:18.762 23195 23195 W dalvikvm: VFY: unable to resolve virtual method 6767: Lcom/google/example/games/basegameutils/GameHelper;.signOut ()V
12-04 11:08:18.762 23195 23195 D dalvikvm: VFY: replacing opcode 0x6e at 0x0002
12-04 11:08:18.762 23195 23195 I dalvikvm: Failed resolving Lcom/google/example/games/basegameutils/GameHelper; interface 940 'Lcom/google/android/gms/common/api/GoogleApiClient$ConnectionCallbacks;'
12-04 11:08:18.762 23195 23195 W dalvikvm: Link of class 'Lcom/google/example/games/basegameutils/GameHelper;' failed
12-04 11:08:18.762 23195 23195 D dalvikvm: DexOpt: unable to opt direct call 0x1a39 at 0x08 in Lcom/google/example/games/basegameutils/BaseGameActivity;.getGameHelper
12-04 11:08:18.762 23195 23195 I ~ANE~ : SignInActivity :: onCreate
12-04 11:08:18.762 23195 23195 D AndroidRuntime: Shutting down VM
12-04 11:08:18.762 23195 23195 W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x416dbba8)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: FATAL EXCEPTION: main
12-04 11:08:18.762 23195 23195 E AndroidRuntime: Process: air.com.sq.kitchen, PID: 23195
12-04 11:08:18.762 23195 23195 E AndroidRuntime: java.lang.NoClassDefFoundError: com.google.example.games.basegameutils.GameHelper
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at com.google.example.games.basegameutils.BaseGameActivity.getGameHelper(Unknown Source)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at com.google.example.games.basegameutils.BaseGameActivity.onCreate(Unknown Source)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at com.google.api.games.SignInActivity.onCreate(Unknown Source)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:5231)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.ActivityThread.access$800(ActivityThread.java:135)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.os.Looper.loop(Looper.java:136)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5001)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:515)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
12-04 11:08:18.762 23195 23195 E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
12-04 11:08:18.782 480 14720 W ActivityManager: Force finishing activity air.com.sq.kitchen/com.google.api.games.SignInActivity
12-04 11:08:18.782 480 14720 W ActivityManager: Force finishing activity air.com.sq.kitchen/.AppEntry
inb4
I discovered this issue very thoroughly and found several simular threads, but none of them resolved my problem
1) The solution of Google plus ane air native extension failed resolving interface
jar xf /path-to-play-services-project/libs/google-play-services.jar
jar uf ./my_gplus_extension.jar ./com
does not fix anything.
2) Any manipulations with Eclipse Adobe Air 4.0 Native Extension with Google Play Services don't help either (after all, I am building JAR using ANT).
3) I do modify resourses (\google-play-services_lib\res*.*) when switching to a new google-service-library.
4) I even tried to extend google's interfaces and modified my GameHelper to implement them, but that did not help either (dl.dropboxusercontent.com/u/13839683/ane/extend_interface.jpg).

I managed to solve partially this problem. I asked the same question on starling-forum and it's member tsangwailam suggested me to replace the dx.jar in AIR SDK to the new one in Android SDK.
replacing dx.jar really helped. I took %ANDROID_SKD%\sdk\build-tools\19.1.0\lib\dx.jar and copied it into %FLEXSDK%\lib\android\bin\dx.jar
and the extension began to work correctly!
but...
as soon as I run an activity SingInActivity
Intent intent = new Intent(context.getActivity().getApplicationContext(), SingInActivity.class);
context.getActivity().startActivity(intent);
my application becomes inactive - fails to handle touches.
it seems like some invisible modal popup appears and does'n allow my application to catch taps.
after minimizing and restoring my application I see that SingInActivity steps into mehtod "protected void onStart()" and I know my applicatins "sees" it, because I log it using FREContext.dispatchStatusEventAsync() into my Flash's textfield, but application is stil not able to handle user inputs (both native flash and starling/stage3d TouchEvents)
it's an interesting fact, that when my AIR application loses ability to handle touches, android's navigating buttons turn from hidden dots into actual buttons :
https://dl.dropboxusercontent.com/u/13839683/ane/untouchable.png
as for device log, I don't see there any erros, or Java ecxeptions, or nothing (at least for me) that could explain such behavior.
So what can it be? Maybe there are some other JARs I need to replace?

Related

Why does use of multiDexEnabled (true) allow the app to build but constantly crash?

An app I am working on (base code not written by me, containing a number of large libs which can't be removed). On a recent run it started responding with the message:
This only occurs when the app tries to build when using the run arrow, it successfully builds when calling "rebuild" or "clean".
A solution included on line is to use the multiDexEnabled true (multiDex documentation here.)
Using this I was able to get the building with both "run" arrow and "rebuild". However the app built and run on phone crashes withthe following error message:
12-11 16:17:16.963 28868-28868/? D/dalvikvm: Late-enabling CheckJNI
12-11 16:17:17.023 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10471 (common_google_play_services_updating_text) in Lcom/google/android/gms/R$string;
12-11 16:17:17.023 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0021
12-11 16:17:17.023 28868-28868/com.myname.myappcoop I/dalvikvm: DexOpt: unable to optimize static field ref 0x28e8 at 0x2e in Lcom/google/android/gms/common/GoogleApiAvailability;.zza
12-11 16:17:17.033 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10465 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
12-11 16:17:17.033 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0012
12-11 16:17:17.033 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10462 (common_google_play_services_notification_ticker) in Lcom/google/android/gms/R$string;
12-11 16:17:17.033 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0013
12-11 16:17:17.033 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10437 (common_ic_googleplayservices) in Lcom/google/android/gms/R$drawable;
12-11 16:17:17.033 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0039
12-11 16:17:17.033 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10462 (common_google_play_services_notification_ticker) in Lcom/google/android/gms/R$string;
12-11 16:17:17.033 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0099
12-11 16:17:17.043 28868-28868/com.myname.myappcoop I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzj
12-11 16:17:17.043 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve virtual method 616: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
12-11 16:17:17.043 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
12-11 16:17:17.043 28868-28868/com.myname.myappcoop I/dalvikvm: DexOpt: unable to optimize static field ref 0x28c4 at 0x6c in Lcom/google/android/gms/common/GooglePlayServicesUtil;.zza
12-11 16:17:17.043 28868-28868/com.myname.myappcoop I/dalvikvm: DexOpt: unable to optimize static field ref 0x28e9 at 0x6e in Lcom/google/android/gms/common/GooglePlayServicesUtil;.zza
12-11 16:17:17.083 28868-28907/com.myname.myappcoop I/GMPM: App measurement is starting up
12-11 16:17:17.083 28868-28907/com.myname.myappcoop E/GMPM: getGoogleAppId failed with status: 10
12-11 16:17:17.083 28868-28907/com.myname.myappcoop E/GMPM: Uploading is not possible. App measurement disabled
12-11 16:17:17.113 28868-28868/com.myname.myappcoop D/dalvikvm: GC_FOR_ALLOC freed 358K, 3% free 16887K/17276K, paused 11ms, total 12ms
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8714 (static_string) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x000b
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8710 (static_string2) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x000e
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8711 (static_string3) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0011
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8716 (static_string4) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0014
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8717 (static_string5) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0017
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8721 (static_string6) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x001a
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8720 (static_string7) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x001d
12-11 16:17:17.133 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 8719 (static_string8) in Lcom/myname/display/R$string;
12-11 16:17:17.133 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x60 at 0x0020
12-11 16:17:17.143 28868-28868/com.myname.myappcoop D/MAIN: Context 1 : com.myname.myapp.Application#4268dfe8
12-11 16:17:17.163 28868-28868/com.myname.myappcoop E/dalvikvm: Could not find class 'com.myname.myapp.view.FalseActionBar$1', referenced from method com.myname.myapp.view.FalseActionBar.initializeView
12-11 16:17:17.163 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve new-instance 3015 (Lcom/myname/myapp/view/FalseActionBar$1;) in Lcom/myname/myapp/view/FalseActionBar;
12-11 16:17:17.163 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x22 at 0x002a
12-11 16:17:17.163 28868-28868/com.myname.myappcoop W/dalvikvm: VFY: unable to resolve static field 10366 ($SwitchMap$com$myname$myapp$view$FalseActionBar$TitleMode) in Lcom/myname/myapp/view/FalseActionBar$3;
12-11 16:17:17.163 28868-28868/com.myname.myappcoop D/dalvikvm: VFY: replacing opcode 0x62 at 0x0005
12-11 16:17:17.163 28868-28868/com.myname.myappcoop D/dalvikvm: DexOpt: unable to opt direct call 0x5db9 at 0x2c in Lcom/myname/myapp/view/FalseActionBar;.initializeView
12-11 16:17:17.163 28868-28868/com.myname.myappcoop D/dalvikvm: DexOpt: unable to opt direct call 0x5dba at 0x46 in Lcom/myname/myapp/view/FalseActionBar;.initializeView
12-11 16:17:17.163 28868-28868/com.myname.myappcoop D/AndroidRuntime: Shutting down VM
12-11 16:17:17.163 28868-28868/com.myname.myappcoop W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x4162fba8)
12-11 16:17:17.163 28868-28868/com.myname.myappcoop E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myname.myappcoop, PID: 28868
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myname.myappcoop/com.myname.myapp.MainActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class com.myname.myapp.view.FalseActionBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class com.myname.myapp.view.FalseActionBar
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
at android.app.Activity.setContentView(Activity.java:1929)
at com.myname.myapp.MainActivity.onCreate(MainActivity.java:96)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5001) 
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:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at android.view.LayoutInflater.createView(LayoutInflater.java:594)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290) 
at android.app.Activity.setContentView(Activity.java:1929) 
at com.myname.myapp.MainActivity.onCreate(MainActivity.java:96) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5001) 
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:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
Caused by: java.lang.NoClassDefFoundError: com.myname.myapp.view.FalseActionBar$1
at com.myname.myapp.view.FalseActionBar.initializeView(FalseActionBar.java:61)
at com.myname.myapp.view.FalseActionBar.<init>(FalseActionBar.java:46)
at java.lang.reflect.Constructor.constructNative(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
at android.view.LayoutInflater.createView(LayoutInflater.java:594) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:353) 
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290) 
at android.app.Activity.setContentView(Activity.java:1929) 
at com.myname.myapp.MainActivity.onCreate(MainActivity.java:96) 
at android.app.Activity.performCreate(Activity.java:5231) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
at android.app.ActivityThread.access$800(ActivityThread.java:135) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:136) 
at android.app.ActivityThread.main(ActivityThread.java:5001) 
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:785) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
at dalvik.system.NativeStart.main(Native Method) 
12-11 16:17:46.173 28868-28868/? I/Process: Sending signal. PID: 28868 SIG: 9
The where the code is crashing (Caused by: java.lang.NoClassDefFoundError: com.myname.myapp.view.FalseActionBar$1) is when a listener is being declared. It was originally in another class extending on click listener so I brought it into the code, but that did not help.
title.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View v) {
switch (mode) {
case NONE:
//Nothing!
break;
case BACK:
if(delegate != null){
delegate.goBack(backLocation);
}
break;
case HOME:
if(delegate != null){
delegate.goHome();
}
break;
}
}
I originally thought the issue was with the inflater though now I am fairly sure it must be with the use of multiDex.
What is multiDex doing that is causing the crash on inflation?
you need to do following things
in build.gradle add
dexOptions {
javaMaxHeapSize "4g"
}
enable multidex
defaultConfig {
multiDexEnabled true
}
Create a file extends with MultiDexApplication as following
public class App extends MultiDexApplication {
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
and make this 'App' class as application class in manifest as below -
<application
android:name=".activity.App"
Just add
android:name="android.support.multidex.MultiDexApplication"
in AndroidManifest.xml in the application XM tag as property.
This will solve all your problems.
NoClassDefFoundError comes because of your project not getting file at run time. so try this suggestion and let me know is it solved or not.
Error:Execution failed for task ':app:dexDebug' error in my project while I added new dependency
Hope you are using android studio.
Try to add this line too to the gradle file and retest the same
dexOptions {
javaMaxHeapSize "4g"
}

Application Crashes on Start after creating Application Class to set Parse.com Push Notifications

I'm following this tutorial to enable Parse Push Notifications.https://parse.com/tutorials/android-push-notifications
I also downloaded the code and used it in my own application. But it is causing the application to crash on start and I don't know why.
Here is my code for the Application Class:
public class Application extends android.app.Application {
public Application() {
}
#Override
public void onCreate() {
super.onCreate();
// Initialize the Parse SDK.
Parse.initialize(this, "My_APP_ID", "My_CLIENT_KEY");
// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
}
}
When I remove the last two lines related to Parse my application works fine. Could you please help me.
This is the logcat output:
--------- beginning of /dev/log/main
05-28 12:24:44.755 2638-2638/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-28 12:24:44.765 2638-2638/? D/AndroidRuntime﹕ CheckJNI is OFF
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
05-28 12:24:44.765 2638-2638/? D/dalvikvm﹕ No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-28 12:24:44.775 2638-2638/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
05-28 12:24:44.845 2638-2638/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
05-28 12:24:44.845 2638-2638/? E/android.os.Debug﹕ failed to load memtrack module: -2
05-28 12:24:44.865 2638-2638/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
--------- beginning of /dev/log/system
05-28 12:24:44.865 1724-1815/system_process I/ActivityManager﹕ Force stopping com.example.adla.insurancemobileapplication appid=10066 user=0: from pid 2638
05-28 12:24:44.875 2638-2638/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:44.875 2638-2645/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:44.875 2638-2647/? I/AndroidRuntime﹕ NOTE: attach of thread 'Binder_1' failed
05-28 12:24:44.875 2638-2646/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
05-28 12:24:44.875 1724-1739/system_process I/ActivityManager﹕ Setting mBooting value to false, currently mBooted = true
05-28 12:24:45.135 2658-2658/? D/AndroidRuntime﹕ >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-28 12:24:45.135 2658-2658/? D/AndroidRuntime﹕ CheckJNI is OFF
05-28 12:24:45.145 2658-2658/? D/dalvikvm﹕ Trying to load lib libjavacore.so 0x0
05-28 12:24:45.145 2658-2658/? D/dalvikvm﹕ Added shared lib libjavacore.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ Trying to load lib libnativehelper.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ Added shared lib libnativehelper.so 0x0
05-28 12:24:45.155 2658-2658/? D/dalvikvm﹕ No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-28 12:24:45.165 2658-2658/? D/dalvikvm﹕ Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
05-28 12:24:45.265 2658-2665/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
05-28 12:24:45.305 2658-2658/? E/memtrack﹕ Couldn't load memtrack module (No such file or directory)
05-28 12:24:45.305 2658-2658/? E/android.os.Debug﹕ failed to load memtrack module: -2
05-28 12:24:45.325 2658-2658/? D/AndroidRuntime﹕ Calling main entry com.android.commands.am.Am
05-28 12:24:45.345 1724-1735/system_process I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.adla.insurancemobileapplication/.MainActivity} from pid 2658
05-28 12:24:45.345 1724-1735/system_process D/ActivityManager﹕ TopActivityInfo, pkgName: com.example.adla.insurancemobileapplication activityName: com.example.adla.insurancemobileapplication.MainActivity bstSpecialAppKeyboardHandlingEnabled = false
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ event === app_launch
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ hiding guidance
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ hardKeyboard = 1
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ controllerType === DualAction
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ appName: InsuranceMobileApplication, currentPkg: com.example.adla.insurancemobileapplication, event: app_launch, controller: DualAction
05-28 12:24:45.345 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ appName: InsuranceMobileApplication
05-28 12:24:45.345 1724-1735/system_process D/ActivityManager﹕ Showing guidance for pkgName: com.example.adla.insurancemobileapplication
05-28 12:24:45.355 2658-2658/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.355 2658-2665/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:45.355 1917-1917/com.bluestacks.appguidance D/GuidanceScreen﹕ no guidance for com.example.adla.insurancemobileapplication.
05-28 12:24:45.355 2669-2669/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.375 2669-2675/? D/dalvikvm﹕ Debugger has detached; object registry had 1 entries
05-28 12:24:45.375 1724-1913/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2669 uid=10066 gids={50066, 3003}
05-28 12:24:45.395 2031-2031/com.bluestacks.home D/Home.AppLaunchReceiver﹕ *************************Received app launch broadcast
05-28 12:24:45.395 2031-2031/com.bluestacks.home D/Home.AppLaunchReceiver﹕ APP LAUNCH com.example.adla.insurancemobileapplication
05-28 12:24:45.435 1724-1743/system_process D/WindowManager﹕ Sending appClickStats request with data: [package=com.example.adla.insurancemobileapplication, appname=InsuranceMobileApplication, appver=1.0, clickloc=system_server]
05-28 12:24:45.455 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.455 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.455 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.455 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.455 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.455 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.465 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.465 2669-2669/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.465 2669-2669/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.465 2669-2669/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.475 2669-2669/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.475 2669-2669/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.495 2669-2672/? D/dalvikvm﹕ GC_CONCURRENT freed 324K, 18% free 3063K/3728K, paused 10ms+10ms, total 20ms
05-28 12:24:45.505 2669-2669/? D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 10ms
05-28 12:24:45.505 2669-2669/? I/Process﹕ Sending signal. PID: 2669 SIG: 9
05-28 12:24:45.505 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.505 2669-2669/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.505 2669-2669/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2669
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
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:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            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:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.505 1724-1735/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2669) has died.
05-28 12:24:45.515 2689-2689/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.525 1724-1735/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2689 uid=10066 gids={50066, 3003}
05-28 12:24:45.635 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.635 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.635 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.635 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.635 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.635 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2692/? D/dalvikvm﹕ GC_CONCURRENT freed 454K, 20% free 3016K/3728K, paused 10ms+0ms, total 40ms
05-28 12:24:45.645 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.645 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2689/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.645 2689-2689/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.645 2689-2689/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.645 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.645 2689-2689/? I/Process﹕ Sending signal. PID: 2689 SIG: 9
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.645 2689-2689/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2689
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
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:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            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:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.655 2727-2727/? D/dalvikvm﹕ Late-enabling CheckJNI
05-28 12:24:45.655 1724-1909/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2689) has died.
05-28 12:24:45.675 1724-1909/system_process I/ActivityManager﹕ Start proc com.example.adla.insurancemobileapplication for activity com.example.adla.insurancemobileapplication/.MainActivity: pid=2727 uid=10066 gids={50066, 3003}
05-28 12:24:45.705 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
05-28 12:24:45.705 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 452: Landroid/content/res/TypedArray;.getChangingConfigurations ()I
05-28 12:24:45.705 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.705 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
05-28 12:24:45.705 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 474: Landroid/content/res/TypedArray;.getType (I)I
05-28 12:24:45.705 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.725 2727-2731/? D/dalvikvm﹕ GC_CONCURRENT freed 433K, 25% free 2826K/3728K, paused 10ms+0ms, total 10ms
05-28 12:24:45.735 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawable
05-28 12:24:45.735 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 415: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.735 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.735 2727-2727/? I/dalvikvm﹕ Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.internal.widget.ResourcesWrapper.getDrawableForDensity
05-28 12:24:45.735 2727-2727/? W/dalvikvm﹕ VFY: unable to resolve virtual method 417: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;
05-28 12:24:45.735 2727-2727/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x0002
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ Shutting down VM
05-28 12:24:45.745 2727-2727/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x95d30b20)
05-28 12:24:45.745 1946-1996/com.bluestacks.BstCommandProcessor D/BstCommandProcessor-Application﹕ Application crash has been observed.
05-28 12:24:45.745 2727-2727/? I/Process﹕ Sending signal. PID: 2727 SIG: 9
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ procName from cmdline: com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? E/AndroidRuntime﹕ in writeCrashedAppName, pkgName :com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? D/AndroidRuntime﹕ file written successfully with content: com.example.adla.insurancemobileapplication StringBuffer : ;com.example.adla.insurancemobileapplication
05-28 12:24:45.745 2727-2727/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.adla.insurancemobileapplication, PID: 2727
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.adla.insurancemobileapplication/com.example.adla.insurancemobileapplication.MainActivity}: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2195)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5021)
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:827)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.IllegalStateException: `Parse#enableLocalDatastore(Context)` must be invoked before `Parse#initialize(Context)`
at com.parse.Parse.enableLocalDatastore(Parse.java:65)
at com.example.adla.insurancemobileapplication.MainActivity.onCreate(MainActivity.java:48)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5021)
            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:827)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:643)
            at dalvik.system.NativeStart.main(Native Method)
05-28 12:24:45.755 1724-1914/system_process I/ActivityManager﹕ Process com.example.adla.insurancemobileapplication (pid 2727) has died.
05-28 12:24:45.755 1724-1914/system_process W/ActivityManager﹕ Force removing ActivityRecord{4b263638 u0 com.example.adla.insurancemobileapplication/.MainActivity t11}: app died, no saved state
Caused by: java.lang.IllegalStateException:
Parse#enableLocalDatastore(Context) must be invoked before
Parse#initialize(Context)
Seems you just need to follow the advice from the exception:
#Override
public void onCreate() {
super.onCreate();
Parse.enableLocalDatastore(this);
// Initialize the Parse SDK.
Parse.initialize(this, "My_APP_ID", "My_CLIENT_KEY");
// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
}

Android Maps v2 Stopped Working

I've had Google Maps v2 up and running for months, no code has changed, and now every fragment with a MapFragment crashes when attached. (Building without proguard and signing with debug key)
I am guessing that it has to do with Play Services, because it appeared to work after re-installing the Play Services updates. But now it crashes again, even with re-installing. This occurs on two Samsung Note 8s, a Note 3, a Note 1, and a Nexus 5.
I have tried clean builds and regenerating the Maps API with a different Google APIs account.
I've included the necessary bits in my AndroidManifest:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="#string/app_id_maps"/>
I include the following xml in the my fragment layouts:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
map:mapType="normal"
map:uiCompass="true"
map:uiRotateGestures="true"
map:uiScrollGestures="true"
map:uiTiltGestures="true"
map:uiZoomControls="false"
map:uiZoomGestures="true"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Logcat:
07-31 08:23:57.721 31926-31926/com.packagename I/u﹕ Making Creator dynamically
07-31 08:23:57.731 31926-31926/com.packagename I/Google Maps Android API﹕ Google Play services client version: 5077000
07-31 08:23:57.731 31926-31926/com.packagename I/dalvikvm﹕ Could not find method guj.a, referenced from method gqi.a
07-31 08:23:57.731 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static method 24936: Lguj;.a (Landroid/content/Context;)Lgri;
07-31 08:23:57.731 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x71 at 0x0003
07-31 08:23:57.731 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.731 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.731 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.736 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'gpr', referenced from method gps.a
07-31 08:23:57.736 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve new-instance 4090 (Lgpr;) in Lgps;
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x22 at 0x0000
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0c in Lgps;.a
07-31 08:23:57.736 31926-31926/com.packagename D/dalvikvm﹕ DexOpt: unable to opt direct call 0x5ea3 at 0x0a in Lgps;.a
07-31 08:23:57.741 31926-31926/com.packagename I/Google Maps Android API﹕ Google Play services package version: 5084030
07-31 08:23:57.746 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-31 08:23:57.746 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000e
07-31 08:23:57.746 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve static field 20873 (t) in Lyp;
07-31 08:23:57.746 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x62 at 0x000d
07-31 08:23:57.846 31926-31926/com.packagename I/dalvikvm﹕ Failed resolving Lcom/google/android/gms/location/internal/ParcelableGeofence; interface 4023 'Lgln;'
07-31 08:23:57.846 31926-31926/com.packagename W/dalvikvm﹕ Link of class 'Lcom/google/android/gms/location/internal/ParcelableGeofence;' failed
07-31 08:23:57.846 31926-31926/com.packagename E/dalvikvm﹕ Could not find class 'com.google.android.gms.location.internal.ParcelableGeofence', referenced from method glt.a
07-31 08:23:57.846 31926-31926/com.packagename W/dalvikvm﹕ VFY: unable to resolve check-cast 2086 (Lcom/google/android/gms/location/internal/ParcelableGeofence;) in Lglt;
07-31 08:23:57.846 31926-31926/com.packagename D/dalvikvm﹕ VFY: replacing opcode 0x1f at 0x0019
07-31 08:23:57.886 31926-31926/com.packagename D/dalvikvm﹕ GC_FOR_ALLOC freed 3142K, 31% free 10122K/14616K, paused 19ms, total 19ms
07-31 08:23:57.901 31926-31926/com.packagename D/AbsListView﹕ Get MotionRecognitionManager
07-31 08:23:57.916 31926-32063/com.packagename A/libc﹕ Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 32063 (DataRequestDisp)
07-31 08:23:57.921 31926-31926/com.packagename D/ProgressBar﹕ setProgressDrawable drawableHeight = 0
07-31 08:23:57.921 31926-31926/com.packagename D/AbsSeekBar﹕ AbsSeekBar Constructor: misSeebarAnimationAvailable = false
07-31 08:23:57.956 31926-31926/com.packagename W/GmsClientEvents﹕ registerConnectionCallbacks(): listener com.google.android.gms.internal.hc$c#429b29d0 is already registered
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: left = 0
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: top = 0
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: right = 64
07-31 08:23:58.011 31926-31926/com.packagename D/ProgressBar﹕ updateDrawableBounds: bottom = 64
On Samsung devices I also get this stacktrace:
07-31 08:23:57.656 31926-31926/com.packagename W/dalvikvm﹕ No implementation found for native Ldalvik/system/VMRuntime;.pauseGc:(Ljava/lang/String;)I
07-31 08:23:57.661 31926-31926/com.packagename E/ActivityThread﹕ Pause GC
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.app.ActivityThread.pauseGC(ActivityThread.java:5410)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Native method not found: dalvik.system.VMRuntime.pauseGc:(Ljava/lang/String;)I
at dalvik.system.VMRuntime.pauseGc(Native Method)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at android.app.ActivityThread.pauseGC(ActivityThread.java:5410)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2277)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
at android.app.ActivityThread.access$900(ActivityThread.java:169)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5487)
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:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)

java mail 1.4.5 on android

I'm developing a IMAP client on a custom Android device. So i decided to use the Java Mail library.
I needed to update from the 1.4.1 version of Java Mail to 1.4.5 because i had memory problem in case of huge INBOX folder (About 120k mails).
So i downloaded the 2 jars (mail.jar and activation.jar) from the official home page, i tried also with the release candidate 1.4.6 but i cannot make it works.
Once i build the entire app, everything is ok, but when i run, here's what it comes:
2-05 17:31:21.020 19862 19912 I dalvikvm: Failed resolving Ljavax/activation/DataHandler; interface 571 'Ljava/awt/datatransfer/Transferable;'
12-05 17:31:21.030 19862 19912 W dalvikvm: Link of class 'Ljavax/activation/DataHandler;' failed
12-05 17:31:21.030 19862 19912 W dalvikvm: VFY: unable to find class referenced in signature (Ljavax/activation/DataHandler;)
12-05 17:31:21.030 19862 19912 I dalvikvm: Failed resolving Ljavax/activation/DataHandler; interface 571 'Ljava/awt/datatransfer/Transferable;'
12-05 17:31:21.030 19862 19912 W dalvikvm: Link of class 'Ljavax/activation/DataHandler;' failed
12-05 17:31:21.030 19862 19912 E dalvikvm: Could not find method javax.activation.DataHandler.getName, referenced from method javax.mail.internet.MimeUtility.getEncoding
12-05 17:31:21.030 19862 19912 W dalvikvm: VFY: unable to resolve virtual method 4632: Ljavax/activation/DataHandler;.getName ()Ljava/lang/String;
12-05 17:31:21.040 19862 19912 W dalvikvm: VFY: rejecting opcode 0x6e at 0x0004
12-05 17:31:21.040 19862 19912 W dalvikvm: VFY: rejected Ljavax/mail/internet/MimeUtility;.getEncoding (Ljavax/activation/DataHandler;)Ljava/lang/String;
12-05 17:31:21.040 19862 19912 W dalvikvm: Verifier rejected class Ljavax/mail/internet/MimeUtility;
12-05 17:31:21.050 19862 19912 D EMAIL : Releasing mail download wake lock
12-05 17:31:21.050 19862 19912 W dalvikvm: threadid=17: thread exiting with uncaught exception (group=0x4001aa30)
12-05 17:31:21.060 19862 19912 E AndroidRuntime: Uncaught handler: thread pool-1-thread-1 exiting due to uncaught exception
12-05 17:31:21.080 19862 19912 E AndroidRuntime: java.lang.VerifyError: javax.mail.internet.MimeUtility
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at com.sun.mail.imap.protocol.IMAPProtocol.<init>(IMAPProtocol.java:130)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at com.sun.mail.imap.IMAPStore.newIMAPProtocol(IMAPStore.java:685)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:636)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at javax.mail.Service.connect(Service.java:295)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at javax.mail.Service.connect(Service.java:176)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at it.kynetics.imwatch.email.imap.EmailAuthenticationImpl.login(EmailAuthenticationImpl.java:36)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at it.kynetics.imwatch.email.imap.EmailConnection.execute(EmailConnection.java:21)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at it.kynetics.imwatch.email.ImCloudEmailService$GetEmailTask.run(ImCloudEmailService.java:148)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:648)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:673)
12-05 17:31:21.080 19862 19912 E AndroidRuntime: at java.lang.Thread.run(Thread.java:1060)
12-05 17:31:21.120 1830 1830 I Process : Sending signal. PID: 19862 SIG: 3
I tried checking the DataHandler and getName method in the jar, and everything is ok.
Is there anyone who had the same problem?
Thanks to all.
Not every java library works on Android. You can only use javamail port for android. The latest versions of Javamail have still not been ported for Android
I found the solution! I needed to modify the mail.jar and its source codes. It'a "import packaging" problem. In the Android porting, some of the mail.jar classes, import other classes from the additionnal.jar in which the package name is myjava.awt. exc.
In java mail 1.4.5 that package is named java.awt exc, withouth the "my" prefix. Fixing that, all will work.
Thanks to all!

Android: AdWhirl cannot find AdMobAdapter

Using AdMob by itself works perfectly. Using AdMob through AdWhirl causes the following problem:
23114 dalvikvm I Failed resolving Lcom/adwhirl/adapters/AdMobAdapter; interface 144 'Lcom/admob/android/ads/AdListener;'
23114 dalvikvm W Link of class 'Lcom/adwhirl/adapters/AdMobAdapter;' failed
23114 dalvikvm E Could not find class 'com.adwhirl.adapters.AdMobAdapter', referenced from method com.adwhirl.adapters.AdWhirlAdapter.getAdapter
23114 dalvikvm W VFY: unable to resolve new-instance 172 (Lcom/adwhirl/adapters/AdMobAdapter;) in Lcom/adwhirl/adapters/AdWhirlAdapter;
23114 dalvikvm D VFY: replacing opcode 0x22 at 0x0012
23114 dalvikvm D Making a copy of Lcom/adwhirl/adapters/AdWhirlAdapter;.getAdapter code (229 bytes)
23114 dalvikvm I Failed resolving Lcom/adwhirl/adapters/QuattroAdapter; interface 524 'Lcom/qwapi/adclient/android/view/AdEventsListener;'
23114 dalvikvm W Link of class 'Lcom/adwhirl/adapters/QuattroAdapter;' failed
23114 dalvikvm E Could not find class 'com.adwhirl.adapters.QuattroAdapter', referenced from method com.adwhirl.adapters.AdWhirlAdapter.getAdapter
23114 dalvikvm W VFY: unable to resolve new-instance 177 (Lcom/adwhirl/adapters/QuattroAdapter;) in Lcom/adwhirl/adapters/AdWhirlAdapter;
23114 dalvikvm D VFY: replacing opcode 0x22 at 0x002c
23114 AndroidRuntime D Shutting down VM
23114 dalvikvm W threadid=3: thread exiting with uncaught exception (group=0x4001b180)
23114 FlurryAgent D Ending session
23114 LocationManager D removeUpdates: listener = com.flurry.android.FlurryAgent#4496be70
23114 AndroidRuntime E Uncaught handler: thread main exiting due to uncaught exception
23114 AndroidRuntime E java.lang.NoClassDefFoundError: com.adwhirl.adapters.AdMobAdapter
23114 AndroidRuntime E at com.adwhirl.adapters.AdWhirlAdapter.getAdapter(AdWhirlAdapter.java:39)
23114 AndroidRuntime E at com.adwhirl.AdWhirlLayout.handleAd(AdWhirlLayout.java:154)
23114 AndroidRuntime E at com.adwhirl.AdWhirlLayout.access$0(AdWhirlLayout.java:143)
23114 AndroidRuntime E at com.adwhirl.AdWhirlLayout$1.run(AdWhirlLayout.java:87)
23114 AndroidRuntime E at android.os.Handler.handleCallback(Handler.java:587)
23114 AndroidRuntime E at android.os.Handler.dispatchMessage(Handler.java:92)
23114 AndroidRuntime E at android.os.Looper.loop(Looper.java:123)
23114 AndroidRuntime E at android.app.ActivityThread.main(ActivityThread.java:4363)
23114 AndroidRuntime E at java.lang.reflect.Method.invokeNative(Native Method)
23114 AndroidRuntime E at java.lang.reflect.Method.invoke(Method.java:521)
23114 AndroidRuntime E at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
23114 AndroidRuntime E at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
23114 AndroidRuntime E at dalvik.system.NativeStart.main(Native Method)
Any ideas?
If you use adwhirl you still have to include all the other ad sdks. Looks like it can't find
com/admob/android/ads/AdListener
Lcom/qwapi/adclient/android/view/AdEventsListener
Make sure you are still including the admob and quattro sdks.

Categories

Resources