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

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/LifecycleEventObserver #179

Closed
bitores opened this issue Oct 25, 2019 · 2 comments

Comments

@bitores
Copy link

bitores commented Oct 25, 2019

Environment

App version: 1.0.0
Android version: 5.4
Device information: xxxx

version:
appName: demo_first
buildNumber: 1
packageName: com.example.demo_first
environment: ApplicationProfile.debug

Device parameters:
id: QPP1.190205.018.B3
androidId: fbe67581204b5b02
board: goldfish_x86
bootloader: unknown
brand: google
device: generic_x86
display: sdk_gphone_x86-userdebug Q QPP1.190205.018.B3 5345599 dev-keys
fingerprint: google/sdk_gphone_x86/generic_x86:Q/QPP1.190205.018.B3/5345599:userdebug/dev-keys
hardware: ranchu
host: wphq1.hot.corp.google.com
isPsychicalDevice: false
manufacturer: Google
model: Android SDK built for x86
product: sdk_gphone_x86
tags: dev-keys
type: userdebug
versionBaseOs:
versionCodename: Q
versionIncremental: 5345599
versionPreviewSdk: 1
versionRelase: Q
versionSdk: 28
versionSecurityPatch: 2019-03-05

Description

Create a Class that extends the InAppBrowser Class in order to override the callbacks to manage the browser events.

await inAppBrowser.open(url: "https://flutter-go.pub/flutter_go_web/", options: {
"useShouldOverrideUrlLoading": true,
"useOnLoadResource": true,
"clearCache": true,
// "toolbarTop": false,
});

Expected behavior:
正常
Current behavior:
D/AndroidRuntime( 7977): Shutting down VM
E/AndroidRuntime( 7977): FATAL EXCEPTION: main

Steps to reproduce

Images

image

Stacktrace/Logcat

E/AndroidRuntime( 7977): Process: com.example.demo, PID: 7977
E/AndroidRuntime( 7977): java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/LifecycleEventObserver;
E/AndroidRuntime( 7977): at java.lang.Class.newInstance(Native Method)
E/AndroidRuntime( 7977): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:81)
E/AndroidRuntime( 7977): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:43)
E/AndroidRuntime( 7977): at android.app.Instrumentation.newActivity(Instrumentation.java:1239)
E/AndroidRuntime( 7977): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3015)
E/AndroidRuntime( 7977): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3237)
E/AndroidRuntime( 7977): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:81)
E/AndroidRuntime( 7977): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime( 7977): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 7977): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1929)
E/AndroidRuntime( 7977): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 7977): at android.os.Looper.loop(Looper.java:209)
E/AndroidRuntime( 7977): at android.app.ActivityThread.main(ActivityThread.java:7021)
E/AndroidRuntime( 7977): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 7977): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:486)
E/AndroidRuntime( 7977): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:872)
E/AndroidRuntime( 7977): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.lifecycle.LifecycleEventObserver" on path: DexPathList[[zip file "/data/app/com.example.demo-Inv11Xt9QqlGQ7wM2HEjxw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.demo-Inv11Xt9QqlGQ7wM2HEjxw==/lib/x86, /data/app/com.example.demo-Inv11Xt9QqlGQ7wM2HEjxw==/base.apk!/lib/x86, /system/lib, /system/product/lib]]
E/AndroidRuntime( 7977): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:195)
E/AndroidRuntime( 7977): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
E/AndroidRuntime( 7977): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

@bitores
Copy link
Author

bitores commented Oct 25, 2019

configurations.all {
resolutionStrategy {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'androidx.core') {
details.useVersion "1.0.1"
}
if (details.requested.group == 'androidx.lifecycle') {
details.useVersion "2.0.0"
}
if (details.requested.group == 'androidx.versionedparcelable') {
details.useVersion "1.0.0"
}
if (details.requested.group == 'androidx.fragment') {
details.useVersion "1.0.0"
}
if (details.requested.group == 'androidx.appcompat') {
details.useVersion "1.0.1"
}
}
}
}

@bitores bitores closed this as completed Oct 25, 2019
@pichillilorenzo
Copy link
Owner

@bitores which file did you update?

This was referenced Jul 6, 2020
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

No branches or pull requests

2 participants