[asd/Android Studio]asd 中修改 targetSdkVersion 的方法
看到很多网友说改不了,其实还是中以的.不过改了之后用处似乎并不大.
方法是直接修改 app/build.gradle 文件
--------------------------------------------------
apply plugin: 'com.android.application'
android {
compileSdkVersion 22 //28
//------------------------------
//根据 asd 2019 加的忽略 targetSdkVersion 警告
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
////abortOnError false
}
//------------------------------
defaultConfig {
applicationId "com.example.administrator.myapplication"
minSdkVersion 15
targetSdkVersion 15 //很多模拟器用不了 28 ,改小会怎样?//2019 这个版本的 asd 默认是 28,google play 目前需要至少 26
//改小了又打包不出签名的 apk
//15 对应 4.0.3
//14 对应 4.0.0
//另外还有一种单字符的表示方法 https://blog.csdn.net/itluochen/article/details/53318784
//根据 https://www.jianshu.com/p/2d2a82fdf54a 的说法 4.0.0 的机器是没有的,所以 15 就够了
//加 lintOptions 选项后可以在 asd 中改小,但是模拟器仍然安装不上,奇怪的是直接调试可以
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//https://github.com/ybq/Android-SpinKit 图标,不过下载到哪去了//应该在 .gradle 目录中,不过这样就要每次下载
//还会导致设计器失效,感觉用来测试完还是手工加入一次为好
//implementation 'com.github.ybq:Android-SpinKit:1.2.0'
implementation 'com.nex3z:flow-layout:1.2.4'
}