我尝试第一次编译一个ionic android应用程序,但是cordova无法编译,我找不到原因!
但是当我run ionic cordova build android --verbose
或ionic cordova build android --verbose
时,命令失败并显示以下错误:
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Android Studio project detected
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /var/ionic/cauterets/platforms/android/app/src/main/res/xml/config.xml
Merging project's config.xml into platform-specific android config.xml
Merging and updating files from [www, platforms/android/platform_www] to platforms/android/app/src/main/assets/www
Wrote out android application name "MyApp" to /var/ionic/cauterets/platforms/android/app/src/main/res/values/strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (0.0.1): 1
Wrote out Android package name "io.ionic.starter" to /var/ionic/cauterets/platforms/android/app/src/main/java/io/ionic/starter/MainActivity.java
Updating icons at platforms/android/app/src/main/res
Updating splash screens at platforms/android/app/src/main/res
This app does not have additional resource files defined
Prepared android project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
ANDROID_HOME=/home/agenceho5/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64
Requirements check failed for JDK 1.8
CordovaError: Requirements check failed for JDK 1.8
at /var/ionic/cauterets/platforms/android/cordova/lib/check_reqs.js:362:19
at _fulfilled (/var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (/var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (/var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:796:13)
at /var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:604:44
at runSingle (/var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:137:13)
at flush (/var/ionic/cauterets/platforms/android/cordova/node_modules/q/q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:131:7)
at process._tickCallback (internal/process/next_tick.js:180:9)
问题出在哪里? 先谢谢了
编辑:我也尝试过使用openjdk-8,但我遇到的错误完全相同