Closed jewom closed 5 years ago
@jewom Thanks for letting us know. I've updated the Kotlin and Kotlin coroutine versions in CameraKit v1.0.0-beta3.10. That should solve the issue you see here. Let me know otherwise. Thanks again!
@jewom getting the same exception:
E/AndroidRuntime: 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.NoClassDefFoundError: Failed resolution of: Lkotlinx/coroutines/experimental/ThreadPoolDispatcherKt;
at com.camerakit.CameraPreview.<init>(CameraPreview.kt:79)
at com.camerakit.CameraKitView.obtainAttributes(CameraKitView.java:269)
at com.camerakit.CameraKitView.<init>(CameraKitView.java:238)
... 34 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlinx.coroutines.experimental.ThreadPoolDispatcherKt" on path: DexPathList[[zip file "/data/app/app-VNyaTxIoDjBCp0nDIOL9XQ==/base.apk"],nativeLibraryDirectories=[/data/app/app-VNyaTxIoDjBCp0nDIOL9XQ==/lib/arm64, /data/app/app-VNyaTxIoDjBCp0nDIOL9XQ==/base.apk!/lib/arm64-v8a, /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)
... 37 more
With:
1.0.0-beta3.10 / 1.0.0-beta3.11-expensify
org.jetbrains.kotlinx:kotlinx-coroutines-android 1.0.0 / 1.1.0
org.jetbrains.kotlin:kotlin-stdlib-jdk8 1.3.11
Thanks guys! We will take a look. Though to note, 1.0.0-beta3.11-expensify
should not be used as it will not be sticking around. We will be issuing a proper beta-3.11
shortly
@DummyCo @jewom With CameraKit v1.0.0-beta3.10 you should use the following dependencies:
dependencies {
implementation 'com.camerakit:camerakit:1.0.0-beta3.10'
implementation 'com.camerakit:jpegkit:0.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
}
With CameraKit v1.0.0-beta3.9, use these dependencies instead:
dependencies {
implementation 'com.camerakit:camerakit:1.0.0-beta3.9'
implementation 'com.camerakit:jpegkit:0.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.2.61'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.24.0'
}
If I was using beta3.10 and did not upgrade to the latest kotlin and coroutines I was able to reproduce the errors shown above. Those dependencies should solve your issues!
i have used both scenarios but i still get the error when i create a release apk version at times some of the version i had used i am failing to even create the release apk because of versions error , is anyone going through this and also has found a solution to this error , because i am now reconsidering my camera options .
A lot of users have this error :
Caused by java.lang.NoClassDefFoundError kotlinx.coroutines.experimental.ThreadPoolDispatcherKt
com.camerakit.CameraPreview.<init> (CameraPreview.kt:80) com.camerakit.CameraKitView.obtainAttributes (CameraKitView.java:268) com.camerakit.CameraKitView.<init> (CameraKitView.java:237) java.lang.reflect.Constructor.constructNative (Constructor.java) java.lang.reflect.Constructor.newInstance (Constructor.java:423) android.view.LayoutInflater.createView (LayoutInflater.java:594) android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:696) android.view.LayoutInflater.rInflate (LayoutInflater.java:755) android.view.LayoutInflater.inflate (LayoutInflater.java:492) android.view.LayoutInflater.inflate (LayoutInflater.java:397) android.view.LayoutInflater.inflate (LayoutInflater.java:353) android.support.v7.app.AppCompatDelegateImpl.setContentView (AppCompatDelegateImpl.java:469) android.support.v7.app.AppCompatActivity.setContentView (AppCompatActivity.java:140) com.belami.essential.activities.apps.camera.CameraActivity.onCreate (CameraActivity.kt:31) android.app.Activity.performCreate (Activity.java:5264) android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1088) android.app.ActivityThread.performLaunchActivity (ActivityThread.java:2302) android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:2390) android.app.ActivityThread.access$800 (ActivityThread.java:151) android.app.ActivityThread$H.handleMessage (ActivityThread.java:1321) android.os.Handler.dispatchMessage (Handler.java:110) android.os.Looper.loop (Looper.java:193) android.app.ActivityThread.main (ActivityThread.java:5292) java.lang.reflect.Method.invokeNative (Method.java) java.lang.reflect.Method.invoke (Method.java:515) com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:824) com.android.internal.os.ZygoteInit.main (ZygoteInit.java:640) dalvik.system.NativeStart.main (NativeStart.java)
This is my CameraActivity : `class CameraActivity : AppCompatActivity() {
} `
My Gradle dependencies :