2

OK, so Google made me migrate to this IDE that I've never seen before and don't like so far.

I tried importing my project and although I can understand what the import-summary says, I don't know what to do with it because it gives no clue of my options.

Anyway, I thought I could just build it, try to run and figure out each error at a time. Silly me.

It builds, with the next two warnings only but I can't run. I hit run and it shows me those two warnings plus this error that, of course, I can't understand or find a solution either.

Here's the log, any help with the warnings, error or import-summary is highly appreciated.

Thank you.

Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Warning:Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
:MyApp:preBuild
:MyApp:compileDebugNdk UP-TO-DATE
:MyApp:preDebugBuild
:MyApp:checkDebugManifest
:MyApp:preReleaseBuild
:googlelicencinglib:compileLint
:googlelicencinglib:copyReleaseLint UP-TO-DATE
:googlelicencinglib:mergeReleaseProguardFiles UP-TO-DATE
:googlelicencinglib:preBuild
:googlelicencinglib:preReleaseBuild
:googlelicencinglib:checkReleaseManifest
:googlelicencinglib:prepareReleaseDependencies
:googlelicencinglib:compileReleaseAidl UP-TO-DATE
:googlelicencinglib:compileReleaseRenderscript UP-TO-DATE
:googlelicencinglib:generateReleaseBuildConfig UP-TO-DATE
:googlelicencinglib:generateReleaseAssets UP-TO-DATE
:googlelicencinglib:mergeReleaseAssets UP-TO-DATE
:googlelicencinglib:generateReleaseResValues UP-TO-DATE
:googlelicencinglib:generateReleaseResources UP-TO-DATE
:googlelicencinglib:packageReleaseResources UP-TO-DATE
:googlelicencinglib:processReleaseManifest UP-TO-DATE
:googlelicencinglib:processReleaseResources UP-TO-DATE
:googlelicencinglib:generateReleaseSources UP-TO-DATE
:googlelicencinglib:compileReleaseJava UP-TO-DATE
:googlelicencinglib:processReleaseJavaRes UP-TO-DATE
:googlelicencinglib:packageReleaseJar UP-TO-DATE
:googlelicencinglib:compileReleaseNdk UP-TO-DATE
:googlelicencinglib:packageReleaseJniLibs UP-TO-DATE
:googlelicencinglib:packageReleaseLocalJar UP-TO-DATE
:googlelicencinglib:packageReleaseRenderscript UP-TO-DATE
:googlelicencinglib:bundleRelease UP-TO-DATE
:MyApp:prepareMyAppGooglelicencinglibUnspecifiedLibrary UP-TO-DATE
:MyApp:prepareComAndroidSupportSupportV42100Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServices6587Library UP-TO-DATE
:MyApp:prepareDebugDependencies
:MyApp:compileDebugAidl UP-TO-DATE
:MyApp:compileDebugRenderscript UP-TO-DATE
:MyApp:generateDebugBuildConfig UP-TO-DATE
:MyApp:generateDebugAssets UP-TO-DATE
:MyApp:mergeDebugAssets UP-TO-DATE
:MyApp:generateDebugResValues UP-TO-DATE
:MyApp:generateDebugResources UP-TO-DATE
:MyApp:mergeDebugResources UP-TO-DATE
:MyApp:processDebugManifest UP-TO-DATE
:MyApp:processDebugResources UP-TO-DATE
:MyApp:generateDebugSources UP-TO-DATE
:MyApp:compileDebugJava UP-TO-DATE
:MyApp:preDexDebug
:MyApp:dexDebug


UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':MyApp:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    E:\DEV\SDK Android Studio\build-tools\21.1.2\dx.bat --dex --no-optimize --output E:\DEV\Workspace_Android_Studio\MyApp\MyApp\build\intermediates\dex\debug --input-list=E:\DEV\Workspace_Android_Studio\MyApp\MyApp\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
    2
Output:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent;
        at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
        at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
        at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
        at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)

And if somehow my import-summary can help, here it is:

ECLIPSE ANDROID PROJECT IMPORT SUMMARY
======================================

