Fuse 021 cannot compile for Android

HI, Fuse: 021 OS: Mac OS X - El Capitan

I am trying to develop some foreign code using java. I got an exception from the code, complaining the compliler (javac) is too old. Subsequently, I followed fuse instructions to: fuse install android, and even go to the Oracle site to download java, jdk-8u92-macosx-x64.dmg. none of this work. I remembered this code worked for an earlier version of Fuse.

The following is part of the output from: fuse preview -t android

...
-compile:
    [javac] Compiling 42 source files to /Users/worfdata/Developments/FuseLearning/2ndFuseTest/MySecondFuseApp/FuseMotion/build/Android/Preview/ForeignAccelerometer/app/src/main/bin/classes
    [javac] It is recommended that the compiler be upgraded.
    [javac] It is recommended that the compiler be upgraded.
...
/ForeignAccelerometer/app/src/main/bin/classes
      [dex] input: /Users/worfdata/Developments/FuseLearning/2ndFuseTest/MySecondFuseApp/FuseMotion/build/Android/Preview/ForeignAccelerometer/app/src/main/libs/android-support-v4.jar
      [dex] Pre-Dexing /Users/worfdata/Developments/FuseLearning/2ndFuseTest/MySecondFuseApp/FuseMotion/build/Android/Preview/ForeignAccelerometer/app/src/main/libs/android-support-v4.jar -> android-support-v4-655b54577497639bfe28895d45ac30f0.jar
       [dx]     at java.lang.ClassLoader.defineClass1(Native Method)
       [dx]     at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
       [dx]     at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
       [dx]     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
       [dx]     at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
       [dx]     at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
       [dx]     at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
       [dx]     at java.security.AccessController.doPrivileged(Native Method)
       [dx]     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
       [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
       [dx]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
       [dx]     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
(unknown): E0200: Android build failed
?: Error E0200: Android build failed
(11.15s)

Build completed in 68.85 seconds
    1 error
Found JDK version 1.6.65. However Fuse requires a JDK version that is higher than version 1.6.
jdk was not found.
Checking if /Users/worfdata/Library/Android/sdk/ndk-bundle/toolchains exists.
/Users/worfdata/Library/Android/sdk/ndk-bundle/toolchains was found.
Checking if /Users/worfdata/Library/Android/sdk/ndk-bundle/prebuilt exists.
/Users/worfdata/Library/Android/sdk/ndk-bundle/prebuilt was found.
androidndk was found.
Checking if /Users/worfdata/Library/Application Support/Fusetools/Fuse/Android/Ant exists.
/Users/worfdata/Library/Application Support/Fusetools/Fuse/Android/Ant was found.
Checking if Ant is corrupt
ant was found.
?: Error F0001: Looks like Android is not installed. Please run 'fuse install android' first.
Build ended
fuse: Failed to compile project

fkao

I had the same problem when I use fuse install android

# Starting JDK installer
Verifies that Java Development Kit is installed and valid.
Found JDK version 1.6.65. However Fuse requires a JDK version that is higher than version 1.6.
ApplicationName='/Library/Java/JavaVirtualMachines/bin/javac', CommandLine='-version', CurrentDirectory='', Native error= Cannot find the specified file
fuse: Failed to install JDK

Thanks for the feedback. :slight_smile:

I have created a ticket for this problem, and I will get back to you when I know more.

A fix will be part of the next release. In the meanwhile please install latest jdk manually from http://www.oracle.com/technetwork/java/javase/downloads/index.html. Run fuse install android afterwards.

Thanks for reporting.

thank you, howere I did already tried this way. But the fuse or the OSX continue to redirect the old version. I’m researching for this solution. I think that is a question of set a way

Try to manually edit ~/.fuse/sdkConfig.json, so that it points to the right JDK directory. And then please run fuse install android

I am not seeing sdkConfig.json in .fuse

Chad, I suspect you haven’t ran fuse install android yet. You should do that first, before following my “solution” above.

I did however i am not seeing the sdkConfig.json file. this is what i am getting. and its happening on my both computers.

Starting JDK installer

Verifies that Java Development Kit is installed and valid. Found JDK version 1.6.65. However Fuse requires a JDK version that is higher than version 1.6. ApplicationName=’/Library/Java/JavaVirtualMachines/bin/javac’, CommandLine=’-version’, CurrentDirectory=’’, Native error= Cannot find the specified file fuse: Failed to install JDK

I’m getting the same error after running “fuse install android”. I also updated manually via the Oracle download page and cannot see sdkConfig.json in the .fuse folder.

Since the installer hit a fatal exception, the sdkConfig.json wasn’t generated. However follow the procedure below.

  1. Put this file https://gist.github.com/Tapped/374f3641f054933302de3822a357fe19 here: ~/.fuse/sdkConfig.json.
  2. Change the JDK.Path to the absolute path of the newer JDK. For example /Library/Java/JavaVirtualMachines/1.8.jdk. Also, just ignore SearchPattern.
  3. Then run fuse install android

Thank you. I got mine to work by fixing the java installation on my computer using the following instructions.

https://www.ihash.eu/2015/11/how-to-install-java-jre-8-on-mac-os-x-10-11-el-capitan

I’ve tried everything above. I upgraded to v.27 and now having this issue:

Found JDK version 1.6.65. However Fuse requires a JDK version that is higher than version 1.6.
jdk was not found.
Checking if /Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/AndroidNDK/toolchains exists.
/Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/AndroidNDK/toolchains was found.
Checking if /Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/AndroidNDK/prebuilt exists.
/Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/AndroidNDK/prebuilt was found.
androidndk was found.
Checking if /Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/Ant exists.
/Users/WebbratStudios/Library/Application Support/Fusetools/Fuse/Android/Ant was found.
Checking if Ant is corrupt
ant was found.
?: Error F0001: Looks like Android is not installed. Please run 'fuse install android' first.
Build ended
fuse: Failed to compile project```

Hi,

As the validator points out

Found JDK version 1.6.65. However Fuse requires a JDK version that is higher than version 1.6.

Which means that you have to install a newer version of JDK (higher minor version). http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

@Emil, I did just that. Fuse is still pointing to 1.6

I solved this problem.

My environment;

  • Mac Sierra 10.12.2
  • Fuse 0.32.0 (build 9613)
  • Android SDK build-tools 25.0.0.2
  • JDK jdk1.7.0_79.jdk, jdk1.8.0_74.jdk, jdk1.8.0_77.jdk

I also couldn’t find sdkConfig.json. I could see .sdkconfig (no extension) in /Users/Jason/Library/Application Support/Fusetools/Fuse/Android.
In this file, JDK configuration set to jdk1.7.0_79.jdk.

I tried;

  1. Install the latest version of JDK from Oracle. ( jdk1.8.0_121.jdk)
  2. Delete jdk1.7.0_79.jdk folder.
  3. Run fuse install android.
  4. The installer couldn’t find JDK folder (it’s deleted) and asked to put a new JDK path.
  5. I put the installed JDK path. (/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk).
  6. Installer set the new JDK in the .sdkconfig file.

Finally, I can run the app in Android device.

You can restore the deleted jdk1.7.0_79.