使用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'}

以上做个记录,当下次使用时以便更快的解决问题

更多相关文章

  1. Kotlen_DataBinding_配置
  2. mac android ndk第一步
  3. Android(安卓)SwipeMenuListView策滑实现各种删除和打开功能
  4. [填坑系列]Android(安卓)Studio 3.0配置更改
  5. Android打包编译shrinkResources true报错解决方案
  6. Windows下用Eclipse搭建Android开发环境搭建
  7. gradle打包时的一些配置
  8. Android(安卓)gradle plugin sync failed 错误
  9. unity调用aar包 适配AndroidX冲突

随机推荐

  1. Android 第三方应用监听home键
  2. Android 日期控件属性
  3. android:stateNotNeeded="true"
  4. Android(安卓)Notification 详解
  5. Android有用代码(二)
  6. (android)应用基础
  7. xamarin android实现Toolbar+DrawerLayou
  8. Android(安卓)ViewPager图片滑动
  9. 配置android app 方法数超过65k问题
  10. 在android tegra2中添加一个camera