Manifest Merging:
-----------------
Your project uses libraries that provide manifests, and your Eclipse
project did not explicitly turn on manifest merging. In Android Gradle
projects, manifests are always merged (meaning that contents from your
libraries' manifests will be merged into the app manifest. If you had
manually copied contents from library manifests into your app manifest
you may need to remove these for the app to build correctly.

Ignored Files:
--------------
The following files were *not* copied into the new Gradle project; you
should evaluate whether these are still needed in your project and if
so manually move them:

From MyApp:
* .google_apis\
* .google_apis\desktop.ini
* .google_apis\drive-v2\
* .google_apis\drive-v2\desktop.ini
* .google_apis\drive-v2\drive\
* .google_apis\drive-v2\drive\descriptor.json
* .google_apis\drive-v2\drive\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\
* .google_apis\drive-v2r107lv1.16.0-rc\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\LICENSE.txt
* .google_apis\drive-v2r107lv1.16.0-rc\drive\classpath-include
* .google_apis\drive-v2r107lv1.16.0-rc\drive\dependencies\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\dependencies\css\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\dependencies\css\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\dependencies\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\descriptor.json
* .google_apis\drive-v2r107lv1.16.0-rc\drive\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\google-api-services-drive-v2-rev107-1.16.0-rc-javadoc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\google-api-services-drive-v2-rev107-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\google-api-services-drive-v2-rev107-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\google-api-services-drive-v2-rev107-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\icons\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\icons\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\icons\drive_icon_16.png
* .google_apis\drive-v2r107lv1.16.0-rc\drive\icons\drive_icon_32.png
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-api-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-api-client-android-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-http-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-http-client-android-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-http-client-gson-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-http-client-jackson-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-http-client-jackson2-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\google-oauth-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\gson-2.1-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\jackson-core-2.1.3-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs-sources\jackson-core-asl-1.9.11-sources.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\desktop.ini
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-api-client-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-api-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-api-client-android-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-api-client-android-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-android-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-android-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-gson-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-gson-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-jackson-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-jackson-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-jackson2-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-http-client-jackson2-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-oauth-client-1.16.0-rc.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\google-oauth-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\gson-2.1.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\gson-2.1.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\jackson-core-2.1.3.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\jackson-core-2.1.3.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\jackson-core-asl-1.9.11.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\jackson-core-asl-1.9.11.jar.properties
* .google_apis\drive-v2r107lv1.16.0-rc\drive\libs\jsr305-1.3.9.jar
* .google_apis\drive-v2r107lv1.16.0-rc\drive\proguard-google-api-client.txt
* .google_apis\drive-v2r107lv1.16.0-rc\drive\readme.html
* .google_apis\drive-v2r108lv1.16.0-rc\
* .google_apis\drive-v2r108lv1.16.0-rc\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\
* .google_apis\drive-v2r108lv1.16.0-rc\drive\LICENSE.txt
* .google_apis\drive-v2r108lv1.16.0-rc\drive\classpath-include
* .google_apis\drive-v2r108lv1.16.0-rc\drive\dependencies\
* .google_apis\drive-v2r108lv1.16.0-rc\drive\dependencies\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\descriptor.json
* .google_apis\drive-v2r108lv1.16.0-rc\drive\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\google-api-services-drive-v2-rev108-1.16.0-rc-javadoc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\google-api-services-drive-v2-rev108-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\google-api-services-drive-v2-rev108-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\google-api-services-drive-v2-rev108-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\icons\
* .google_apis\drive-v2r108lv1.16.0-rc\drive\icons\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\icons\drive_icon_16.png
* .google_apis\drive-v2r108lv1.16.0-rc\drive\icons\drive_icon_32.png
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-api-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-api-client-android-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-http-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-http-client-android-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-http-client-gson-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-http-client-jackson-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-http-client-jackson2-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\google-oauth-client-1.16.0-rc-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\gson-2.1-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\jackson-core-2.1.3-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs-sources\jackson-core-asl-1.9.11-sources.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\desktop.ini
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-api-client-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-api-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-api-client-android-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-api-client-android-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-android-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-android-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-gson-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-gson-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-jackson-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-jackson-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-jackson2-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-http-client-jackson2-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-oauth-client-1.16.0-rc.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\google-oauth-client-1.16.0-rc.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\gson-2.1.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\gson-2.1.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\jackson-core-2.1.3.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\jackson-core-2.1.3.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\jackson-core-asl-1.9.11.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\jackson-core-asl-1.9.11.jar.properties
* .google_apis\drive-v2r108lv1.16.0-rc\drive\libs\jsr305-1.3.9.jar
* .google_apis\drive-v2r108lv1.16.0-rc\drive\proguard-google-api-client.txt
* .google_apis\drive-v2r108lv1.16.0-rc\drive\readme.html
* desktop.ini
* icone-alta-512.png
* proguard\
* proguard\dump.txt
* proguard\mapping.txt
* proguard\seeds.txt
* proguard\usage.txt
From google-licencing-lib:
* aidl\
* aidl\ILicenseResultListener.aidl
* aidl\ILicensingService.aidl

Replaced Jars with Dependencies:
--------------------------------
The importer recognized the following .jar files as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the .jar file in your project was of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the jar replacement in the import wizard and try again:

android-support-v4.jar => com.android.support:support-v4:19.1.0
google-http-client-gson-1.16.0-rc.jar => com.google.http-client:google-http-client-gson:1.19.0
gson-2.1.jar => com.google.code.gson:gson:2.1

Potentially Missing Dependency:
-------------------------------
When we replaced the following .jar files with a Gradle dependency, we
inferred the dependency version number from the filename. This
specific version may not actually be available from the repository.
If you get a build error stating that the dependency is missing, edit
the version number to for example "+" to pick up the latest version
instead. (This may require you to update your code if the library APIs
have changed.)

gson-2.1.jar => version 2.1 in com.google.code.gson:gson:2.1

Replaced Libraries with Dependencies:
-------------------------------------
The importer recognized the following library projects as third party
libraries and replaced them with Gradle dependencies instead. This has
the advantage that more explicit version information is known, and the
libraries can be updated automatically. However, it is possible that
the source files in your project were of an older version than the
dependency we picked, which could render the project not compileable.
You can disable the library replacement in the import wizard and try
again:

google-play-services_lib => [com.google.android.gms:play-services:+]

Moved Files:
------------
Android Gradle projects use a different directory structure than ADT
Eclipse projects. Here's how the projects were restructured:

In google-licencing-lib:
* AndroidManifest.xml => googlelicencinglib\src\main\AndroidManifest.xml
* assets\ => googlelicencinglib\src\main\assets\
* res\ => googlelicencinglib\src\main\res\
* src\ => googlelicencinglib\src\main\java\
In MyApp:
* AndroidManifest.xml => MyApp\src\main\AndroidManifest.xml
* assets\ => MyApp\src\main\assets\
* libs\google-api-client-1.16.0-rc.jar => MyApp\libs\google-api-client-1.16.0-rc.jar
* libs\google-api-client-android-1.16.0-rc.jar => MyApp\libs\google-api-client-android-1.16.0-rc.jar
* libs\google-api-services-drive-v2-rev108-1.16.0-rc.jar => MyApp\libs\google-api-services-drive-v2-rev108-1.16.0-rc.jar
* libs\google-http-client-1.16.0-rc.jar => MyApp\libs\google-http-client-1.16.0-rc.jar
* libs\google-http-client-android-1.16.0-rc.jar => MyApp\libs\google-http-client-android-1.16.0-rc.jar
* libs\google-http-client-jackson-1.16.0-rc.jar => MyApp\libs\google-http-client-jackson-1.16.0-rc.jar
* libs\google-http-client-jackson2-1.16.0-rc.jar => MyApp\libs\google-http-client-jackson2-1.16.0-rc.jar
* libs\google-oauth-client-1.16.0-rc.jar => MyApp\libs\google-oauth-client-1.16.0-rc.jar
* libs\jackson-core-2.1.3.jar => MyApp\libs\jackson-core-2.1.3.jar
* libs\jackson-core-asl-1.9.11.jar => MyApp\libs\jackson-core-asl-1.9.11.jar
* libs\jsr305-1.3.9.jar => MyApp\libs\jsr305-1.3.9.jar
* lint.xml => MyApp\lint.xml
* proguard-google-api-client.txt => MyApp\proguard-google-api-client.txt
* proguard-project.txt => MyApp\proguard-project.txt
* res\ => MyApp\src\main\res\
* src\ => MyApp\src\main\java\

Next Steps:
-----------
You can now build the project. The Gradle project needs network
connectivity to download dependencies.

Bugs:
-----
If for some reason your project does not build, and you determine that
it is due to a bug or limitation of the Eclipse to Gradle importer,
please file a bug at http://b.android.com with category
Component-Tools.

(This import summary is for your information only, and can be deleted
after import once you are satisfied with the results.)

As requested, here it goes my 3 bruild.grade files generated when importing: One has my app name with capital cases, one has my app name with the first letter on lower case and the other is from googlelicencinglib.

I'm still trying to understand this grade.build files...

build.grade (Project: MyApp)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

build.grade(Module: myApp)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:19'
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 11
        targetSdkVersion 19
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt', 'proguard-google-api-client.txt'
        }
    }
}

