Upgrading project to Android Studio 1.0 (Gradle problems)

后端 未结 3 1282
轻奢々
轻奢々 2021-02-08 03:47

Just to start I\'m very new to android development/android studio/gradle so forgive me if I\'m asking a stupid question.

My team has been working on a project with the b

相关标签:
3条回答
  • 2021-02-08 04:23

    in the gradle-wrapper.properties use the following

    distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
    

    in build.gradle use

    dependencies {
            classpath 'com.android.tools.build:gradle:1.0.+'
    

    also replace

    runProguard false
    

    with

     minifyEnabled true
    

    I hope this can help

    0 讨论(0)
  • 2021-02-08 04:32

    To change the gradle distribution used go to this file: {Project folder}/gradle/wrapper/graddle-wrapper.properties.

    Then change the distributionUrl to use 2.1:

    distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-all.zip
    
    0 讨论(0)
  • 2021-02-08 04:35

    I was having the same issue that you were and had made the exact same updates as described in the Google docs.

    The error I was making was editing my app module's build.gradle, and not the project's build.gradle in the root of the project folder for the com.android.tools.build version.

    Here's the updated PROJECT's build.gradle file that I'm using that works.

    // Top-level build file where you can add configuration options common to all sub-  projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.0.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    
    ext {
        compileSdkVersion = 21
        buildToolsVersion = "20.0.0"
    
        minSdkVersion = 15
        targetSdkVersion = 21
    }
    
    allprojects {
        repositories {
            jcenter()
        }
    }
    
    0 讨论(0)
提交回复
热议问题