tarek360 / Instacapture

Android library to capture screenshot from your app
694 stars 113 forks source link

Failed resolution of: Lcom/tarek360/instacapture/Instacapture; #50

Open Rich2020 opened 4 years ago

Rich2020 commented 4 years ago

I have a library and would like that library to use Instacapture. My library is included in the Google HelloAR sample application. I have installed Instacapture as per the instruction in the README. However, when I launch my app, I get the following crash:

    --------- beginning of crash
2020-08-11 22:34:35.965 32761-32761/com.google.ar.core.examples.java.helloar E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.google.ar.core.examples.java.helloar, PID: 32761
    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/tarek360/instacapture/Instacapture;
        at com.cambridge.mylibrary.ScreenShotter.takeScreenshot(ScreenShotter.java:139)
        at com.google.ar.core.examples.java.helloar.HelloArActivity$2.run(HelloArActivity.java:164)
        at com.google.ar.core.examples.java.helloar.HelloArActivity.startRepeatingTask(HelloArActivity.java:171)
        at com.google.ar.core.examples.java.helloar.HelloArActivity$1.run(HelloArActivity.java:152)
        at android.os.Handler.handleCallback(Handler.java:883)
        at android.os.Handler.dispatchMessage(Handler.java:100)
        at android.os.Looper.loop(Looper.java:237)
        at android.app.ActivityThread.main(ActivityThread.java:8107)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tarek360.instacapture.Instacapture" on path: DexPathList[[zip file "/data/app/com.google.ar.core.examples.java.helloar-bhCcJ--GEjsJ6mxAFvnUYw==/base.apk"],nativeLibraryDirectories=[/data/app/com.google.ar.core.examples.java.helloar-bhCcJ--GEjsJ6mxAFvnUYw==/lib/arm64, /data/app/com.google.ar.core.examples.java.helloar-bhCcJ--GEjsJ6mxAFvnUYw==/base.apk!/lib/arm64-v8a, /system/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.cambridge.mylibrary.ScreenShotter.takeScreenshot(ScreenShotter.java:139) 
        at com.google.ar.core.examples.java.helloar.HelloArActivity$2.run(HelloArActivity.java:164) 
        at com.google.ar.core.examples.java.helloar.HelloArActivity.startRepeatingTask(HelloArActivity.java:171) 
        at com.google.ar.core.examples.java.helloar.HelloArActivity$1.run(HelloArActivity.java:152) 
        at android.os.Handler.handleCallback(Handler.java:883) 
        at android.os.Handler.dispatchMessage(Handler.java:100) 
        at android.os.Looper.loop(Looper.java:237) 
        at android.app.ActivityThread.main(ActivityThread.java:8107) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100) 

Any idea what is causing the issue? I've tried opening Instacapture, compiling it to .aar and throwing it in my libs dir and then modifying the gradle files, but I have the same issue.