Android Studio support:appcompat-v7:26+

来源:互联网 发布:贵州广电网络节目表 编辑:程序博客网 时间:2024/05/23 12:23

刚刚学习Android,安装Android Studio2.3.3就花了我一晚上时间。

什么创建项目之前的就不记录了。因为被support:appcompat-v7:26+报错气的半死,所以有必要记录一下。

在网上搜来搜去,试了些什么下载support library之类的方法,完全没用,根本不用这些库。找到一个修改version的方法,按他说的也没有试成功,也可能是急了没认真看。后来气死了就乱搞一通,把所有的version都设置为同一个版本,居然好了。

  • 解决方法是把下面标红色的改成同一个版本,当然前提是你下载了对应的sdk、build-tools
apply plugin: 'com.android.application'android {    compileSdkVersion 25    buildToolsVersion '25.0.0'    defaultConfig {        applicationId "com.example.helloworld"        minSdkVersion 18        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.1', {        exclude group: 'com.android.support', module: 'support-annotations'    })    compile 'com.android.support:appcompat-v7:25.0.0'    compile 'com.android.support.constraint:constraint-layout:1.0.2'    testCompile 'junit:junit:4.12'}
上面这张图是我为了显示 提示的错误后来手动改回默认的值的。默认就是
com.android.support:appcompat-v7:26.0+

阅读全文
0 0
原创粉丝点击