Open bobowg opened 1 year ago
解决方案添加一个DEDUG文件侠,把AndroidManifest.xml 复制一份到degug里,添加 <activity android:name="androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity" android:exported="false" android:theme="@android:style/Theme">
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity"
android:exported="false"
android:theme="@android:style/Theme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity"
android:exported="false"
android:theme="@android:style/Theme.Dialog">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
到元素到application元素里重新测试即可成功!
androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity 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