java mail 1.4.5 on android - 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!

Related

adb shell am instrument process crashed

I'm trying to run an espresso black box test on a 3rd party apk file using a test apk file. I've set the testApplicationId in the build.gradle, and the targetPackage in AndroidManifest.xml.
Here's the commands I run:
adb install app-debug.apk
Success
adb install app-debug-androidTest.apk
Success
adb shell am instrument -w com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0
Here's the tomcat log:
09-11 22:22:17.065 8576 8576 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
09-11 22:22:17.098 8576 8576 W app_process: Unexpected CPU variant for X86 using defaults: x86
09-11 22:22:17.116 8576 8576 D AndroidRuntime: Calling main entry com.android.commands.am.Am
09-11 22:22:17.118 1510 2317 I ActivityManager: Force stopping org.wikipedia.alpha appid=10102 user=0: start instr
09-11 22:22:17.123 8586 8586 I zygote : Not late-enabling -Xcheck:jni (already on)
09-11 22:22:17.130 1510 2317 I ActivityManager: Start proc 8586:org.wikipedia.alpha/u0a102 for added application org.wikipedia.alpha
09-11 22:22:17.131 8586 8586 W zygote : Unexpected CPU variant for X86 using defaults: x86
09-11 22:22:17.149 8586 8586 W zygote : Found duplicate classes, falling back to extracting from APK : /data/app/org.wikipedia.alpha-X9wevNAQOGt3rTh-c4Ydpg==/base.apk
09-11 22:22:17.149 8586 8586 W zygote : NOTE: This wastes RAM and hurts startup performance.
09-11 22:22:17.149 8586 8586 W zygote : Found duplicated class when checking oat files: 'Landroid/support/annotation/AnimRes;' in /data/app/org.wikipedia.alpha-X9wevNAQOGt3rTh-c4Ydpg==/base.apk and /data/app/com.example.android.testing.espresso.WikipediaTester-iiYiial_oKwqZvmMrjx_Zw==/base.apk
09-11 22:22:17.149 8586 8586 W zygote :
09-11 22:22:17.279 8586 8586 W System : ClassLoader referenced unknown path:
09-11 22:22:17.281 8586 8586 D AndroidRuntime: Shutting down VM
09-11 22:22:17.282 8586 8586 E AndroidRuntime: FATAL EXCEPTION: main
09-11 22:22:17.282 8586 8586 E AndroidRuntime: Process: org.wikipedia.alpha, PID: 8586
09-11 22:22:17.282 8586 8586 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner}: java.lang.ClassNotFoundException: Didn't find class "android.support.test.runner.AndroidJUnitRunner" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib, /system/vendor/lib]]
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5730)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.-wrap1(Unknown Source:0)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1661)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6541)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.test.runner.AndroidJUnitRunner" on path: DexPathList[[],nativeLibraryDirectories=[/system/lib, /system/vendor/lib]]
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5728)
09-11 22:22:17.282 8586 8586 E AndroidRuntime: ... 8 more
09-11 22:22:17.284 8586 8586 I Process : Sending signal. PID: 8586 SIG: 9
09-11 22:22:17.328 1510 1522 I ActivityManager: Process org.wikipedia.alpha (pid 8586) has died: fore FGS
09-11 22:22:17.329 1510 1522 W ActivityManager: Crash of app org.wikipedia.alpha running instrumentation ComponentInfo{com.example.android.testing.espresso.WikipediaTester/android.support.test.runner.AndroidJUnitRunner}
09-11 22:22:17.329 1510 1522 I ActivityManager: Force stopping org.wikipedia.alpha appid=10102 user=0: finished inst
09-11 22:22:17.330 1510 8604 W Binder : Outgoing transactions from this process must be FLAG_ONEWAY
09-11 22:22:17.330 1510 8604 W Binder : java.lang.Throwable
09-11 22:22:17.330 1510 8604 W Binder : at android.os.BinderProxy.transact(Binder.java:736)
09-11 22:22:17.330 1510 8604 W Binder : at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:160)
09-11 22:22:17.330 1510 8604 W Binder : at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
09-11 22:22:17.331 8576 8576 D AndroidRuntime: Shutting down VM
Figured it out, moved from androidTest to main

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

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?

