在动态模块中使用样式时出错-Android应用程序包
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了在动态模块中使用样式时出错-Android应用程序包,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2018字,纯文字阅读大概需要3分钟。
内容图文
![在动态模块中使用样式时出错-Android应用程序包](/upload/InfoBanner/zyjiaocheng/650/102a166d48e3448cbf0100c4358f8ca9.jpg)
我正在使用应用程序包-我的Android应用程序中的动态模块.在项目中,我有一个主模块和一个子模块.在子模块的值中-> styles.xml,我定义了自定义样式,以使一些动画可以活动.
<style name="SampleActivityTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="buttonStyle">@style/CustomButtonStyle</item>
<item name="android:windowContentTransitions">true</item>
<item name="android:windowActivityTransitions">true</item>
<item name="android:windowEnterTransition">@transition/activity_transition_note</item>
<item name="android:windowExitTransition">@transition/activity_transition_note</item>
<item name="android:windowSharedElementEnterTransition">@android:transition/move</item>
<item name="android:windowSharedElementExitTransition">@android:transition/move</item>
</style>
在清单中,我正在使用主题属性使用这种样式,
<activity
android:name=".activity.SampleActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|locale"
android:label=""
android:screenOrientation="portrait"
android:theme="@style/SampleActivityTheme">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
但是当我构建项目时,出现如下所示的编译错误,
/Users/chathura/Branches/AppBundle/sample_module/build/intermediates/merged_manifests/debug/AndroidManifest.xml:778: error: resource style/SampleActivityTheme (aka lk.sample.mysampleapp:style/SampleActivityTheme) not found.
这个问题的原因是什么?
任何建议表示赞赏.
谢谢.
解决方法:
目前,Android Gradle插件不支持从清单中的动态功能中引用资源.
原因之一是所有动态特征的清单都合并在基本模块的清单中,并且基本模块不应依赖于动态特征.
如果您在基础中定义样式,则应该对其进行修复.
资源:
从https://developer.android.com/studio/projects/dynamic-delivery
The manifest for your app’s base module is similar to that of any
other app module. Keep in mind, when Google Play generates your app’s
base APK, it merges manifests for all modules into that of the base
APK.
内容总结
以上是互联网集市为您收集整理的在动态模块中使用样式时出错-Android应用程序包全部内容,希望文章能够帮你解决在动态模块中使用样式时出错-Android应用程序包所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。