Android studio打包apk遇到的问题

问题一、Android studio 生成apk文件时的 key store path 的问题

使用Android studio生成apk文件时,Key store path 是密钥库文件地址的意思,新手菜鸟会想,我怎么知道他在哪里,其实他的地址是你来决定的。如下图,你选择一个文件夹后,填写file name,然后点击ok就生成了

用户密码:

app->build.gradle-->signingConfigs {config

问题二、Errors while building APK. You can find the errors in the 'Messages' view.解决办法

当你出现这种情况,有两种解决办法:(都是在build.gradle中修改)

android{
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

 aaptOptions.cruncherEnabled = false
 aaptOptions.useNewCruncher = false

问题三:A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkA

报错内容如下:

Error:There were multiple failures while executing work items

Error:Execution failed for task ':app:mergeDebugResources'.There were multiple failures while executing work items
A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_storage_24dp.xml : Can't process attribute android:fillColor="@color/color_storage": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.
A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_device_24dp.xml : Can't process attribute android:fillColor="@color/color_device": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.
A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction

这个bug解决起来也比较简单,在你的app的build.gradle的defaultConfig中添加如下的代码就可以了:

defaultConfig{  
   vectorDrawables.useSupportLibrary = true  
}  

添加完 vectorDrawables.useSupportLibrary = true这行代码之后,gradle一下就可以了。

如果本文对您有所帮助,麻烦点击一下下面的点赞按钮,谢谢

1、所有文章未经授权禁止转载、摘编、复制或建立镜像,如有违反,追究法律责任。
2、本站文章部分来源注册用户发布或互联网收集而来,若有侵权,请邮件联系作者。
邮箱地址:wtao219@qq.com
THE END
分享
二维码
< <上一篇
下一篇>>