2017-09-21 8 views
0

私のプロジェクトをeclipseからAndroid studioに移動しています。プロジェクトを実行すると、次のエラーが発生します。私Build.gradleAndroidプロジェクトをEclipseからAndroidスタジオに移動中にエラーが発生しました。

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

Error:(org.apache.commons.httpclient.HttpMethodBase$1) that doesn't come with an

Error:associated EnclosingMethod attribute. This class was probably produced by a

Error:compiler that did not target the modern .class file format. The recommended

Error:solution is to recompile the class from source, using an up-to-date compiler

Error:and without specifying any "-target" type options. The consequence of ignoring

Error:this warning is that reflective operations on this class will incorrectly

Error:indicate that it is not an inner class.

Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

Error:(org.apache.commons.httpclient.protocol.ControllerThreadSocketFactory$1) that doesn't come with an

Error:associated EnclosingMethod attribute. This class was probably produced by a

Error:compiler that did not target the modern .class file format. The recommended

Error:solution is to recompile the class from source, using an up-to-date compiler

Error:and without specifying any "-target" type options. The consequence of ignoring

Error:this warning is that reflective operations on this class will incorrectly

Error:indicate that it is not an inner class.

Error:Error converting bytecode to dex:

Cause: com.android.dex.DexException: Multiple dex files define Lorg/springframework/core/NestedRuntimeException;

Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

私は、次の依存関係を追加しました。

android { 
compileSdkVersion 23 
buildToolsVersion "26.0.1" 


defaultConfig { 
    applicationId "com.buildteam" 
    minSdkVersion 8 
    targetSdkVersion 19 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 
    useLibrary 'org.apache.http.legacy' 

} 

buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
    } 
} 
aaptOptions { 
    cruncherEnabled = false 
} 

packagingOptions { 
    exclude 'META-INF/DEPENDENCIES.txt' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/notice.txt' 
    exclude 'META-INF/license.txt' 
    exclude 'META-INF/dependencies.txt' 
    exclude 'META-INF/LGPL2.1' 
} 

} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
testCompile 'junit:junit:4.12' 
compile 'com.android.support:appcompat-v7:23.1.0' 
compile files('libs/commons-httpclient-3.1.jar') 
compile files('libs/jackson-annotations-2.4.3.jar') 
compile files('libs/jackson-core-2.4.3.jar') 
compile files('libs/jackson-databind-2.4.3.jar') 
compile files('libs/jackson-mapper-asl-1.9.6.jar') 

compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5' 
compile 'org.springframework.android:spring-android-rest-template:2.0.0.M3' 
compile 'com.android.support:cardview-v7:23.1.0' 
compile 'com.android.support:recyclerview-v7:23.1.0' 
compile 'com.android.support:design:23.1.0' 

} 

私はスタックオーバーフローから非常に多くの質問を試みました。しかし、私は解決策を見つけることができませんでした。 私を助けてください。

+0

アンドロイドスタジオでプロジェクトをどのように開いたのですか?インポートまたはオープン? –

+0

Eclipseプロジェクトとしてインポート – Bivin

+0

このリンクを参照 (https://stackoverflow.com/questions/26609734/how-to-enable-multidexing-with-the-new-android-multidex-support-library) –

答えて

0

あなたは、次の手順を実行してくださいすることができ:minSdkVersionが(可能な限り低い)< = targetSdkVersion == compileSdkVersion(最新のSDK) をしてください使用理想的には、最新の をlastes 更新アンドロイドSDKとADTへ

更新アンドロイドスタジオGradleのは、私たちが失敗した場合、変換中に行われたすべての変更をチェックアウトしてください、上記の手順を試した後、アプリケーション

を実行 を同期するためbuild.gradle 待ちに変更を加えることEclipseプロジェクトをアンドロイドスタジオを使用してアンドロイドスタジオプロジェクトに変換します。

+0

私は試しました。しかし、私はまだ同じエラーがあります。私はアンドロイドスタジオを使用してアンドロイドスタジオプロジェクトにEclipseプロジェクトを変換しようとしています。 – Bivin

+0

eclipseでサンプルプロジェクトを作成し、アンドロイドスタジオを使用してプロジェクトをアンドロイドスタジオプロジェクトに変換してください。ビルドで問題が発生しない場合、問題はプロジェクトの依存関係にあります。あなたはそれをしてくださいできますか? – dmp

関連する問題