Apk builded But could not install


#1

Hi,
i use “ionic cordova build android --prod --release” for build app and its build it but app can not install

$ ionic cordova build android --prod --release
Running app-scripts build: --prod --platform android --target cordova
[20:39:13] build prod started …
[20:39:13] clean started …
[20:39:13] clean finished in 6 ms
[20:39:13] copy started …
[20:39:13] deeplinks started …
[20:39:13] deeplinks finished in 28 ms
[20:39:13] ngc started …
[20:39:24] ngc finished in 11.43 s
[20:39:24] preprocess started …
[20:39:24] preprocess finished in 1 ms
[20:39:24] webpack started …
[20:39:25] copy finished in 11.94 s
[20:39:57] webpack finished in 32.19 s
[20:39:57] uglify started …
[20:39:57] sass started …
Without from option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to undefined to prevent this warning.
[20:39:58] sass finished in 1.75 s
[20:39:58] cleancss started …
[20:40:02] cleancss finished in 3.09 s
[20:40:14] uglify finished in 17.66 s
[20:40:14] postprocess started …
[20:40:14] postprocess finished in 19 ms
[20:40:14] lint started …
[20:40:14] build prod finished in 61.57 s

cordova build android --release
Android Studio project detected

ANDROID_HOME=C:\Users\MyGirlFriend\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_161
studio
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
[20:40:21] lint finished in 6.52 s
Checking the license for package Android SDK Platform 26 in C:\Users\MyGirlFriend\AppData\Local\Android\sdk\licenses
License for package Android SDK Platform 26 accepted.
Preparing “Install Android SDK Platform 26 (revision: 2)”.
“Install Android SDK Platform 26 (revision: 2)” ready.
Installing Android SDK Platform 26 in C:\Users\MyGirlFriend\AppData\Local\Android\sdk\platforms\android-26

“Install Android SDK Platform 26 (revision: 2)” complete.
“Install Android SDK Platform 26 (revision: 2)” finished.

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_e9pydbtexp2zxnonvw7r2slty.run(F:\jenyar\App\ionic\myApp\platforms\android\app\build.gradle:143)
:CordovaLib:preBuild
UP-TO-DATE
:CordovaLib:preReleaseBuild
UP-TO-DATE
:CordovaLib:compileReleaseAidl

UP-TO-DATE
:CordovaLib:compileReleaseRenderscript
UP-TO-DATE
:CordovaLib:checkReleaseManifest
UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE

:CordovaLib:prepareLintJar
UP-TO-DATE
:CordovaLib:generateReleaseResValues
UP-TO-DATE
:CordovaLib:generateReleaseResources
UP-TO-DATE
:CordovaLib:packageReleaseResources
UP-TO-DATE
:CordovaLib:platformAttrExtractor

UP-TO-DATE
:CordovaLib:processReleaseManifest

UP-TO-DATE
:CordovaLib:processReleaseResources

UP-TO-DATE
:CordovaLib:generateReleaseSources

UP-TO-DATE
:CordovaLib:javaPreCompileRelease

UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac

UP-TO-DATE
:CordovaLib:processReleaseJavaRes
NO-SOURCE
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForRelease

UP-TO-DATE
:app:preBuild
UP-TO-DATE
:app:preReleaseBuild

UP-TO-DATE
:app:compileReleaseAidl

UP-TO-DATE
:CordovaLib:packageReleaseRenderscript

NO-SOURCE

:app:compileReleaseRenderscript

UP-TO-DATE
:app:checkReleaseManifest

UP-TO-DATE
:app:generateReleaseBuildConfig

UP-TO-DATE
:app:prepareLintJar

UP-TO-DATE
:app:generateReleaseResValues
UP-TO-DATE
:app:generateReleaseResources
UP-TO-DATE

:app:mergeReleaseResources

UP-TO-DATE
:app:createReleaseCompatibleScreenManifests

UP-TO-DATE
:app:processReleaseManifest

UP-TO-DATE
:app:splitsDiscoveryTaskRelease
UP-TO-DATE

:app:processReleaseResources
UP-TO-DATE
:app:generateReleaseSources

UP-TO-DATE
:app:javaPreCompileRelease

UP-TO-DATE
:app:compileReleaseJavaWithJavac

UP-TO-DATE
:app:compileReleaseNdk

NO-SOURCE
:app:compileReleaseSources

UP-TO-DATE
:CordovaLib:mergeReleaseShaders

UP-TO-DATE
:CordovaLib:compileReleaseShaders

UP-TO-DATE
:CordovaLib:generateReleaseAssets

UP-TO-DATE
:CordovaLib:mergeReleaseAssets

UP-TO-DATE
:app:mergeReleaseShaders

UP-TO-DATE
:app:compileReleaseShaders
UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets
UP-TO-DATE
:app:transformClassesWithStackFramesFixerForRelease
UP-TO-DATE
:app:transformClassesWithDesugarForRelease
UP-TO-DATE

:app:transformClassesWithPreDexForRelease
UP-TO-DATE
:app:transformDexWithDexForRelease
UP-TO-DATE
:CordovaLib:compileReleaseNdk

NO-SOURCE
:CordovaLib:mergeReleaseJniLibFolders

UP-TO-DATE
:CordovaLib:transformNativeLibsWithMergeJniLibsForRelease
UP-TO-DATE
:CordovaLib:transformNativeLibsWithIntermediateJniLibsForRelease

UP-TO-DATE
:app:mergeReleaseJniLibFolders
UP-TO-DATE
:app:transformNativeLibsWithMergeJniLibsForRelease
UP-TO-DATE
:app:processReleaseJavaRes
NO-SOURCE
:app:transformResourcesWithMergeJavaResForRelease

UP-TO-DATE
:app:packageRelease
UP-TO-DATE
:app:lintVitalRelease

:app:assembleRelease

:app:cdvBuildRelease

BUILD SUCCESSFUL in 7m 29s
45 actionable tasks: 1 executed, 44 up-to-date
Built the following apk(s):
F:\jenyar\App\ionic\myApp\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk


#2

Did you sign the app before trying to run it…?

I spent way to long trying to debug an release app that would not run, only to find I had forgotten to sign it…


#3

Hi. If you used --release tag. Then you have to sign your app.
If you dont sign it remove --release.
And just do

ionic cordova build android --prod

#4

if have signed the app and built successfully then still couldn’t install means uninstall the previous app if any in your real device.


#5

Hi@ebeliejinfren
If you want to install the debug build on your device you should remove the --release from the
command. Use only --prod

ionic cordova build android
  or
ionic cordova build android --prod