Bug P3
Status Update
Comments
ja...@google.com <ja...@google.com> #2
Do you have a repro project that you could share with us?
There should be no need to excluding any dependencies: we automatically remove them from the test APK if they are in the main APK.
There should be no need to excluding any dependencies: we automatically remove them from the test APK if they are in the main APK.
la...@gmail.com <la...@gmail.com> #3
Workaround: Override the declarations in your own androidTest AndroidManifest.xml, for example:
<!-- TODO remove once androidx.test has explicit android:exported -->
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity"
android:theme="@android:style/Theme"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:theme="@android:style/Theme"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:theme="@android:style/Theme.Dialog"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
ae...@google.com <ae...@google.com> #4
This bug has not been updated in the last year. Please reopen if we still need to look into this.
Description
* Are you an Android developer?
Y
* Which Android Developer Preview build are you using?
SPP1.210122.020.A3
* Is this a regression from Android 11 to 12?
Y
* What device are you using? (for example, Pixel 4 XL)
Emulator
* What are the steps to reproduce the problem? (Please provide the minimal reproducible test case.)
1. Open Android Studio
2. Either open the attached project or create a new project with the "Empty activity" template and add `android:exported="true"` to the activity
4. Right-click the instrumentation tests and run then against the Android S DP1 device/emulator
* Issue Category
Framework
* What was the expected result?
Instrumentation tests run
* What was the actual result?
The instrumentation tests failed to install and run on the device with the following error:
* Relevant logcat output.
2021-03-09 07:43:15.568 512-609/? W/AppIntegrityManagerServiceImpl: Exception reading file:///data/app/vmdl1115982547.tmp
android.content.pm.PackageParser$PackageParserException: /data/app/vmdl1115982547.tmp/base.apk (at Binary XML file line #21): androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity: Targeting S+ (version 10000 and above) requires that an explicit value for android:exported be defined when intent filters are present
at com.android.server.pm.parsing.PackageParser2.parsePackage(PackageParser2.java:155)
at com.android.server.integrity.AppIntegrityManagerServiceImpl.getPackageArchiveInfo(AppIntegrityManagerServiceImpl.java:579)
at com.android.server.integrity.AppIntegrityManagerServiceImpl.handleIntegrityVerification(AppIntegrityManagerServiceImpl.java:297)
at com.android.server.integrity.AppIntegrityManagerServiceImpl.access$100(AppIntegrityManagerServiceImpl.java:97)
at com.android.server.integrity.AppIntegrityManagerServiceImpl$1.lambda$onReceive$0$AppIntegrityManagerServiceImpl$1(AppIntegrityManagerServiceImpl.java:180)
at com.android.server.integrity.-$$Lambda$AppIntegrityManagerServiceImpl$1$D-6BanMaetK6OzqqHwb9xKEKfbs.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
2021-03-09 07:43:15.568 512-609/? W/AppIntegrityManagerServiceImpl: Cannot parse package com.example.instrumentationtest.test
* Link to captured Android bug report (shared privately in Drive.)