[英]Ionic CLI not generating release build for Android
When I use the command: cordova build --release android
the CLI throws the following error: 当我使用命令:
cordova build --release android
,CLI会抛出以下错误:
Error: Cannot find module 'minimatch'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (C:\Users\sologic\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\glob\glob.js:44:17)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
But when I use Ionic Lab (Windows Installer) and using the Build
option - it generates ' android-debug.apk
' & ' android-debug-unaligned.apk
' in the android\\build\\outputs\\apk
folder. 但是当我使用Ionic Lab(Windows Installer)并使用
Build
选项时 - 它会在android\\build\\outputs\\apk
文件夹中生成' android-debug.apk
'和' android-debug-unaligned.apk
android-debug.apk
'。
Note that it is not generating android-release-unsigned.apk
请注意,它不会生成
android-release-unsigned.apk
My questions are: 我的问题是:
1: What is wrong with the CLI ?? 1:CLI有什么问题?
2: can I use the android-debug-unaligned.apk
for Signing (with jarsigner
) and Aligning (with zipalign
) for submitting on Google Play ?? 2:我可以使用
android-debug-unaligned.apk
进行签名(使用jarsigner
)和zipalign
(使用zipalign
)在Google Play上提交?
Please advice. 请指教。
Nothing went wrong with IONIC CLI at this time (v1.7.6), because I'm using it every day. IONIC CLI此时没有出错(v1.7.6),因为我每天都在使用它。
ionic --version
and see if your version is lower than 1.7.6
. ionic --version
检查您的CLI版本,看看您的版本是否低于1.7.6
。 npm install -g ionic
again to install the lasted version of Ionic CLI. npm install -g ionic
再次运行npm install -g ionic
以安装Ionic CLI的持续版本。 ionic start appName blank
ionic platform add android
ionic build android --release
You can't use the debug apk for Google Play because they can read your APK and check if is is debug or release version. 您不能将调试apk用于Google Play,因为他们可以阅读您的APK并检查是否是调试版或发布版。 But I think you can set the
debug mode
in your AndroidManifest.xml
to false and try like this: 但我认为您可以将
AndroidManifest.xml
的debug mode
设置为false并尝试这样:
android:debuggable="false"
to the <application>
element. android:debuggable="false"
到<application>
元素。 Ionic also provide a package cloud service very helpful for non-plugin project inside the Ionic CLI. Ionic还提供了一个包云服务,非常有助于Ionic CLI中的非插件项目。 It can build all your project in the cloud in a minute and you can download the apk anytime.
它可以在一分钟内在云中构建您的所有项目,您可以随时下载apk。
ionic package build android
an wait for the progress to done. ionic package build android
等待进度完成。 ionic package list
to get the list and see the status if it has been done the building progress. ionic package list
以获取列表,并查看已完成构建进度的状态。 ionic package download [id]
to download your apk to your project folder. ionic package download [id]
将你的apk下载到你的项目文件夹。 id
is the number you see in the list
. id
是您在list
看到的数字。 profile
(keystore). profile
(密钥库)进行构建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.