Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidStudio #34

Closed
M1cha opened this issue Jan 12, 2015 · 18 comments
Closed

AndroidStudio #34

M1cha opened this issue Jan 12, 2015 · 18 comments

Comments

@M1cha
Copy link

M1cha commented Jan 12, 2015

I get the following error ( I guess it's a Java7 problem ):

  Error Code:
    1
  Output:
    Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 

    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 com/stericson/RootShell/containers/RootClass$1.class

    1 error; aborting


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

BUILD FAILED
@Stericson
Copy link
Owner

Can you try building with Java 8?

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

I can't select that and afaik Android doesn't support it.

@Stericson
Copy link
Owner

Android does support it.

screen shot 2015-01-12 at 2 40 38 pm

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

where do u select that? If I add these lines in my gradle file:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

I get the following error:

* What went wrong:
Execution failed for task ':app:compileDebugJava'.
> invalid source release: 1.8

@Stericson
Copy link
Owner

You probably need to change your JDK location to point to 1.8.

Then you won't get that error.

Open Module settings -> SDK Location -> JDK Location

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

ok, after successfully changing the jdk version to 1.8, I have the same error as with 1.7 :P

@Stericson
Copy link
Owner

The JDK for your Android SDK's may also need updating?

http://stackoverflow.com/questions/24662801/bad-class-file-magic-or-version

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

I have no idea what he means but it's about a preview and I'm using sdk 21 anyway.
Do u still use eclipse or u just don't have this error? In another topic I read, that u have to compile RootTools yourself using AS because the jar is not compatible.
Unfortunately I'm not able to compile it for some reason.(many different problems, I didn't invest that much time into it yet)

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

It seems that Java7 + RootTools 3.5 works.
So it should be a problem of the way you build the jars.

@Stericson
Copy link
Owner

I know what's causing it. I have Java 8 and am compiling it against Java 8 and you are trying to use Java 7.

I'll look into compiling against Java 7, but in the meantime if you want to use the newest version of RootTools you need to configure your environment to work with Java 8.

Possibly check that JAVA_HOME is pointing to java 1.8 instead of java 7 as well...

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

Well I would use 1.8 if it would work, I set 1.8 in gradle, I'm using the 1.8 SDK and my java home is set to /usr/lib/jvm/java-8-oracle

@Stericson
Copy link
Owner

One moment, I'm building a new version targeted to 1.7.

You problem is probably that your Android SDK's are configured to use 1.7 instead of 1.8.

@Stericson
Copy link
Owner

Can you try this one?

https://drive.google.com/open?id=0B5Amguus3csDVVh2NWJaaFRwQkk&authuser=0

Change everything back to 1.7

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

With this file I still have the same error, sry (this time with com/stericson/RootTools/Constants.class).

@Stericson
Copy link
Owner

Oooops, hold on....Noticed on my end it's still using 1.8

@Stericson
Copy link
Owner

Ok, this version is compiled against jdk 7

https://drive.google.com/open?id=0B5Amguus3csDRERybjQ2M1lMOWM&authuser=0

@M1cha
Copy link
Author

M1cha commented Jan 12, 2015

yes this works thx a lot, I'd still like to know where I can change the android sdk compiler so I can use official releases :)

@Stericson
Copy link
Owner

I'll make this the official release.

This will work with 1.7 and above.

I'm going to push this out now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants