Android Studio,遷移新版本的問題收集
2016-04-12
1,Gradle DSL method not found: ‘runProguard()’
runProguard函數已經被廢棄并且停止使用了
改成minifyEnabled
即如下的配置
buildTypes { release { minifyEnabled false // 替代的方式 ...... } }
runProguard —> minifyEnabled
jniDebuggBuild –> jniDebuggable
zipAlign –> zipAlignEnabled
2,Library projects cannot set applicationId
新版本不能使用applicationId來定義庫module的包名了,要定義在manifest
defaultConfig { applicationId "cn.flakor.lib" <---- 刪除這行 minSdkVersion 15 targetSdkVersion 19 versionCode 1 versionName "1.0" }
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="cn.flakor.lib">...
利用flavor重命名包名
android { ... productFlavors { flavor1 { applicationId 'cn.flakor.newname' } }
參考(不翻墻看不了,有時間翻譯下):
Compile he JavaCompile
// tasks.withType(Compile) {
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
buildToolsVersion "19.1.0"
tools路徑 D:android studiosdkbuild-tools19.1.0 在build-tools目錄下建一個19.1.0目錄
初次啟動studio 避免網上跟新在 D:android studiostudiobin 下的idea.properties中添加disable.android.first.run=true
http://tools.android.com/tech-docs/new-build-system/user-guide
http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0