Can not build the project after upgrading to android - P

后端 未结 7 1146
星月不相逢
星月不相逢 2020-12-10 04:39

Below are the errors which I am getting

C:\\Users\\Dell\\.gradle\\caches\\transforms-1\\files-1.1\\appcompat-v7-28.0.0-alpha1.aar\\51cd62c84e9404bd66ab4daf25         


        
相关标签:
7条回答
  • 2020-12-10 05:19

    I already answered a similar question here.

    Try changing the compileSdkVersion to:

    compileSdkVersion 28
    

    These attributes were added in this version. Check here, here and here

    0 讨论(0)
  • 2020-12-10 05:24

    look @ your Compile SDK Version and (mine whas API: 26: Android 8.0)

    and change in your Build.gradle Module:app the next thing:

    ->>>form: implementation 'com.android.support:design:28.0.0-beta1'

    implementation 'com.android.support:cardview-v7:28.0.0-beta1'
    implementation 'com.android.support:recyclerview-v7:28.0.0-beta1'
    implementation 'com.android.support:appcompat-v7:28.0.0-beta1'
    

    ->>>to: implementation 'com.android.support:design:26.0.0-beta1'

    implementation 'com.android.support:cardview-v7:26.0.0-beta1'
    implementation 'com.android.support:recyclerview-v7:26.0.0-beta1'
    implementation 'com.android.support:appcompat-v7:26.0.0-beta1'
    

    have a nice day...

    0 讨论(0)
  • 2020-12-10 05:34

    You need to use more specific versions of your dependencies

    compile 'com.android.support:design:+'
    

    selects the newest design support library (28.0.0-alpha) which is not compatible with your compile SDK <28. Change to

    compile 'com.android.support:design:27.+'
    

    or preferably a specific version such as

    compile 'com.android.support:design:27.1.0'
    

    Similarly for your other dynamic dependencies with + in their version.

    0 讨论(0)
  • 2020-12-10 05:37

    I had a similar problem and the solution was to migrate to AndroidX.

    With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

    If you have any Maven dependencies that have not been migrated to the AndroidX namespace, the Android Studio build system also migrates those dependencies for you when you set the following two flags to true in your gradle.properties file:

    android.useAndroidX=true
    android.enableJetifier=true
    

    To migrate an existing project that does not use any third-party libraries with dependencies that need converting, you can set the android.useAndroidX flag to true and the android.enableJetifier flag to false.

    Source.

    0 讨论(0)
  • 2020-12-10 05:40

    Try this:

    Go to dependencies at gradle (module) and replace all the dependencies with the following:

    dependencies {
      debugImplementation 'com.android.support.constraint:constraint-layout:1.1.2'
      implementation fileTree(include: ['*.jar'], dir: 'libs')
      androidTestImplementation 'junit:junit:4.12'
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support:support-v4:26.1.0'
      implementation 'com.android.support:design:26.1.0'
    }
    

    Change all SdkVersion to 26

    Then under compileSdkVersion add the following:

    buildToolsVersion '27.0.3'
    
    0 讨论(0)
  • 2020-12-10 05:41

    Delete these lines and sync:

    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support:design:+'
    compile 'com.android.support:support-v4:+'
    

    then goto File -> Project Structure then goto Dependencies and click + button on top right

    select library dependencies From the list. Select the above 3 dependencies and click OK

    Make sure that compileSdkVerison and targetSdkVersion are same as that in these dependencies.

    0 讨论(0)
提交回复
热议问题