Reputation: 856
When I use the command: cordova build --release android
the CLI throws the following error:
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.
Note that it is not generating android-release-unsigned.apk
My questions are:
1: What is wrong with the CLI ??
2: can I use the android-debug-unaligned.apk
for Signing (with jarsigner
) and Aligning (with zipalign
) for submitting on Google Play ??
Please advice.
Upvotes: 3
Views: 2390
Reputation: 1224
Nothing went wrong with IONIC CLI at this time (v1.7.6), because I'm using it every day.
ionic --version
and see if your version is lower than 1.7.6
.npm install -g ionic
again to install the lasted version of 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. But I think you can set the debug mode
in your AndroidManifest.xml
to false and try like this:
android:debuggable="false"
to the <application>
element.Ionic also provide a package cloud service very helpful for non-plugin project inside the Ionic CLI. It can build all your project in the cloud in a minute and you can download the apk anytime.
ionic package build android
an wait for the progress to done.ionic package list
to get the list and see the status if it has been done the building progress.ionic package download [id]
to download your apk to your project folder. id
is the number you see in the list
.profile
(keystore).Upvotes: 3