Android Studio doesn't work fine with gradle 2.10 and gradle plugin 2.0.0-alpha5

前端 未结 6 1369
误落风尘
误落风尘 2020-12-31 06:08

I use com.android.tools.build:gradle:2.0.0-alpha3 and gradle 2.8 before I update to Android Studio 2.0 preview 5. It works fine.

After I update to 2.0 preview 5,it t

相关标签:
6条回答
  • 2020-12-31 06:26

    Sometimes you must change the gradle versión settings and the wrapper file if you are using a local distribution.

    1. File > Settings > Build, Execution, Deployment > Build Tools > Gradle
    2. Gradle Home to gradle-2.10
    3. Apply
    4. C:\Users\ ...\project\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip

    if step 4 is missing, Android studio goes back to gradle-2.8, so i would have to do steps 1-3 every time.

    Well it happens to me, i don't know if it is an isolated case.

    0 讨论(0)
  • 2020-12-31 06:40

    Your problem is with instant run, because if project builds and APK installs, it can't be Gradle issue.

    Instant Run is still under development and has this issue of not working properly.

    To disable the instant run:

    1. open properties,
    2. go to Editor > Build, Execution, Development > Instant Run,
    3. uncheck Enable instant Run to hotswap code
    0 讨论(0)
  • 2020-12-31 06:41

    You can try this: go to project stucture from file-->menu or command-; in mac. Then (don't try changing the android plugin version to 2.10) change the android plugin version to same as your current android gradle build as illustrated in the image below:

    0 讨论(0)
  • 2020-12-31 06:47

    If you have 64 bit distro, install 32 bit deps: sudo apt-get install -y lib32gcc1 libc6-i386 lib32z1 lib32stdc++6 sudo apt-get install -y lib32ncurses5 lib32gomp1 lib32z1-dev

    0 讨论(0)
  • 2020-12-31 06:48

    There's a quick fix listed on google plus by the android dev team in the comments (post).

    Set dexInProcess equal to false in your build.gradle:

    dexOptions {  
        javaMaxHeapSize "4g"  
        dexInProcess false  //the magic line
    }
    
    0 讨论(0)
  • 2020-12-31 06:48

    Update your plugin to

    classpath 'com.android.tools.build:gradle:2.0.0-alpha6'
    

    You may get “Gradle Version 2.10 is required.” Error. Try this

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