gpt4 book ai didi

android - 具有自定义 View 的不同 packageNameSuffix

转载 作者:行者123 更新时间:2023-11-29 21:10:12 24 4
gpt4 key购买 nike

我想知道在使用不同的 packageNameSuffix 值时如何正确包含自定义 View 。

build.gradle:

buildTypes {
release {
packageNameSuffix ".release"
}

debug {
packageNameSuffix ".debug"
}
}

View .xml

<com.example.app.widget.View
xmlns:ex="http://schemas.android.com/apk/res/com.example.app"
android:id="@+id/id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
ex:param1="100"
ex:param2="200"
/>

添加自定义后缀后 Gradle 构建错误

Error:(114) No resource identifier found for attribute 'param1' in package 'com.example.app'
Error:(114) No resource identifier found for attribute 'param2' in package 'com.example.app'

最佳答案

如果你想在其中使用你的包名,我不知道如何解决这个问题,但如果你将命名空间替换为“http://schemas.android.com/apk/res-auto”,它应该可以正常工作

关于android - 具有自定义 View 的不同 packageNameSuffix,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23154749/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com