【发布时间】:2017-09-06 23:24:40
【问题描述】:
当我在 android studio 中运行应用程序时,出现此错误
任务执行失败 ':app:transformClassesWithDexForDebug'。
com.android.build.api.transform.TransformException:
java.lang.RuntimeException:
java.lang.RuntimeException: 无法 前索引 'C:\Users\abbasooo.android\build-cache\02f0747de7a8d30b23f383d74adce1e1ad5192a4\output\jars\classes.jar'
到
'C:\Users\abbasooo\Desktop\tesssst\app\build\intermediates\transforms\dex\debug\folders\1000\10\classes_571d6b5e229e10768234d4a86b076939bc9a4c44'**
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.abbasooo.tesssst"
minSdkVersion 9
targetSdkVersion 24
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.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.+'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:24.+'
testCompile 'junit:junit:4.12'
}
这是我的 AndroidManifest.xml强文本
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.abbasooo.tesssst">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
【问题讨论】:
-
清理和重建项目时会发生什么?
标签: java android android-studio