简体   繁体   中英

success Build release APK but cant install

D:\06 ANDROID\hwacademy2 - Copy\www>Ionic build android --release
Running command: "C:\Program Files\nodejs\node.exe" "D:\06 ANDROID\hwacademy2 - Copy\hooks\after_prepare\010_add_platform_class.js" "D:\06 ANDROID\hwacademy2 - Copy"

add to body class: platform-android

Running command: cmd "/s /c ""D:\06 ANDROID\hwacademy2 - Copy\platforms\android\cordova\build.bat" --release""

ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_102

Running: D:\06 ANDROID\hwacademy2 - Copy\platforms\android\gradlew cdvBuildRelease -b D:\06 ANDROID\hwacademy2 - Copy\platforms\android\build.gradle -Dorg.gradle.daemon=true

:preBuild


:preReleaseBuild
:checkReleaseManifest


:CordovaLib:compileLint


:CordovaLib:copyReleaseLint

UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles

UP-TO-DATE


:CordovaLib:preBuild


:CordovaLib:preReleaseBuild
:CordovaLib:checkReleaseManifest


:CordovaLib:prepareReleaseDependencies


:CordovaLib:compileReleaseAidl

UP-TO-DATE

:CordovaLib:compileReleaseRenderscript

UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig

UP-TO-DATE

:CordovaLib:generateReleaseAssets UP-TO-DATE

:CordovaLib:mergeReleaseAssets

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

:CordovaLib:processReleaseManifest
 UP-TO-DATE

:CordovaLib:processReleaseResources
 UP-TO-DATE

:CordovaLib:generateReleaseSources
 UP-TO-DATE
:CordovaLib:compileReleaseJava
 UP-TO-DATE

:CordovaLib:processReleaseJavaRes
 UP-TO-DATE

:CordovaLib:packageReleaseJar
 UP-TO-DATE

:CordovaLib:compileReleaseNdk
 UP-TO-DATE

:CordovaLib:packageReleaseJniLibs
 UP-TO-DATE

:CordovaLib:packageReleaseLocalJar

UP-TO-DATE
:CordovaLib:packageReleaseRenderscript

UP-TO-DATE

:CordovaLib:bundleRelease

UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedReleaseLibrary

UP-TO-DATE
:preDebugBuild


:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles

UP-TO-DATE
:CordovaLib:preDebugBuild

:CordovaLib:checkDebugManifest


:CordovaLib:prepareDebugDependencies


:CordovaLib:compileDebugAidl

UP-TO-DATE

:CordovaLib:compileDebugRenderscript

UP-TO-DATE
:CordovaLib:generateDebugBuildConfig

UP-TO-DATE
:CordovaLib:generateDebugAssets
 UP-TO-DATE
:CordovaLib:mergeDebugAssets
 UP-TO-DATE

:CordovaLib:generateDebugResValues

UP-TO-DATE

:CordovaLib:generateDebugResources UP-TO-DATE

:CordovaLib:packageDebugResources

UP-TO-DATE
:CordovaLib:processDebugManifest
 UP-TO-DATE

:CordovaLib:processDebugResources

UP-TO-DATE

:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava
 UP-TO-DATE

:CordovaLib:processDebugJavaRes
 UP-TO-DATE

:CordovaLib:packageDebugJar

UP-TO-DATE
:CordovaLib:compileDebugNdk
 UP-TO-DATE


:CordovaLib:packageDebugJniLibs
 UP-TO-DATE

:CordovaLib:packageDebugLocalJar

UP-TO-DATE

:CordovaLib:packageDebugRenderscript
 UP-TO-DATE


:CordovaLib:bundleDebug
 UP-TO-DATE

:prepareComAndroidSupportSupportV132340Library
 UP-TO-DATE

:prepareComAndroidSupportSupportV42400Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesBase961Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesBasement961Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesGcm961Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesIid961Library
 UP-TO-DATE

:prepareComGoogleAndroidGmsPlayServicesTasks961Library
 UP-TO-DATE

:prepareReleaseDependencies


:compileReleaseAidl
 UP-TO-DATE

:compileReleaseRenderscript
 UP-TO-DATE

:generateReleaseBuildConfig
 UP-TO-DATE

:generateReleaseAssets
 UP-TO-DATE

:mergeReleaseAssets

UP-TO-DATE
:generateReleaseResValues
 UP-TO-DATE

:generateReleaseResources

UP-TO-DATE

:mergeReleaseResources


:processReleaseManifest
 UP-TO-DATE

:processReleaseResources


:generateReleaseSources

:compileReleaseJava
 UP-TO-DATE

:lintVitalRelease


:compileReleaseNdk
 UP-TO-DATE

:preDexRelease
 UP-TO-DATE

:dexRelease
 UP-TO-DATE

:processReleaseJavaRes
 UP-TO-DATE

:packageRelease


:assembleRelease

:cdvBuildRelease



BUILD SUCCESSFUL


Total time: 10.174 secs

Built the following apk(s):

    D:\06 ANDROID\hwacademy2 - Copy\platforms\android\build\outputs\apk\android-release-unsigned.apk


D:\06 ANDROID\hwacademy2 - Copy\www>

what miss about me :( ? this firts i build apk . someone help me please.

You can install and see the debug version of the App using the command :

ionic cordova build android ( ie. without the Release flag --release )

If you want to install and see the Release version of your App, then you need to sign your App using a Key.

Step 1 : Generate your Private Key ( if you have one, then discard this step ) :

keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias

Step 2 : Sign your APK

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.jks android-release-unsigned.apk my-alias

Step 3 : Optimize your Apk using Zipalign

zipalign -v 4 android-release-unsigned.apk HelloWorld.apk

Refer this Link : https://ionicframework.com/docs/intro/deploying/ (Android Section)

The generate APK is unsigned (app-release-unsigned.apk). You can only install an unsigned APK on a emulator not a physical device.

BUILD SUCCESSFUL

This means that the APK has built, it will be located here:

Copy\platforms\android\build\outputs\apk\android-release-unsigned.apk

then to install run this through terminal (if mac):

adb install PASTEHEREYOURPATH.apk

The generate APK is unsigned (app-release-unsigned.apk). You can only install an unsigned APK on a emulator not a physical device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM