deeplearning4j / deeplearning4j-examples

Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)

Home Page:http://deeplearning4j.konduit.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android Example fails due to MainActivity's ClassNotFoundException

singam-sanjay opened this issue · comments

Issue Description

Please describe your issue, along with:

  • expected behavior
    Android Example trains a simple neural network.
  • encountered behavior
    App fails to launch due to ClassNotFoundException
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.androidDl4jClassifier, PID: 7312
    java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.androidDl4jClassifier/com.example.org.deeplearning4j.examples.androidclassifier.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.org.deeplearning4j.examples.androidclassifier.MainActivity" on path: DexPathList[[zip file "/data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/base.apk"],nativeLibraryDirectories=[/data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/lib/x86, /data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3365)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.org.deeplearning4j.examples.androidclassifier.MainActivity" on path: DexPathList[[zip file "/data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/base.apk"],nativeLibraryDirectories=[/data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/lib/x86, /data/app/~~DystIEzuKmEcf-5SpmWHbg==/com.example.androidDl4jClassifier-W1QFxM5MDgX1Ewt7IMM7dA==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
        at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:41)
        at android.app.Instrumentation.newActivity(Instrumentation.java:1253)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3353)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3601) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2066) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:223) 
        at android.app.ActivityThread.main(ActivityThread.java:7656) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) 

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version 1.0.0-M1.1
  • platform information (OS, etc): Android 10 x86 emulator on Intel 64-bit macOS Monterey
  • Built in debug mode
  • Only 2 changes made to build config from commit 165f406 Permalink at that commit
    *
    image

image

Please help with pointers to resolve this issue!

Please use the community forums for further communication. Apologies, but this is right at the top of the readme.

@singam-sanjay , I met the same problem, have you solved this problem?

@zijian-z as my above please use the community forums. This issue tracker is not used.