ionic打包apk时报错No resource identifier found for attribute ‘appComponentFactory‘ in package ‘android‘

运行打包apk的指令ionic cordova run android,报错No resource identifier found for attribute 'appComponentFactory' in package 'android'

我的解决方法:

①在安卓平台中./platforms/android/build.gradle文件内,查找到allprojects,在它下面增加:

configurations.all { 

   resolutionStrategy.force 'com.android.support:support-v4:24.0.0' 

}

②再在android {.....}的第一行,添加下面两行代码:

aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false

表示禁用gradle对png文件的格式检查。

这样一番操作之后,成功打包!

ionic打包apk时报错No resource identifier found for attribute ‘appComponentFactory‘ in package ‘android‘_第1张图片

参考文章:https://blog.csdn.net/u011799045/article/details/88220695

https://daqiang.blog.csdn.net/article/details/84024966

你可能感兴趣的:(前端开发,Ionic,vs,code)