java - Android Studio編譯打包Apk出現錯誤
問題描述
打包Apk的時候出現“Build APK: Errors while building APK. You can find the errors in the ’Messages’ view.”錯誤
我的Gradle:
apply plugin: ’com.android.application’android { compileSdkVersion 25 buildToolsVersion '25.0.3' defaultConfig {applicationId 'cn.licoy.demo2'minSdkVersion 15targetSdkVersion 25versionCode 1versionName '1.0'testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner' } buildTypes {release { shrinkResources true // -- always add this above minifyEnabled -- minifyEnabled true proguardFiles getDefaultProguardFile(’proguard-android.txt’),’proguard-rules.pro’} }}dependencies { compile fileTree(dir: ’libs’, include: [’*.jar’]) androidTestCompile(’com.android.support.test.espresso:espresso-core:2.2.2’, {exclude group: ’com.android.support’, module: ’support-annotations’ }) compile ’com.android.support:appcompat-v7:25.3.1’ compile ’com.android.support:design:25.3.1’ compile ’com.android.support.constraint:constraint-layout:1.0.2’ testCompile ’junit:junit:4.12’}
問題解答
回答1:已解決,在moblie.gradle中添加
aaptOptions.cruncherEnabled = falseaaptOptions.useNewCruncher = false
相關文章:
1. vim里的高亮javascript的javascript.vim 已經放到syntax里了,但是不行。2. mysql儲存json錯誤3. android - xml的drawable作背景,是否會產生錯誤4. 我何時應該在Java中使用JFrame.add(component)和JFrame.getContentPane()。add(component)5. javascript - ie11以下單擊打開不了file,雙擊可以。求解?6. html5 - 在Mac里使用vscode,卻無法使用已下載的擴展……7. 為啥獲取不到呀?8. 輸入地址報以下截圖錯誤,怎么辦?9. node.js - node中MYSQL的異步問題10. javascript - 求助一個關于indexedDB的問題
