ionic3打包apk

Ionic3打包

我打包的时候遇到的问题全部都是版本不兼容的问题,没有这个问题的小婊贝们就可以直接退出啦~

 

ionic cordova build android --release
(遇到的问题:

1.报错read ECONNREST 回退ionic版本 将4版本降为3.5.0
2.报错env.runcmd is not a funtion 回退cli版本

npm install @ionic/cli-plugin-cordova@1.4.0

再报错 就cnpm install @ionic/cli-plugin-cordova@1.4.0


3.报错 A problem occurred configuring project ':CordovaLib'.
> Could not resolve all files for configuration ':CordovaLib:classpath'.
打开“工程名/platforms/android/CordovaLib”目录下的build.gradle文件,注释掉buildscript中的dependencies中的classpath 'com.android.tools.build:gradle:3.0.1'

4.报错Execution failed for task ':app:processDebugManifest' 

 整个错误是这样的

 Execution failed for task ':app:processDebugManifest'.

        > Manifest merger failed : uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library

        [:CordovaLib]ted ...

        E:\Baosight\ionic3\platforms\android\CordovaLib\build\intermediates\manifests\full\debug\AndroidManifest.xml as

        the library might be using APIs not available in 16

        Suggestion: use a compatible library with a minSdk of at most 16,

        or increase this project's minSdk version to at least 19,

        or use tools:overrideLibrary="org.apache.cordova" to force usage

 

搜索minSdkVersion 将其版本号全部改为19

 

然后终于打包成功了~鸡冻

 

然后是签名文件的问题了

ionic3的release版本在手机上是不能安装的,debug版本可以

第一步:

keytool -genkey -alias demo.keystore -keyalg RSA -validity 40000 -keystore demo.keystore

这一步应该是不需要的 。。

 

第二步:

keytool -genkey -alias xxq -keyalg RSA -validity 40000 -keystore demo.keystore

1.在platforms\android目录新建名为release-signing.properties的文件

文件内容如下

storeFile=demo.keystore       //密钥库位置

keyAlias=xxq    //别名  ,一定要和第一步别名一样

storePassword=12121p

keyPassword=12121p

2.把上一步生成的demo.keysrore  移动到 platforms\android

第二步借鉴的是这个大佬的https://www.jianshu.com/p/2f93116e7e8e


第三步:

 

jarsigner -verbose -keystore ./demo.keystore -signedjar demo_signed.apk app-release-unsigned.apk demo.keystore

 

PS:  ./demo.keystore为之前生成的证书 

app-release-unsigned.apk  demo.keystore都放在项目目录文件下 ./为路径

 

最后

ionic cordova build android --release

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值