2016-09-29 76 views
1

我有一个ionic 2.0.0-rc0应用程序,我想构建n个android平台。当我运行 ionic run android时,它在两者之间失败。 StackTrace-由于JDK-9无法使用离子形成android

> [email protected] build /home/raj/ionic/github 
    > ionic-app-scripts build 
    [07:46:11] ionic-app-scripts 0.0.23 
    [07:46:11] build prod started ... 
    [07:46:11] clean started ... 
    [07:46:11] clean finished in 9 ms 
    [07:46:11] copy started ... 
    [07:46:11] ngc started ... 
    [07:46:11] lint started ... 
    [07:46:11] copy finished in 171 ms 
    [07:46:12] lint finished in 960 ms 
    [07:46:26] ngc finished in 15.36 s 
    [07:46:26] bundle prod started ... 
    [07:46:34] bundle prod finished in 8.27 s 
    [07:46:34] sass started ... 
    [07:46:36] sass finished in 1.67 s 
    [07:46:36] minify started ... 
    [07:46:36] cleancss started ... 
    [07:46:36] uglifyjs started ... 
    [07:46:47] uglifyjs finished in 10.80 s 
    [07:46:47] cleancss finished in 10.80 s 
    [07:46:47] minify finished in 10.80 s 
    [07:46:47] build prod finished in 36.12 s 
    Running command: /home/raj/ionic/github/hooks/after_prepare/010_add_platform_class.js /home/raj/ionic/github 

    :CordovaLib:compileDebugJavaWithJavac FAILED 


    FAILURE: Build failed with an exception. 
    Error: /home/raj/ionic/github/platforms/android/gradlew: Command  failed with exit code 1 Error output: 
    FAILURE: Build failed with an exception. 

    * What went wrong: 
    Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'. 
    > Could not create an instance of type com.sun.tools.javac.api.JavacTool. 

我使用genymotion作为模拟器,即使我不认为在这个问题上的问题。这个问题的很多解决方案是设置JAVA_HOME路径。但我已经设置了它, echo $JAVA_HOME > /usr/lib/jvm/java-9-openjdk-amd64。我怀疑这是gradle 2.1java-9 from this的问题。我一直坚持这一段时间,任何帮助将不胜感激。

+0

Android SDK不支持Java 9.降级至8(尚未) – calebeaires

回答

5

愚蠢的我认为这将是一个伟大的想法尝试JDK-9当大 甲骨文警告我不要。删除它并安装JDK-8,问题解决了。 Oracle确实看到了我的未来。

+0

这实际上不是解决方案,因为JDK 9现在是Oracle Java Web站点上的默认下载选项。 – incorelabs

+0

这是因为它现在稳定。我的问题是由于版本不稳定 – raj

+0

但这个答案不再是解决这个问题的方法。 :) – incorelabs

-2
cordova platform update android 
ionic build android 
ionic run android 

尝试运行这些命令。希望这将帮助你:)

+0

其最新的android版本。所以更新不是问题。 – raj

+0

离子建设android给你同样的错误? –

+0

是的。 ''>无法创建com.sun.tools.javac.api.JavacTool.''类型的实例。这是问题。我认为openjdk是一个问题。我正在重新安装它。 – raj

相关问题