NoSuchMethodError getLifeCycle () - PullRequest
       3

NoSuchMethodError getLifeCycle ()

0 голосов
/ 25 июня 2019

Я обновил эту библиотеку с implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1' до implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'.

После этого обновления появляется сбой:

No super method getLifecycle()Landroidx/lifecycle/Lifecycle; in class Landroidx/core/app/ComponentActivity; or its super classes (declaration of 'androidx.core.app.ComponentActivity' appears in /data/app/com.xxx-_17DxVaMzNmc19qlXpUTYw==/base.apk)

Этот вызов выполняется в моей активности (расширенная AppCompatActivity).

У вас есть объяснения, ребята?

Ответы [ 3 ]

1 голос
/ 25 июня 2019

Я исправил эту проблему, чтобы улучшить эту зависимость с implementation 'androidx.appcompat:appcompat:1.0.2' до implementation 'androidx.appcompat:appcompat:1.1.0-beta01'

Странное поведение ... В любом случае, это исправлено!

Большое спасибо, ребята, за вашу поддержку!* * 1007

0 голосов
/ 25 июня 2019

попробуй работал на меня

apply plugin: 'com.A.B'

android {
dataBinding {
    enabled = true
}
compileSdkVersion 28
defaultConfig {
    applicationId "com.A.B"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility = '1.8'
    targetCompatibility = '1.8'
 }
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

implementation 'com.android.support:design:28.0.0' //design

annotationProcessor "android.arch.lifecycle:compiler:1.1.1"
implementation "android.arch.lifecycle:extensions:1.1.1"

}

и внутри build.gradle (проект) добавить:

        classpath 'com.android.tools.build:gradle:3.4.1'
0 голосов
/ 25 июня 2019
Fixed the issue by adding this dependency to my gradle:

implementation 'androidx.arch.core:core-runtime:2.0.1-alpha01'

 I have used

 App level gradle compileSdkVersion = 28, buildToolsVersion = "28.0.3":

    implementation "com.google.android.gms:play-services-auth:16.0.1"
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
    implementation 'androidx.arch.core:core-runtime:2.0.1-alpha01' 
    All com.android.support libraries are of version: 28.0.0

    Project level gradle:

    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath 'com.google.gms:google-services:4.2.0'
    Note 1: If you have the below line, try to build without it:

    implementation "androidx.legacy:legacy-support-v4:1.0.0"
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...