早些時候我gradle這個是這樣的: 這是OFCOURSE不正確如何設置我的gradle這個最終版本的apk
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:gridlayout-v7:19.0.1'
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:+'
compile 'com.google.android.gms:play-services:+'
compile 'com.jakewharton:butterknife:4.0.+'
compile 'com.google.code.gson:gson:2.2.+'
compile 'com.google.android.gms:play-services:+'
}
所以在上傳我得到了來自谷歌的錯誤玩說,APK仍處於調試模式,並且不允許上傳該apk。
現在搜索結束後,我發現我需要改變我的gradle這個文件我終於想出了這個gradle這個:
請指引我,如果我是正確的!
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.3'
defaultConfig {
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
signingConfigs {
release {
storeFile file("F:\\MyAppFolder\\AppName.jks")
storePassword "abc1236"
keyAlias "prince"
keyPassword "abc1236"
}
}
}
dependencies {
compile 'com.android.support:gridlayout-v7:19.0.1'
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:+'
compile 'com.google.android.gms:play-services:+'
compile 'com.jakewharton:butterknife:4.0.+'
compile 'com.google.code.gson:gson:2.2.+'
compile 'com.google.android.gms:play-services:+'
}
現在我在哪裏出錯?
請幫忙。
什麼是症狀?你是通過'./gradle assembleRelease'來請求發佈嗎?搜索堆棧溢出,比如'[android] gradle release',因爲有很多關於這個的問題。 – Jerry101
確保你從'Build> Generate signed apk'生成已簽名的apk嗎? – pyus13