dependencies {
    compile project(':googlelicencinglib')
    compile 'com.android.support:support-v4:19.1.0'
    compile 'com.google.http-client:google-http-client-gson:1.19.0'
    compile 'com.google.code.gson:gson:2.1'
    compile 'com.google.android.gms:play-services:+'
    compile files('libs/google-api-client-1.16.0-rc.jar')
    compile files('libs/google-api-client-android-1.16.0-rc.jar')
    compile files('libs/google-api-services-drive-v2-rev108-1.16.0-rc.jar')
    compile files('libs/google-http-client-1.16.0-rc.jar')
    compile files('libs/google-http-client-android-1.16.0-rc.jar')
    compile files('libs/google-http-client-jackson-1.16.0-rc.jar')
    compile files('libs/google-http-client-jackson2-1.16.0-rc.jar')
    compile files('libs/google-oauth-client-1.16.0-rc.jar')
    compile files('libs/jackson-core-2.1.3.jar')
    compile files('libs/jackson-core-asl-1.9.11.jar')
    compile files('libs/jsr305-1.3.9.jar')
}

build.grade(Module: googlelicencinlib)

apply plugin: 'com.android.library'

android {
    compileSdkVersion 'Google Inc.:Google APIs:19'
    buildToolsVersion "21.1.2"

    defaultConfig {
        minSdkVersion 3
        targetSdkVersion 15
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}
yole
  • 92,896
  • 20
  • 260
  • 197
Dpedrinha
  • 3,741
  • 3
  • 38
  • 57
  • 1
    Please attach your build.gradle file generated by the importer. – yole Jan 29 '15 at 21:02
  • http://stackoverflow.com/questions/20989317/multiple-dex-files-define-landroid-support-v4-accessibilityservice-accessibility to help resolve dupes in the build ( dex) – Robert Rowntree Jan 30 '15 at 14:31
  • Thank you Robert, I found a million of those but they are not the exact same problem and I can't understand how to use it's answers to fix my problem. – Dpedrinha Jan 30 '15 at 15:25

3 Answers3

3

Looks like this dependency is incorrect and causing the build to fail:

compile files('libs/google-api-client-1.16.0-rc.jar')

Right now your project depends on both the desktop and the Android versions of the API client library, which causes the build to fail because they define the same classes. You need to remove the dependency on the desktop version.

yole
  • 92,896
  • 20
  • 260
  • 197
  • With that tip I actually fixed the problem, but not removing google-api-client, but the google-http-client. The weird thing is that it worked before and that I need the google-api-client for desktop on the app for it to work. It has classes for Google Drive that the android version doesn't. – Dpedrinha Jan 31 '15 at 11:04
  • @Dpedrinha could you be more specific as to which google-http-client you removed. Perhaps you could add the solution as an answer to your question. – Ryan Heitner Mar 26 '15 at 10:30
1

I fixed this problem removing the google-http-client (for desktop) dependency. I don't know why, but the google-api-client lib for desktop is needed for some Google Drive features. Anyway, I hope it helps.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57
0
com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent;

In my experience, a DexException has occurred because there are multiple libraries that define the same set of methods.

Double check to make sure that you don't have 2 separate dependencies on any of the libraries you want to use.

From my own project, it was because I had a library that had the Android support library jar bundled with it, and I manually added the support library jar as a dependecy as well.

Jeeter
  • 5,887
  • 6
  • 44
  • 67