Android Studio的app/build.gradle依赖库版本问题
因为版本依赖库的问题,gradle根据每个SDK的版本特性的不同,编译适合不同版本的运行时,而我们可以通过之前的文章讲解的使用以下的方式自定义Gradle版本。
https://services.gradle.org/distributions
同样的,如果是新特性,必须安装对应的版本SDK
例如V7的新特性,最好将SDK更新到API 25 以上。
如果我们 不能保证自己需要的SDK版本是多少,请读者直接将4.0以上的SDK全部下载,网速好的话,很快的。
下载完成之后 ,我们需要Sync Now
下面是一段build.gradle的文件内容的演示:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.xiaomiwujiecao.recycleviewtest"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.2.0'
}
编译版本和目标版本都要统一,否则可能编译完成的APK应用可能会崩溃
有疑问、勘误、请您在下方留言,感谢您的支持 ღ( ´・ᴗ・` )!
感谢您阅读,这篇文章归 极客点子版权所有.
如果转载,请注明出处: 极客点子版权所有(/page/589.html)
本网站使用 创作共用 归属 - 非商业用途 - 共享4.0国际许可协议的相同方式 许可.
如果转载,请注明出处: 极客点子版权所有(/page/589.html)

本网站使用 创作共用 归属 - 非商业用途 - 共享4.0国际许可协议的相同方式 许可.
- You Don't Know JS: Async & Performance Appendix B: Advanced Async Patterns
- 6.You Don't Know JS: ES6 & Beyond Chapter 5: Collections
- You Don't Know JS: ES6 & Beyond Chapter 6: API Additions
- 2.You Don't Know JS: ES6 & Beyond Chapter 1: ES? Now & Future
- You Don't Know JS: ES6 & Beyond Chapter 8: Beyond ES6
博文分类
- nodejs
- express
- thinkjs
- go
- beego
- javascript
- css3
- react native
- python3
- react
- 翻译
- 手册
- 树莓
- Error修复
- 五味
- IoT
- 技巧
- swift
- Android
- C++
- ruby
- perl
- linux
- mysql
- pgSQL
- Redis
- webpack
- C
- Object-C
- SOA
- browserify
- unix
- NDK
- C#
- Docker
- java
- PHP
- gulp
- Sass
- Data mining
- Architecture
- Laravel
- TCP/IP
- AI
- Unix Socket
- Lua
- League of Legends
- tensorflow
- minecraft
- flutter
- dart2
- mongodb
- Julia
- UML
- typescript
- rust
- nginx
- 极客时间
- 架构与道
- 算法
- RHCA