[TA综合] 打包Android报错 Library Project里面的 BuildConfig.DEBUG永远都是false

查看:539 |回复:1 | 2022-2-8 11:12:28

您需要 登录 才可以下载或查看,没有账号?注册

x
Library Project里面的 BuildConfig.DEBUG永远都是false 。这是Android Studio的一个已知问题,某Google的攻城狮说,Library projects目前只会生成release的包。

Issue 52962: https://code.google.com/p/android/issues/detail?id=52962

解决方法: (某Google的攻城狮推荐的方法)

Workaround: instaed of BuildConfig.DEBUG create another boolean variable at lib-project's e.g. BuildConfig.RELEASE and link it with application's buildType.

https://gist.github.com/almozavr/d59e770d2a6386061fcb

参考stackoverflow 上的这篇帖:

http://stackoverflow.com/questions/20176284/buildconfig-debug-always-false-when-building-library-projects-with-gradle

2022-2-8 11:12:28  
 赞 赞 0

使用道具 登录

1个回答,把该问题分享到群,邀请大神一起回答。
2#
回复 收起回复
2023-3-1 11:04:43   回复
 赞 赞 0

使用道具 登录

CG 游戏行业专业问题

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表