NoClassDefFoundError Landroid/arch/lifecycle/LifecycleDispatcher

前端 未结 3 1754
慢半拍i
慢半拍i 2020-12-20 18:32

I want to try out the new lifecycle stuff from google (https://developer.android.com/arch) but getting a crash on app open. All I have done is add the dependencies. Is anyon

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-20 19:01

    This occurs even without Proguard. Today I could create the problem by creating the sample Flutter app in Android Studio and then running 'flutter pub upgrade'.

    The solution that worked for me was to add to the app build.gradle file under 'dependencies'

    dependencies { ... implementation 'com.android.support:appcompat-v7:28.0.0' }

    If your app uses androidx, add to the gradle.properties file:

    android.useAndroidX=true android.enableJetifier=true

提交回复
热议问题