Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException since version 2.40.2 #3119

Closed
Bene98 opened this issue Dec 17, 2021 · 1 comment
Closed

ClassNotFoundException since version 2.40.2 #3119

Bene98 opened this issue Dec 17, 2021 · 1 comment

Comments

@Bene98
Copy link

Bene98 commented Dec 17, 2021

Hello everyone,
since version 2.40.2 we get the following exception when running our application. We have complete Java project, so it might be that on this pull request something got broken.
Here you can see our exception:

java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/jvm/internal/Intrinsics;
        at dagger.hilt.android.EntryPointAccessors.fromApplication(Unknown Source:2)
        at dagger.hilt.android.internal.managers.ActivityRetainedComponentManager$1.create(ActivityRetainedComponentManager.java:101)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
        at dagger.hilt.android.internal.managers.ActivityRetainedComponentManager.createComponent(ActivityRetainedComponentManager.java:123)
        at dagger.hilt.android.internal.managers.ActivityRetainedComponentManager.generatedComponent(ActivityRetainedComponentManager.java:115)
        at dagger.hilt.android.internal.managers.ActivityRetainedComponentManager.generatedComponent(ActivityRetainedComponentManager.java:44)
        at dagger.hilt.EntryPoints.get(EntryPoints.java:59)
        at dagger.hilt.android.internal.managers.ActivityComponentManager.createComponent(ActivityComponentManager.java:86)
        at dagger.hilt.android.internal.managers.ActivityComponentManager.generatedComponent(ActivityComponentManager.java:66)
        at com.example.example.Hilt_MainActivity.generatedComponent(Hilt_MainActivity.java:45)
        at com.example.example.Hilt_MainActivity.inject(Hilt_MainActivity.java:67)
        at com.example.example.Hilt_MainActivity$1.onContextAvailable(Hilt_MainActivity.java:38)
        at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.java:99)
        at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:313)
        at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:273)
        at androidx.appcompat.app.AppCompatActivity.onCreate(AppCompatActivity.java:115)
        at com.example.example.MainActivity.onCreate(MainActivity.java:86)
        at android.app.Activity.performCreate(Activity.java:8000)
        at android.app.Activity.performCreate(Activity.java:7984)
        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 "kotlin.jvm.internal.Intrinsics" on path: DexPathList[[zip file "/data/app/~~7lw1ypEAGEQE0U-btlRh_w==/com.example.example-Wpn6thudpf9lVfqzOrYQ7A==/base.apk"],nativeLibraryDirectories=[/data/app/~~7lw1ypEAGEQE0U-btlRh_w==/com.example.example-Wpn6thudpf9lVfqzOrYQ7A==/lib/x86, /data/app/~~7lw1ypEAGEQE0U-btlRh_w==/com.example.example-Wpn6thudpf9lVfqzOrYQ7A==/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)
copybara-service bot pushed a commit that referenced this issue Dec 19, 2021
Otherwise, this breaks java-only projects (#3119)

RELNOTES=N/A
PiperOrigin-RevId: 417157672
@bcorso
Copy link

bcorso commented Dec 21, 2021

Hey @Bene98,

Thanks for reporting. I think we'll need to add a dependency on org.jetbrains.kotlin:kotlin-stdlib to our pom file.

As a workaround for now, you can add the dependency manually to your java library.

copybara-service bot pushed a commit that referenced this issue Dec 21, 2021
This CL adds a Java-only gradle application and adds a test to repro the issue seen in #3119.

A follow-up CL will fix this issue.

RELNOTES=N/A
PiperOrigin-RevId: 417294644
copybara-service bot pushed a commit that referenced this issue Dec 21, 2021
This CL adds a Java-only gradle application and adds a test to repro the issue seen in #3119.

A follow-up CL will fix this issue.

RELNOTES=N/A
PiperOrigin-RevId: 417294644
copybara-service bot pushed a commit that referenced this issue Dec 21, 2021
This CL adds a Java-only gradle application and adds a test to repro the issue seen in #3119.

Currently, the regression test asserts that calling the EntryPointAccessors method throws. A follow-up CL will fix this issue.

RELNOTES=N/A
PiperOrigin-RevId: 417294644
copybara-service bot pushed a commit that referenced this issue Dec 21, 2021
This CL adds a Java-only gradle application and adds a test to repro the issue seen in #3119.

Currently, the regression test asserts that calling the EntryPointAccessors method throws. A follow-up CL will fix this issue.

RELNOTES=N/A
PiperOrigin-RevId: 417674252
copybara-service bot pushed a commit that referenced this issue Dec 22, 2021
Fixes #3119

This CL is a follow-up to CL/417294644. It adds a macro for kt_android_library that adds the kotlin-stdlib dependency if there is a kotlin source and also fixes issues with the jar file locations.

RELNOTES=Fixes #3119: Added kotlin-stdlib to pom dependencies to avoid breaking java-only projects.
PiperOrigin-RevId: 417157672
copybara-service bot pushed a commit that referenced this issue Dec 28, 2021
Fixes #3119

This CL is a follow-up to CL/417294644. It adds a macro for kt_android_library that adds the kotlin-stdlib dependency if there is a kotlin source and also fixes issues with the jar file locations.

RELNOTES=Fixes #3119: Added kotlin-stdlib to pom dependencies to avoid breaking java-only projects.
PiperOrigin-RevId: 417157672
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants