【美妍機房】VN MAKER糾錯


cordova

通過cmd查詢npm update -g cordova,可知版本。VN Maker要求cordova版本需要介於4-10之間,不能大於10,當前我的cordova版本是11.0.0,版本過高

安裝cordova方法:installing Cordova:

You can install the Cordova module by using the Node Package Manager(npm), utility of Node.js. This module will automatically be downloaded from the npm utility of Node.js.

On Windows:

You can run the following command in command prompt to install the Cordova application on Windows:

npm install -g cordova  

This -g flag is responsible for installing the Cordova module globally. Otherwise, it will install Cordova in the node_modules subdirectory of current working directory.

After installing it, you can run cordova on the command line with no arguments. If you want to check the version of cordova, you can simply check it from the below command:

cordova --version  

If you see the version number in the command prompt that means your cordova application is properly installed.

npm uninstall cordova -g 用於卸載現有的cordova
npm install cordova@10.0.0 -g

-g is for global, 安裝了cordova9,後來安裝到了10

Command to remove Cordova and ionic

  • For Window system

  • npm uninstall -g ionic

  • npm uninstall -g cordova

For install cordova and ionic

  • npm install -g cordova

  • npm install -g ionic


COMMAND LINE:

VM506:60 cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0

VM506:60 Failed to fetch plugin https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 via registry.

Probably this is either a connection problem, or plugin spec is incorrect.

Check your connection and plugin name/version/URL.

CordovaError: Error: No git binary found in $PATH


VM506:60 Finished Adding Plugins...

VM506:60 Failed to fetch plugin https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 via registry.

Probably this is either a connection problem, or plugin spec is incorrect.

Check your connection and plugin name/version/URL.

CordovaError: Error: No git binary found in $PATH

更新:已下載git


COMMAND LINE:

VM506:60 cordova create "dd" "com.example.game" "dddd"

VM506:60 'cordova' is not recognized as an internal or external command,

operable program or batch file.


VM506:60 Finished Creating Project...

VM506:60 'cordova' is not recognized as an internal or external command,

operable program or batch file.


VM506:60 COMMAND LINE:

VM506:60 cordova platform add android

VM506:60

VM506:60 COMMAND LINE:

VM506:60 cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0


gradle

cmd查詢gradle -version,錯誤是此構建中使用了已棄用的 Gradle 功能,使其與 Gradle 8.0 不兼容。當前我的gradle是7.5.1,需要升級版本

此部分出問題,gradle和gradle version據說版本需要匹配

android studio

WARNING: com.flyingsoftgames.xapkreader plugin not in android.json. Cannot add license key.


COMMAND LINE:

VM506:60 cordova build android --release --buildConfig build.json

VM506:60 Checking Java JDK and Android SDK versions

android5是lolipop,對應api 21,之前沒有勾選下載

VM506:60 ANDROID_SDK_ROOT=undefined (recommended setting)

ANDROID_HOME=C:\Users\ginyan\AppData\Local\Android\Sdk (DEPRECATED)

已棄用

通過android studio尋找到sdk後,在environment variables中的上方表格添加兩個變量,讓VN maker中識別

VM506:60 Requirements check failed for JDK 1.8.x! Detected version: 11.0.17

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.


VM506:60 Finished Building...

VM506:60 Requirements check failed for JDK 1.8.x! Detected version: 11.0.17

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

SDK(target sdk+ sdk)

sdk manager查詢,我選擇了30,31,32


JDK

已安裝JDK11,用cmd查詢java -version,

Requirements check failed for JDK 1.8.x! Detected version: 11.0.17

Check your ANDROID_SDK_ROOT / JAVA_HOME / PATH environment variables.

請注意 locate the jdk-8u172-windows-x64.exe這個jdk安裝後,其實就是jdk1.8,而不是8!需要在pc-system properties-advanced system settings -environment variable 在下方表格裡添加JAVA_HOME, 沒有bin的文件路徑,再有path,添加有的bin的文件路徑

安裝方法連接

因為vn maker官方指南上寫的jdk7,而且沒有變更過,所以我後來重新又裝了jdk7

Key store

能用java生成或用android studio生成key store,但不知如何使用

版本兼容對比

Java

A Java version between 8 and 18 is required to execute Gradle. Java 19 and later versions are not yet supported. Java 6 and 7 can still be used for compilation and forked test execution. Any supported version of Java can be used for compile or test. For older Gradle versions, please see the table below which Java version is supported by which Gradle release.




​最低版本

​預設版本

​gradle

7.2

7.2

SDK工具

​30.0.3

​30.0.3

​NDK

​無

​21.4.7075

​JDK

​7

​11

​11

cordova-android

​10.X.X

​supported androidAPI-L

​22-30