升级Compose后生成签名APK/Bundle遇‘应用未安装’问题及解决
签名APK/Bundle安装失败“应用未安装”问题排查与解决
问题背景
为修复Compose中TextField失效问题,升级了Compose版本,随后因兼容性报错将Java版本从1.8升级至11。但通过Build菜单生成签名Bundle/APK后,安装时出现**“应用未安装”**错误。
已完成的排查动作
- 确认签名文件
key.jks正常可用 - 所有Activity均已配置
android:exported="true",对应的AndroidManifest.xml核心代码如下:
<application android:name="iq.myapp.android.myapp" android:allowBackup="false" android:dataExtractionRules="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.myapp.SplashScreen" android:extractNativeLibs="true" android:usesCleartextTraffic="true"> <activity android:name="iq.myapp.android.ui.main.MainActivity" android:alwaysRetainTaskState="true" android:configChanges="uiMode" android:exported="true" android:label="@string/app_name" android:launchMode="singleTask" android:screenOrientation="portrait" android:supportsPictureInPicture="true" android:theme="@style/Theme.myapp.SplashScreen" tools:ignore="Instantiatable"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="iq.myapp.android.utils.casting.RemoteControlActivity" android:exported="true" android:excludeFromRecents="true" android:immersive="true" android:launchMode="singleInstance" android:parentActivityName="iq.myapp.android.ui.main.MainActivity" android:screenOrientation="portrait" android:showOnLockScreen="true" android:taskAffinity=".ui.MainActivity" android:theme="@style/Theme.myapp" tools:ignore="Instantiatable" /> <activity android:name=".ui.auth.AuthActivity" android:label="AppAuth" android:theme="@style/Theme.myapp" tools:ignore="RedundantLabel" android:exported="true"> </activity> <activity android:name="net.openid.appauth.RedirectUriReceiverActivity" tools:node="replace" android:exported="true" tools:ignore="MissingClass"> <intent-filter android:autoVerify="true"> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:scheme="" android:host=""/> </intent-filter> </activity> <activity android:name=".ui.player.PlayerActivity" android:exported="true" android:theme="@style/Theme.myapp" /> <meta-data android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME" android:value="iq.myapp.android.utils.casting.CastOptionsProvider" /> </application>
问题解决方法
经排查,问题根源是升级Gradle至8版本时添加的compileSdkPreview = "UpsideDownCake"配置。将Gradle降级至7.5,并删除该行配置后,生成的签名Bundle/APK可正常安装。
内容的提问来源于stack exchange,提问作者shareef saleh
相关产品推荐
相关产品推荐

