早些时候我的 gradle 是这样的:这当然是不正确的
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:+'
}
因此,在上传时,我从 google play 收到错误消息,指出该 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:+'
}
现在我哪里错了?
请帮忙。
在 Studio 窗口的左下角有一个名为“Build Variants”的停靠视图。
打开它并选择发布版本。
附注您要添加两次compile 'com.google.android.gms:play-services:+' 。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)