Deprecated Gradle features making it incompatible with Gradle 5.0. Android Studio 3.2

前端 未结 5 1219
情歌与酒
情歌与酒 2020-12-11 04:12

My android app Gradle build is not syncing, since I updated my android studio to 3.2. I have updated everything in the dependencies and still getting the same error. Here ar

相关标签:
5条回答
  • 2020-12-11 04:41

    I found easiest way to solve this issue. Go to projectName/android directory and in terminal enter the following command

    ./gradlew clean
    

    And then, go to main project directory by entering following command

    cd ..
    

    And then start the project

    react-native run-android
    
    0 讨论(0)
  • 2020-12-11 04:44

    The Problem is because of the inconsistency of external dependencies. The Issue can be Easily Solved by migrating to Yarn Package Manager

    1. Delete Node Modules

    2. Delete Package.json.lock

    3. yarn install

    OR

    Try Deleting android/app/build folder

    The run the project by react-native run-android

    0 讨论(0)
  • 2020-12-11 04:50

    In my case

    1. I Followed Hugo's answer

    2. Changed the location of project.

    3. Tried another android device [Build and success install]

    4. Tried on my android device [Build and success install]

    0 讨论(0)
  • 2020-12-11 05:01

    So the problem doesn't necessarily needs to be in your application level build.gradle script (the one you posted). It can also be in the project level one or even in the maven-publish-aar.gradle one (if you have it). This means, you could be using deprecated Gradle features on any Gradle script.

    I have updated everything in the dependencies and still getting the same error.

    Most likely, the warning will be gone once you identify and replace any deprecated Gradle feature that's causing you this trouble. To do this, it will help you to actually add the mentioned --warning-mode=all flag to your Gradle command line options (on your Android studio compiler settings):

    This will print the proper warnings for you to be aware of what are the specific deprecated features your app is using.

    In my case (for example), I just added the enableFeaturePreview('STABLE_PUBLISHING') setting on the settings.gradle file and that did the magic (I'm using publishing{}).

    Also, I know you asked this near a month ago, but, it might be useful for other people facing the same issue.

    0 讨论(0)
  • 2020-12-11 05:02

    Had same issue yesterday extended to the @Hugo Allexis Cardona answer even after replacing deprecated Gradle feature having same issue because Old build folder is remains there so what I did is Remove app/build folder and sync gradle again and it work for me Thanks @Hugo Allexis Cardona

    Delete App/Build Folder

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