Kotlin / kotlinx.coroutines

Library support for Kotlin coroutines
Apache License 2.0
13.07k stars 1.85k forks source link

ClassNotFoundException CoroutineScopeKt #3241

Closed Vihanmy closed 2 years ago

Vihanmy commented 2 years ago

java.lang.ClassNotFoundException: Didn't find class "kotlinx.coroutines.CoroutineScopeKt" on path

kotlin_coroutines = '1.6.0', coroutine_ktx = '2.4.0',

ktxCoroutinesCore : "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.kotlin_coroutines",
ktxCoroutinesAndroid : "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.kotlin_coroutines", ktxCoroutinesJdk8 : "org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$rootProject.kotlin_coroutines",
lifecycleRuntimeKtx : "androidx.lifecycle:lifecycle-runtime-ktx:$rootProject.coroutine_ktx",
lifecycleViewModelKtx : "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.coroutine_ktx",
lifecycleLiveDataKtx : "androidx.lifecycle:lifecycle-livedata-ktx:$rootProject.coroutine_ktx",

qwwdfsad commented 2 years ago

Please use Slack or StackOverflow for build-related issues and general question.

There isn't much we can help with with such a limited description

Vihanmy commented 2 years ago

2022-04-10 11:57:17.969 3138-3138/com.myapp.app.dev E/AndroidRuntime: FATAL EXCEPTION: main Process: com.myapp.app.dev, PID: 3138 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/LifecycleCoroutineScopeImpl; at androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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: androidx.lifecycle.LifecycleCoroutineScopeImpl at java.lang.VMClassLoader.findLoadedClass(Native Method) at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738) at java.lang.ClassLoader.loadClass(ClassLoader.java:363) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/LifecycleCoroutineScope; at androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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: androidx.lifecycle.LifecycleCoroutineScope at java.lang.VMClassLoader.findLoadedClass(Native Method) at java.lang.ClassLoader.findLoadedClass(ClassLoader.java:738) at java.lang.ClassLoader.loadClass(ClassLoader.java:363) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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.NoClassDefFoundError: Failed resolution of: Lkotlinx/coroutines/CoroutineScope; at androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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 "kotlinx.coroutines.CoroutineScope" on path: DexPathList[[zip file "/data/app/Gd8OJWcmisf3QNu50MctTg==/com.myapp.app.dev-itMw7qAgGj865lktFmo9KQ==/base.apk"],nativeLibraryDirectories=[/data/app/Gd8OJWcmisf3QNu50MctTg==/com.myapp.app.dev-itMw7qAgGj865lktFmo9KQ==/lib/x86, /data/app/~~Gd8OJWcmisf3QNu50MctTg==/com.myapp.app.dev-itMw7qAgGj865lktFmo9KQ==/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 androidx.lifecycle.LifecycleKt.getCoroutineScope(Lifecycle.kt:38) at androidx.lifecycle.LifecycleOwnerKt.getLifecycleScope(LifecycleOwner.kt:30) at com.myapp.app.myapp.activity.MainActivity.initView(MainActivity.kt:121) at com.model_base.activity.BaseActivity.initContentView(BaseActivity.kt:55) at com.model_base.activity.BaseActivity.onCreate(BaseActivity.kt:35) at com.myapp.app.myapp.base.BaseCompatActivity.onCreate(BaseCompatActivity.kt:10) at android.app.Activity.performCreate(Activity.java:7994) at android.app.Activity.performCreate(Activity.java:7978) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3422) 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)

Vihanmy commented 2 years ago

Thanks for your reply to my stupidity