ionic android无法打包

突然打不了包了, 很奇怪. 错误信息:

A problem occurred configuring root project 'android'. > Could not find common.jar (android.arch.core:common:1.1.0).   Searched in the following locations:       https://jcenter.bintray.com/android/arch/core/common/1.1.0/common-1.1.0.jar

上网查了下, 说是build.gradle中的依赖不能有"+", 通过查看build.gradle, 抱着试试看的态度,  我将plugin中的插件搜了一遍, 将所有的:

compile 'com.android.support:support-v4:24.1.1+'
compile 'com.android.support:support-v4:+'

改成了:

compile 'com.android.support:support-v4:24.1.1'
compile 'com.android.support:support-v4:'

重新添加平台再次打包果然成功了, 高兴不过三秒发现在安装了crosswalk的情况下, 依然打不了包, 错误信息如下:

Execution failed for task ':processArmv7ReleaseResources'.         > com.android.ide.common.process.ProcessException: Failed to execute aapt
ERROR: In <declare-styleable> FontFamilyFont, unable to find attribute android:font

继续调查,尝试,解决方式如下:

在添加完android平台后, 在build.gradle中最外层添加:

configurations.all {
    resolutionStrategy {
     force 'com.android.support:support-v4:24+'
    }
}

这个版本与我的项目使用的android sdk版本有关. 可是新的问题出现了, 这样修改无法做到自动化构建,打包. 因为每次添加完平台后, 都要手动修改配置文件. 

最后还是从crosswalk入手, 找到了另一种解决方案:

添加插件: 

cordova plugin add cordova-android-support-gradle-release  --variable ANDROID_SUPPORT_VERSION=25.+
重新添加平台后打包成功.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值