无法从Eclipse迁移到IntelliJ IDEA。这个日志是什么意思?

时间:2015-01-29 18:49:31

标签: android intellij-idea

好的,所以谷歌让我迁移到这个IDE,这是我以前从未见过的,到目前为止还不喜欢。

我尝试导入我的项目,虽然我可以理解导入摘要说的内容,但我不知道如何处理它,因为它不能提供我的选择。

无论如何,我以为我可以构建它,尝试运行并一次找出每个错误。傻我。

它构建,只有下两个警告,但我无法运行。我点击了跑,它向我展示了这两个警告加上这个错误,当然,我无法理解或找到解决方案。

以下是日志,我们非常感谢您对警告,错误或导入摘要的任何帮助。

谢谢。

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)

如果以某种方式我的导入摘要可以提供帮助,那么它就是:

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.)

根据要求,这里是我导入时生成的3个bruild.grade文件: 一个有我的应用程序名称有大写案例,一个有我的应用程序名称,小写的第一个字母,另一个来自googlelicencinglib。

我仍在尝试了解这个grade.build文件...

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'
        }
    }
}

3 个答案:

答案 0 :(得分:3)

看起来这个依赖项不正确并导致构建失败:

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

现在,您的项目依赖于API客户端库的桌面和Android版本,这会导致构建失败,因为它们定义了相同的类。您需要删除对桌面版本的依赖性。

答案 1 :(得分:1)

我修复了此问题,删除了google-http-client(for desktop)依赖项。 我不知道为什么,但某些Google云端硬盘功能需要使用桌面版的google-api-client lib。 无论如何,我希望它有所帮助。

答案 2 :(得分:0)

com.android.dex.DexException: Multiple dex files define Lcom/google/api/client/util/StreamingContent;

根据我的经验,发生了DexException,因为有多个库定义了同一组方法。

仔细检查以确保您对要使用的任何库没有2个单独的依赖项。

从我自己的项目来看,这是因为我有一个与它捆绑的Android支持库jar的库,我手动添加了支持库jar作为依赖。