Android NDK: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi"

My NDK game works well in Debug mode, but crashes in release with the following log on Nexus 7:
E dalvikvm: dlopen("/data/app-lib/com.js.pathoflight-1/libPathOfLight.so") failed: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by
"libPathOfLight.so"...
W dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/js /pathoflight/JSNativeActivity;
W dalvikvm: Class init failed in newInstance call (Lcom/js/pathoflight/JSNativeActivity;)
D AndroidRuntime: Shutting down VM
W dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b01700)
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__gnu_thumb1_case_uqi" referenced by "libPathOfLight.so"...
E AndroidRuntime: at java.lang.Runtime.loadLibrary(Runtime.java:361)
E AndroidRuntime: at java.lang.System.loadLibrary(System.java:525)
E AndroidRuntime: at com.js.pathoflight.JSNativeActivity.<clinit>(JSNativeActivity.java:59)
E AndroidRuntime: at java.lang.Class.newInstanceImpl(Native Method)
E AndroidRuntime: at java.lang.Class.newInstance(Class.java:1130)
E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
E AndroidRuntime: at android.app.ActivityThread.access$600(ActivityThread.java:141)
E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:137)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5103)
E AndroidRuntime: at java.lang.reflect.Method.invokeNative(Native Method)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Method.java:525)
E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
E AndroidRuntime: at dalvik.system.NativeStart.main(Native Method)
W ActivityManager: Force finishing activity com.js.pathoflight/.JSNativeActivity
I'll appreciate any suggestion.
While removing different parts of the code I found that the issue was in a 3rd party library I used.
I changed its usage from "gnustl_static" version (.a) to "gnustl_shared" (.so) one and the problem disappeared!

Android app crashes as i try to use kSoap2

Hi im new to Android development.. Sorry.
My Android App crashes as i am trying to use kSoap2 to connect the app to a web service:
My Error log is as follows:
2-05 12:48:05.100: E/dalvikvm(749): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.example.mytestws.MainActivity.onCreate
12-05 12:48:05.100: W/dalvikvm(749): VFY: unable to resolve new-instance 548 (Lorg/ksoap2/serialization/SoapObject;) in Lcom/example/mytestws/MainActivity;
12-05 12:48:05.100: D/dalvikvm(749): VFY: replacing opcode 0x22 at 0x0012
12-05 12:48:05.100: D/dalvikvm(749): VFY: dead code 0x0014-0057 in Lcom/example/mytestws/MainActivity;.onCreate (Landroid/os/Bundle;)V
12-05 12:48:05.250: D/AndroidRuntime(749): Shutting down VM
12-05 12:48:05.250: W/dalvikvm(749): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
12-05 12:48:05.261: E/AndroidRuntime(749): FATAL EXCEPTION: main
12-05 12:48:05.261: E/AndroidRuntime(749): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
12-05 12:48:05.261: E/AndroidRuntime(749): at com.example.mytestws.MainActivity.onCreate(MainActivity.java:29)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.os.Handler.dispatchMessage(Handler.java:99)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.os.Looper.loop(Looper.java:123)
12-05 12:48:05.261: E/AndroidRuntime(749): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-05 12:48:05.261: E/AndroidRuntime(749): at java.lang.reflect.Method.invokeNative(Native Method)
12-05 12:48:05.261: E/AndroidRuntime(749): at java.lang.reflect.Method.invoke(Method.java:521)
12-05 12:48:05.261: E/AndroidRuntime(749): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-05 12:48:05.261: E/AndroidRuntime(749): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-05 12:48:05.261: E/AndroidRuntime(749): at dalvik.system.NativeStart.main(Native Method)
You have to add ksoap2 library to your classpath as an external library and also copy the .jar into libs folder of the project.

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