androidgradleandroid-studiolibrary-project

Android Studio 1.0 - "local path doesn't exist" with external library project


Even the "Studio Android 0.8.x" I could reference an external library project as a module of my project.

In settings.gradle file:

include ':app'

// sinapse library
include ':SinapseLibrary2.1'
project(':SinapseLibrary2.1').projectDir = new File('/Users/douglas/AndroidStudioProjects/SinapseLibrary2.1/library')

After the 0.9.x version that is not possible. When I run the app I get the message below.

I use the same project library within several other projects.

This is a bug, or is there an alternative?

enter image description here

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:SinapseLibrary2.1:compileLint
:SinapseLibrary2.1:copyReleaseLint UP-TO-DATE
:SinapseLibrary2.1:mergeReleaseProguardFiles UP-TO-DATE
:SinapseLibrary2.1:preBuild
:SinapseLibrary2.1:preReleaseBuild
:SinapseLibrary2.1:checkReleaseManifest
:SinapseLibrary2.1:prepareReleaseDependencies
:SinapseLibrary2.1:compileReleaseAidl UP-TO-DATE
:SinapseLibrary2.1:compileReleaseRenderscript UP-TO-DATE
:SinapseLibrary2.1:generateReleaseBuildConfig UP-TO-DATE
:SinapseLibrary2.1:generateReleaseAssets UP-TO-DATE
:SinapseLibrary2.1:mergeReleaseAssets UP-TO-DATE
:SinapseLibrary2.1:generateReleaseResValues UP-TO-DATE
:SinapseLibrary2.1:generateReleaseResources UP-TO-DATE
:SinapseLibrary2.1:packageReleaseResources UP-TO-DATE
:SinapseLibrary2.1:processReleaseManifest UP-TO-DATE
:SinapseLibrary2.1:processReleaseResources UP-TO-DATE
:SinapseLibrary2.1:generateReleaseSources UP-TO-DATE
:SinapseLibrary2.1:compileReleaseJava UP-TO-DATE
:SinapseLibrary2.1:processReleaseJavaRes UP-TO-DATE
:SinapseLibrary2.1:packageReleaseJar UP-TO-DATE
:SinapseLibrary2.1:compileReleaseNdk UP-TO-DATE
:SinapseLibrary2.1:packageReleaseJniLibs UP-TO-DATE
:SinapseLibrary2.1:packageReleaseLocalJar UP-TO-DATE
:SinapseLibrary2.1:packageReleaseRenderscript UP-TO-DATE
:SinapseLibrary2.1:bundleRelease UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareCromoledRemoteControlSinapseLibrary21UnspecifiedLibrary UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
...while parsing br/ind/sinapse/library/BuildConfig.class
1 error; aborting
Error:Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    /Users/douglas/ferramentas/adt-bundle-mac-x86_64-20140702/build-tools/21.1.2/dx --dex --output /Users/douglas/AndroidStudioProjects/CromoledRemoteControl/app/build/intermediates/pre-dexed/debug/classes-b4d0e7e6eb67c94397ec32d2b0a00147807d74d7.jar /Users/douglas/AndroidStudioProjects/CromoledRemoteControl/app/build/intermediates/exploded-aar/CromoledRemoteControl/SinapseLibrary2.1/unspecified/classes.jar
  Error Code:
    1
  Output:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    com.android.dx.cf.iface.ParseException: bad class file magic (cafebabe) or version (0034.0000)
        at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:472)
        at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
        at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
        at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251)
        at com.android.dx.command.dexer.Main.processClass(Main.java:704)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
        at com.android.dx.command.dexer.Main.access$300(Main.java:83)
        at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        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)
    ...while parsing br/ind/sinapse/library/BuildConfig.class
    1 error; aborting
Information:BUILD FAILED
Information:Total time: 2.351 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

Solution

  • thank you for your attention. Finally solved the problem, but I could not understand what was the cause.

    I undid the project changes that were using the version of "Android 0.8.x Studio" and then imported again in the "Android Studio 1.0.1". Updated the proguard parameters, etc.

    Now it's all right. Thank you.