【问题标题】:Getting build error im my application在我的应用程序中出现构建错误
【发布时间】:2018-06-06 19:32:31
【问题描述】:

这是我的毕业典礼,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "25.0.1"

    defaultConfig {
        applicationId "com.example.sakhi.live_scoure"
        minSdkVersion 12
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
        multiDexEnabled = true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        preDexLibraries = false
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.0.+'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.picasso:picasso:2.5.0'
    compile files('libs/awais.jar')
    compile 'com.android.support:support-vector-drawable:24.2.1'
    compile 'com.android.support:multidex:1.0.1'
    // compile project(':dBPullToRefresh')
}

在构建时出现此错误..

Process 'command 'C:\Users\Tejas\AppData\Local\Android\Sdk\build-tools\25.0.1\aapt.exe'' 以非零退出值 1 结束


谁能帮我解决这个错误?

谢谢 光辉

【问题讨论】:

标签: android android-studio gradle


【解决方案1】:
buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            shrinkResources true
        }
        debug {
            minifyEnabled false=
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            shrinkResources false
        }
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }

【讨论】:

  • 同样的问题兄弟 :( 好像 buildToolsVersion "25.0.1" 不支持或需要以某种方式安装.. 你知道怎么做吗?
  • compileSdkVersion 27 buildToolsVersion "26.0.2"... 在你用 gradle 编写的 android 下面替换这些行,并将依赖项中的 ll 更改为 26.0.2
  • 我做到了..但是它给出了下一个错误:Process 'command 'C:\Users\Tejas\AppData\Local\Android\Sdk\build-tools\26.0.2\aapt. exe'' 以非零退出值 1 结束
  • 在 defaultConfig 块中可以添加这一行:aaptOptions { additionalParameters "--no-version-vectors" }
  • 如果它不起作用,那么我认为您已经放置了重复资源:您可以点击此链接并查看 nightFurry 答案以查找重复资源:stackoverflow.com/questions/30899963/…
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-06-15
  • 2019-03-20
  • 1970-01-01
  • 1970-01-01
  • 2022-07-07
  • 2021-01-25
  • 1970-01-01
相关资源
最近更新 更多