Build Bamboo remote agent for Android(based Gradle) Project


(patni) #1

I’m trying to setup Bamboo remote agent for Gradle Based Android project. Now constrain is Bamboo need min Java V1.8 where Gradle not support(at least what I tried) this. I simply check this by choose alternate Java V1.7 and execute gradle build then simply it’s building perfectly but when I switch back to JavaV1.8 then it getting failed.

I follow some thread available over web and try to set

apply plugin: 'Java'

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}

but that’s showing build issue. Any suggestion if I’m missing anything.

IDE Android Studio version I’m using: 1.5.1
Gradle version: 2.5 and it’s configured for
1.8.0_72 (Oracle Corporation 25.72-b15) showing in output for gradle -version

Please update. #Thanks.


(Stefan Oehme) #2

Please include the full error message when reporting a problem.


(patni) #3
I'm getting following log:
    ........
    Note: net.sqlcipher.database.SQLiteContentHelper accesses a declared method 'getParcelFileDescriptor()' dynamically
    Note: the configuration refers to the unknown method 'void attachBaseContext(android.content.Context)' in class 'com.avmar.utils.ApplicationClass'
    Note: there were 1 references to unknown class members.
          You should check your configuration for typos.
    Note: there were 1 classes trying to access annotations using reflection.
          You should consider keeping the annotation attributes
          (using '-keepattributes *Annotation*').
          (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
    Note: there were 2 classes trying to access generic signatures using reflection.
          You should consider keeping the signature attributes
          (using '-keepattributes Signature').
          (http://proguard.sourceforge.net/manual/troubleshooting.html#attributes)
    Note: there were 8 unresolved dynamic references to classes or interfaces.
          You should check if you need to specify additional program jars.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
    Note: there were 15 accesses to class members by means of introspection.
          You should consider explicitly keeping the mentioned class members
          (using '-keep' or '-keepclassmembers').
          (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclassmember)
    Note: you're ignoring all warnings!
    Preparing output jar [/home/user/workplace/mobile-java/app/build/intermediates/multi-dex/debug/componentClasses.jar]
      Copying resources from program jar [/home/user/workplace/mobile-java/app/build/intermediates/transforms/jarMerging/debug/jars/1/1f/combined.jar]
    :app:transformClassesWithDexForDebug

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.RuntimeException: Exception parsing classes
        at com.android.dx.command.dexer.Main.processClass(Main.java:752)
        at com.android.dx.command.dexer.Main.processFileBytes(Main.java:718)
        at com.android.dx.command.dexer.Main.access$1200(Main.java:85)
        at com.android.dx.command.dexer.Main$FileBytesConsumer.processFileBytes(Main.java:1645)
        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:672)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:569)
        at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
        at com.android.dx.command.dexer.Main.run(Main.java:275)
        at com.android.dx.command.dexer.Main.main(Main.java:245)
        at com.android.dx.command.Main.main(Main.java:106)
    Caused by: 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.parseClass(Main.java:764)
        at com.android.dx.command.dexer.Main.access$1500(Main.java:85)
        at com.android.dx.command.dexer.Main$ClassParserTask.call(Main.java:1684)
        at com.android.dx.command.dexer.Main.processClass(Main.java:749)
        ... 12 more
    1 error; aborting

    :app:transformClassesWithDexForDebug FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:transformClassesWithDexForDebug'.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-8-oracle/bin/java'' finished with non-zero exit value 1

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

(Stefan Oehme) #4

So you are trying to build an Android project. Android does not support Java 8. You have to build with Java 7 target compatibility