2017-01-12 11 views
0

を正確に参照しているものが見つかりません以下はアプリケーションを構築する際に発生しているエラーです。Android Espressoの自動化ツールを使用しているときにエラーが発生しました。

AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]} 
AGPBI: {"kind":"error","text":"(org.ccil.cowan.tagsoup.Parser$1) that doesn\u0027t come with an","sources":[{}]} 
AGPBI: {"kind":"error","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]} 
AGPBI: {"kind":"error","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]} 
AGPBI: {"kind":"error","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]} 
AGPBI: {"kind":"error","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]} 
AGPBI: {"kind":"error","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]} 
AGPBI: {"kind":"error","text":"indicate that it is *not* an inner class.","sources":[{}]} 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':app:transformClassesWithDexForDebugAndroidTest'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/test/BuildConfig; 

をFAILED誰かがそれで私を助けることはできますか? build.gradleで変更する必要があるものはありますか?

apply plugin: 'com.android.application' 

android { 
compileSdkVersion 23 
buildToolsVersion "23.0.2" 
defaultConfig { 
    applicationId "com.example.sanket.loginapp" 
    minSdkVersion 18 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    multiDexEnabled = false 
} 
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 module: 'support-annotations' 
} 

androidTestCompile 'com.android.support.test:testing-support-lib:0.1' 
androidTestCompile ('com.android.support.test:runner:0.5') { 
    exclude module: 'support-annotations' 
} 
androidTestCompile ('com.android.support.test:rules:0.5') { 
    exclude module: 'support-annotations' 
} 

androidTestCompile 'com.android.support.test.espresso:espresso-web:2.2.2' 
androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2' 
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' 
compile 'com.android.support:appcompat-v7:23.1.1' 
testCompile 'junit:junit:4.12' 
} 

これは私のbuild.gradleです。私はこの問題の解決策を見いだせなかった。

答えて

0

これらの警告は無視しても問題ありません。 AGPBI: {"kind":"error","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}

ビルドに失敗した場合は、魔法の65Kメソッドカウントに達したようです。 FYI defaultConfig

trueへ 変更multiDexEnabled: 私は以下のようにbuildTypesでデバッグビルドの風味を作成するためのベストプラクティスを考えます。これにより、ProGuardを使用してリリースapkサイズを管理できます。

buildTypes { 
    release { 
    minifyEnabled true 
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
    multiDexEnabled true 
    } 
} 
関連する問題