You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/06/27 10:25:23 UTC

[GitHub] [cordova-android] DanielVALAT opened a new issue, #1445: java.lang.RuntimeException: Unable to instantiate activity

DanielVALAT opened a new issue, #1445:
URL: https://github.com/apache/cordova-android/issues/1445

   # Bug Report
   
   ## Problem
   Application crash when launch from Play Store (Appbundle), but no probleme with APK
   
   ### What is expected to happen?
   Application launch
   
   
   ### What does actually happen?
   Crash, no window or anything launched. just received an ANR
   
   ## Information
   06-27 12:19:42.079 18662 18662 E AndroidRuntime: FATAL EXCEPTION: main
   06-27 12:19:42.079 18662 18662 E AndroidRuntime: Process: io.aninet.companion, PID: 18662
   06-27 12:19:42.079 18662 18662 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{io.aninet.companion/io.aninet.companion.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "io.aninet.companion.MainActivity" on path: DexPathList[[zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/base.apk", zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.fr.apk", zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/lib/arm64, /system/lib64, /system_ext/lib64]]
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3613)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3844)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2315)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7929)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "io.aninet.companion.MainActivity" on path: DexPathList[[zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/base.apk", zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.fr.apk", zip file "/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/lib/arm64, /system/lib64, /system_ext/lib64]]
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:45)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.Instrumentation.newActivity(Instrumentation.java:1328)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3600)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        ... 12 more
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.fr.apk because: Entry not found
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.openDexFileNative(Native Method)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.openDexFile(DexFile.java:371)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:113)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:86)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.<init>(DexPathList.java:166)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:160)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:130)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:146)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:93)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:134)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:126)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries(ApplicationLoaders.java:61)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:1034)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.getClassLoader(LoadedApk.java:1126)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.getResources(LoadedApk.java:1374)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ContextImpl.createAppContext(ContextImpl.java:3090)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ContextImpl.createAppContext(ContextImpl.java:3082)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6707)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2141)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                ... 7 more
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:        Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~sWz4qul_KjndIS0h84bN3A==/io.aninet.companion-tdXX0h9zkUn8RR35_i3aKw==/split_config.xxhdpi.apk because: Entry not found
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.openDexFileNative(Native Method)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.openDexFile(DexFile.java:371)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:113)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexFile.<init>(DexFile.java:86)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.DexPathList.<init>(DexPathList.java:166)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:160)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:130)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:146)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:93)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:134)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:126)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries(ApplicationLoaders.java:61)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:1034)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.getClassLoader(LoadedApk.java:1126)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.LoadedApk.getResources(LoadedApk.java:1374)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ContextImpl.createAppContext(ContextImpl.java:3090)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ContextImpl.createAppContext(ContextImpl.java:3082)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6707)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2141)
   06-27 12:19:42.079 18662 18662 E AndroidRuntime:                ... 7 more
   0
   
   
   
   ### Command or Code
   cordova run
   
   ### Environment, Platform, Device
   Windows 10 (21H2)
   Phone side: Android 12 or 13 (same results)
   And Google Play testing devices is showing same problem.
   
   ### Version information
   Cordova 11.0
   Installed platforms:
     android 10.1.2
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [X] I searched for existing GitHub issues
   - [X] I updated all Cordova tooling to most recent version
   - [X] I included all the necessary information above
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek closed issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek closed issue #1445: java.lang.RuntimeException: Unable to instantiate activity
URL: https://github.com/apache/cordova-android/issues/1445


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1186324920

   And thanks for bundletool


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by "breautek (via GitHub)" <gi...@apache.org>.
breautek commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1520053635

   Closing as stale.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167268947

   Fixed by editing \platforms\android\app\src\main\AndroidManifest.xml <activity> adding a dot before MainActivity


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167313373

   Have you changed the app id since you used `cordova platform add android`? If so this is a path that would cause this runtime error.
   
   It's being fixed by https://github.com/apache/cordova-android/pull/1154 but this will only be included in our next 11.x release.
   
   The current workaround is to re-add the platform via
   
   ```
   cordova platform remove android
   cordova platform add android
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167336236

   Hello,
   The problem is not here. When i'm using APK (build with a simple cordova build) it's working.
   But when i build an appbundle it's not working because the AndroidManifest.xml is set to "MainActivity" and not ".MainActivity".
   
   I don't known if i'm clear, i'm french sorry.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1186324867

   Hello, sorry for the delay.
   I'm doing that when i have 5 minutes ;)
   Thank you for your reply.
   This problem occur with a sample project, nothing to do with a moidified namespace.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167176815

   My build.json:
   {
       "android": {
           "debug": {
               "keystore": "./danielvalat-teslina.keystore",
               "storePassword": "",
               "alias": "fr.danielvalat",
               "password" : "",
               "keystoreType": "",
               "packageType": "apk"
           },
           "release": {
               "keystore": "./danielvalat-teslina.keystore",
               "storePassword": "",
               "alias": "fr.danielvalat",
               "password" : "",
               "keystoreType": "",
               "packageType": "bundle"
           }
       }
   }


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] DanielVALAT commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
DanielVALAT commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167175589

   Cordova run work, but when using cordova build with build.json provided on the doc, it's not working.
   Cordova build a correct bundle but when it's installed by Play store, the error occur.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


[GitHub] [cordova-android] breautek commented on issue #1445: java.lang.RuntimeException: Unable to instantiate activity

Posted by GitBox <gi...@apache.org>.
breautek commented on issue #1445:
URL: https://github.com/apache/cordova-android/issues/1445#issuecomment-1167361932

   > I don't known if i'm clear, i'm french sorry.
   
   No worries, you're good.
   
   Ok thanks for confirming that this isn't related to the aforementioned issue. I think the next best thing to help move this along is if you can provide a sample reproduction repository that reproduces this issue.
   
   - Build a new cordova app and use the same bundle id as your real app
   - For this particular issue, I don't think you need to include any actual app sources, the hello world app should be sufficient.
   - To test if the sample repository reproduces your issue, you can use your build.json / keystore, **but do NOT include them inside the sample repository**
   
   To avoid testing the bundle by uploading it to the play store, you can use Google's [Bundletool](https://developer.android.com/studio/command-line/bundletool). With the bundle tool, you can generate an [APK Set](https://developer.android.com/studio/command-line/bundletool#device_specific_apks), which can then be [installed](https://developer.android.com/studio/command-line/bundletool#deploy_with_bundletool) onto your device. This is how I will also test the reproduction sample.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org