java - Android Sudio - Errors after adding Google Play Services / Android Support -
first copied , placed
- google-play-services.jar in "src/main/libs/" folder
- android-support-v4.jar in "src/main/libs/" folder
i both did this:
- right clicked on top root item (project)
- selected "module settings"
- navigated "dependencies"
- clicked "+" , "file dependency"
- chose "google-play-services.jar" , "android-support-v4.jar"
however, error:
execution failed task ':standard:dexdebug'.
com.android.ide.common.internal.loggederrorexception: failed run command: d:\devtools\android-studio-intellij\sdk\build-tools\android-4.4.2\dx.bat --dex --output w:\intellij-android-projects\example\standard\build\libs\standard-debug.dex w:\intellij-android-projects\example\standard\build\classes\debug w:\intellij-android-projects\example\standard\build\dependency-cache\debug w:\intellij-android-projects\example\standard\build\pre-dexed\debug\android-support-v4-b111dc7043c3c79f72d7939f47909b3747170302.jar w:\intellij-android-projects\example\standard\build\pre-dexed\debug\classes-cd6929ed4c5651a3b535fb10f1d69394208e6d09.jar w:\intellij-android-projects\example\standard\build\pre-dexed\debug\google-play-services-806451f099bfcf85b10dd770cda9957922315e35.jar w:\intellij-android-projects\example\standard\build\pre-dexed\debug\support-v4-19.0.1-1f8b441cc636851c8231d692429070254dbba449.jar error code: 2 output: unexpected top-level exception: com.android.dex.dexexception: multiple dex files define landroid/support/v4/accessibilityservice/accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:594) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:552) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:533) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:170) @ com.android.dx.merge.dexmerger.merge(dexmerger.java:188) @ com.android.dx.command.dexer.main.mergelibrarydexbuffers(main.java:439) @ com.android.dx.command.dexer.main.runmonodex(main.java:287) @ com.android.dx.command.dexer.main.run(main.java:230) @ com.android.dx.command.dexer.main.main(main.java:199) @ com.android.dx.command.main.main(main.java:103)
my %project%/build.gradle file looks this:
// top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.7.+' } } allprojects { repositories { mavencentral() } }
my %project%/%module%/build.gradle file looks this:
apply plugin: 'android' android { compilesdkversion 19 buildtoolsversion '19.0.1' defaultconfig { minsdkversion 8 targetsdkversion 17 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:appcompat-v7:+' compile files('src/main/libs/google-play-services.jar') compile files('src/main/libs/android-support-v4.jar') }
check module dependencies , build.gradle file verify not have dependency on android v4 support libs via maven repository:
dependencies { compile 'com.android.support:support-v4:+' }
the default behavior of android studio add new projects or ones have been migrated eclipse. looks tool picking jar file manually added libs
directory.
Comments
Post a Comment