【问题标题】:black activity giving error android studio黑色活动给出错误android工作室
【发布时间】:2016-08-29 05:39:26
【问题描述】:

刚下载Android Studio 2.1.3。每次都给

error: cannot resolve symbol appcompatactivity,oncreate.Further it shows message "Error:A problem occurred configuring project ':app'.

无法下载 junit.jar (junit:junit:4.12) 无法获取资源“https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar”。 java.lang.NullPointerException(没有错误信息)” 应用插件:'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "com.example.prateek.myapplication"
        minSdkVersion 23
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.2.0'
}

【问题讨论】:

  • 如果你不写单元测试,你可以去掉app模块的build.gradle中的依赖。什么是“黑色活动”?
  • 发布 gradle 文件。

标签: java android android-studio android-gradle-plugin


【解决方案1】:

尝试删除该行:

testCompile 'junit:junit:4.12'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-25
    • 2018-02-20
    • 2016-03-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-30
    • 1970-01-01
    相关资源
    最近更新 更多