Unable to build Android app on .2377

cooper

(Matt Robertson) #1

As of .2377 I am suddenly unable to run my Android app. I’ve been building and debugging all day, then updated to .2377 and suddenly I get a ClassNotFoundException at launch every run.

Shutting down VM
FATAL EXCEPTION: main
Process: com.accordancebible.accordance, PID: 28552
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.accordancebible.accordance/com.accordancebible.accordance.SplashActivity}: java.lang.ClassNotFoundException: Didn't find class "com.accordancebible.accordance.SplashActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/lib/arm64, /system/lib64, /vendor/lib64]]
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2881)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
       at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:6718)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.accordancebible.accordance.SplashActivity" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/lib/arm64, /system/lib64, /vendor/lib64]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
       at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
       at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2869)
       ... 11 more
       Suppressed: java.io.IOException: Failed to open dex files from /data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/base.apk because: Failure to verify dex file '/data/app/com.accordancebible.accordance-mkNPyU-0SKuEAeN6Lr36GQ==/base.apk': Duplicate interface: 'Ljava/lang/Iterable;'
               at dalvik.system.DexFile.openDexFileNative(Native Method)
               at dalvik.system.DexFile.openDexFile(DexFile.java:354)
               at dalvik.system.DexFile.<init>(DexFile.java:101)
               at dalvik.system.DexFile.<init>(DexFile.java:75)
               at dalvik.system.DexPathList.loadDexFile(DexPathList.java:394)
               at dalvik.system.DexPathList.makeDexElements(DexPathList.java:354)
               at dalvik.system.DexPathList.<init>(DexPathList.java:164)
               at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:74)
               at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
               at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
               at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
               at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
               at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:74)
               at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:40)
               at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:727)
               at android.app.LoadedApk.getClassLoader(LoadedApk.java:810)
               at android.app.LoadedApk.getResources(LoadedApk.java:1032)
               at android.app.ContextImpl.createAppContext(ContextImpl.java:2345)
               at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5798)
               at android.app.ActivityThread.access$1100(ActivityThread.java:200)
               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
               ... 6 more

I tried doing a clean and re-build but get the same result.


(marc hoffman) #2

So it builds fine (contrary to the thread title), it just fails at runtime? any app, or just this one? Sure that com.accordancebible.accordance.SplashActivity is the proper class name for your activity? Does the build log mention

dex> processing com/accordancebible/accordance/SplashActivity…

?


(Matt Robertson) #3

Should read “builds incorrectly” I suppose. The error is at Runtime, but the ClassNotFound for a class that should be found indicates that the build didn’t work as expected. The only thing that changed from one build to the next was the Elements version. I downgraded back to .2375 and did a clean & build, and it runs fine. For some reason the class isn’t being added to the apk, or isn’t indexed correctly or something.

I’ve only tested my main app, I’ll have to check with a test project.

Yep. Again, no code changes from success to fail to success, only Elements upgrade and then downgrade.

I don’t have time to check at the moment, but I’ll look as soon as I can.


(marc hoffman) #4

Can you do me a favor and send be both

a) a Diagnostic rebuild log
b) the final apk
c) a zip of the obj folder (you see the path in the build log, ~/Library/Application Support/RemObjects Software/EBuild/Obj/ plus some GUID)

for the build from both 2375 (working) and 2377 (broken)?

No rush, as I’m mostly done for the day, too, and everyone else is already out (yay for timezones); I don’t think anything in EBuild changed that could affect this, so I;m guessing compiler bug, which means Monday.


(marc hoffman) #5

We’ve reproduced the issue. The error message is a bid misleading, it’s something in the .dex file that fails validation, which leads to Android claiming it cannot find the class (which is there fine). It seems this only happens if elements.jar is referenced; we’re investigating.


(Matt Robertson) #6

Glad to hear it. I do have the elements.jar referenced in my project. I’m packaging those diagnostics for you right now and will post shortly.


(marc hoffman) #7

Issue should be fixed, im waiting for a new build to retest, here. I’ll send you a new build later today Windows/Water for you, right?


(Matt Robertson) #8

Great, thanks!


(marc hoffman) #9

Turns out not fixed yet, though. so this is back to Carlo, probably for tomorrow ;(.


(marc hoffman) #10

New Water build is up for ya, in Personal Downloads


(Matt Robertson) #11

Looks good now, thanks!


(marc hoffman) #12

Cool, glad to hear. thanx for confirming!