我第一次尝试离子。我对iOS没有任何问题,但为Android构建演示应用程序会给我一个错误,几乎没有任何信息(见下文)。在我看来,问题在于Cordova附带的gradle配置文件,但我不认为如果你可以避免使用Cordova来编辑特定于平台的文件,这被认为是一种很好的做法。
[myApp]Bro? ionic build android Running command: /Users/x/Documents/Dev/myApp/hooks/after_prepare/010_add_platform_class.js /Users/x/Documents/Dev/myApp add to body class: platform-android Running command: /Users/x/Documents/Dev/myApp/platforms/android/cordova/build ANDROID_HOME=/Users/x/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home Running: /Users/x/Documents/Dev/myApp/platforms/android/gradlew cdvBuildDebug -b /Users/x/Documents/Dev/myApp/platforms/android/build.gradle -Dorg.gradle.daemon=true FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'android'. > A problem occurred configuring project ':CordovaLib'. > Failed to notify project evaluation listener. > java.lang.ExceptionInInitializerError (no error message) * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED
答案 0 :(得分:0)
看看堆栈跟踪,很明显我的Java XPath和XQuery库(Saxon)存在问题。原来我从JDK 7迁移到JDK 8后没有更新该库,而JDK 8与我安装的版本不兼容。看起来Android版本使用相同的插件来解析AndroidManifest.xml。
简短回答 - 查看堆栈跟踪。也许它也与过时的Java库有关。