使用idea写android应用时,配置错误问题
16lz
2021-01-26
使用idea写android应用时,配置错误问题
使用idea写android应用时,配置错误问题,经过验证发现对于app目录下的 build.gradle
和项目的build.gradle
配置,以下组合可以轻易的运行项目,解决问题。
项目根目录下的配置
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { google() jcenter() }}task clean(type: Delete) { delete rootProject.buildDir}
app目录下的配置
apply plugin: 'com.android.application'android { compileSdkVersion 25 defaultConfig { applicationId "com.xxx.cn.xxx" minSdkVersion 23 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 { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:25.+' 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'}
以上做个记录,当下次使用时以便更快的解决问题
更多相关文章
- Kotlen_DataBinding_配置
- mac android ndk第一步
- Android(安卓)SwipeMenuListView策滑实现各种删除和打开功能
- [填坑系列]Android(安卓)Studio 3.0配置更改
- Android打包编译shrinkResources true报错解决方案
- Windows下用Eclipse搭建Android开发环境搭建
- gradle打包时的一些配置
- Android(安卓)gradle plugin sync failed 错误
- unity调用aar包 适配AndroidX冲突