如何避免在Android 12中出现导出数值错误

huangapple go评论62阅读模式
英文:

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=&quot;false&quot; 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 &quot;androidx.test:core:1.5.0&quot;

huangapple
  • 本文由 发表于 2023年4月6日 19:42:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949126.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定