Android Studio 2.2.2不运行新项目

时间:2016-11-18 06:06:00

标签: android android-studio

我创建了一个新项目并在没有任何改变的情况下运行它。 但是该项目没有运行,而且你好世界的应用程序正在投掷“转变预期”。

我尝试的事情:

  1. 启用multidex: - 同样的错误
  2. Dex options maxheapsize 4g:同样的错误
  3. 包装选项排除: - 同样的错误
  4. 代码:

    
    
    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 25
        buildToolsVersion "23.0.3"
        defaultConfig {
            applicationId "com.blood_bank"
            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.0.1'
        testCompile 'junit:junit:4.12'
    }
    
    Information:Gradle tasks [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]
    Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
    > com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: No dex files created at C:\Users\arcgis\AndroidStudioProjects\MyApplication\app\build\intermediates\transforms\dex\debug\folders\1000\5\slice_9
    Information:BUILD FAILED
    Information:Total time: 27.813 secs
    Information:1 error
    Information:0 warnings
    Information:See complete output in console
    
    
    

1 个答案:

答案 0 :(得分:0)

删除此行:

 testCompile 'junit:junit:4.12'