英文:
How to avoid the exported value error in Android 12
问题
我看到在生成APK时出现了以下问题。奇怪的是这个问题发生在androidTest文件夹下。此外,我已经在每个activity标签下添加了android:exported="false"
标签。
/Users/userName/projectXYZ/build/intermediates/tmp/manifest/androidTest/qual/debug/tempFile1ProcessTestManifest4615853503946390592.xml:27:9-33:20 错误:
对于元素<activity#androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity>,android:exported需要明确指定。针对 Android 12 及更高版本的应用程序,必须为与意图过滤器定义相关的组件指定明确的值'android:exported'。有关详细信息,请参阅https://developer.android.com/guide/topics/manifest/activity-element#exported。
英文:
I am seeing the below issue on generating the APK. its strange that the issue is occurring under the androidTest folder. also I have added the tag as android:exported="false"
under each activity tag
> /Users/userName/projectXYZ/build/intermediates/tmp/manifest/androidTest/qual/debug/tempFile1ProcessTestManifest4615853503946390592.xml:27:9-33:20 Error:
>
> android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for 'android:exported' when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
答案1
得分: 1
你没有编写 androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity
。这是来自一个库的内容。确保你使用的 androidx.test:core
版本是最新的,比如:
implementation "androidx.test:core:1.5.0"
英文:
You did not write androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity
. That is coming from a library. Make sure you are on an up-to-date version of androidx.test:core
, such as:
implementation "androidx.test:core:1.5.0"
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论