Linux中的离子android构建问题

时间:2016-08-27 06:45:58

标签: android cordova ionic-framework ionic2

我已成功安装cordova v6.3.1, ionic v2.0.0Android Studio

操作系统:Virtualbox(Xubuntu)

当我运行ionic build android

我得到以下错误:

BUILD FAILED

Total time: 7.749 secs

Error: /var/lib/mymachine/ionic-01/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:2.1.0.
     Required by:
         :android:unspecified
      > Could not resolve com.android.tools.build:gradle:2.1.0.
         > Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
      > Could not resolve com.android.tools.build:gradle:2.1.0.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
            > org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)

很少有帖子建议安装Android支持存储库和Google Repository。我安装了它。但我仍面临着面部问题。

enter image description here

1 个答案:

答案 0 :(得分:0)

我遇到了类似的问题。在我的情况下,它是使用gradle的简单java webapp。这个项目使用java 6.我的java 6安装不正确。这就是我遇到以下问题的原因。

enter image description here

gradle无法找到 /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts

这是另一个不存在的文件的符号链接。

所以我删除了我的jdk并重新安装了它。这解决了这个问题。