2016-11-18 193 views
1

我创建了一个新项目并且没有任何更改就运行了它。 但该项目没有运行,你好世界的应用程序正在抛出'转换期望'。Android Studio 2.2.2不运行新项目

事情我想:

  1. multidex启用: - 同样的错误
  2. 塞米松选项maxheapsize4克:同样的错误
  3. 包装选项排除: - 同样的错误

代码:

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

+4

禁用即时运行,之后再试。 –

+1

您拯救了我的一天@JinalPatel ....感谢很多完美的回答 –

+1

如果您必须禁用某项功能,那么这几乎是完美的。治疗潜在的疾病不是一个症状。我会从'buildToolsVersion“25.0.0”'开始。 –

回答

0

删除此行:

testCompile 'junit:junit:4.12' 
+0

已尝试不成功Mohammad Saeed –