早些时候我的学习时间是这样的:这 是不正确的
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:+' }
我现在哪里错了?
请帮忙.
在Studio窗口的左下方有一个名为"Build Variants"的停靠视图.
打开它并选择版本变体.
PS.你要两次添加编译'com.google.android.gms:play-services:+'.