我创建了一个密钥库文件。
在平台/安卓文件夹中
创建了一个ant.propeties
文件更新了我的项目:
android update project -p /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android
运行以下命令以创建我的 Android 应用程序的发布版本:
cordova build android
ant release
运行以下命令后,它将返回:
[abiswas@localhost android]$ ant release
Buildfile: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/build.xml
-set-mode-check:
-set-release-mode:
-release-obfuscation-check:
[echo] proguard.config is ${proguard.config}
-pre-build:
-check-env:
[checkenv] Android SDK Tools Revision 24.4.1
[checkenv] Installed at /opt/adt-bundle-linux-x86_64-20140702/sdk
-setup:
[echo] Project Name: com.personal.rockstarpopstar
[gettype] Project Type: Application
-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
[echo] Resolving Build Target for com.personal.rockstarpopstar...
[gettarget] Project Target: Android 5.1.1
[gettarget] API level: 22
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/libs
[mkdir] Created dir: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/bin/rsObj
[mkdir] Created dir: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/bin/rsLibs
[mkdir] Created dir: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/bin/classes
[mkdir] Created dir: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for com.personal.rockstarpopstar...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'release'...
BUILD FAILED
/opt/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:597: Invalid file: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/CordovaLib/build.xml
Total time: 1 second
[abiswas@localhost android]$ ant debug -f "/home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/build.xml"
Buildfile: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 24.4.1
[checkenv] Installed at /opt/adt-bundle-linux-x86_64-20140702/sdk
-setup:
[echo] Project Name: com.personal.rockstarpopstar
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 22.0.1
[echo] Resolving Build Target for com.personal.rockstarpopstar...
[gettarget] Project Target: Android 5.1.1
[gettarget] API level: 22
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for com.personal.rockstarpopstar...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
BUILD FAILED
/opt/adt-bundle-linux-x86_64-20140702/sdk/tools/ant/build.xml:597: Invalid file: /home/abiswas/workspace/rockstarpopstarAppFolder/platforms/android/CordovaLib/build.xml
Total time: 1 second
无法构建发布版本以在 Play 商店中上传应用。
打开命令提示符并键入
android update project -p your_project_follder_path/platforms/android/CordovaLib
现在关闭并打开命令提示符,然后转到项目下的平台/android并运行ant发布
它对我有用!