迁移到AndroidX后一直面临此错误.
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type: ErrorScope{Error scope for class <ERROR CLASS> with arguments: org.jetbrains.kotlin.types.IndexedParametersSubstitution@14ac19e7}
Run Code Online (Sandbox Code Playgroud)
这个链接没有多大帮助
尝试在 Android 12 设备中安装应用程序时出现以下错误。
Installation did not succeed.
The application could not be installed: INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
Run Code Online (Sandbox Code Playgroud)
错误
Installation failed due to: 'INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1707272647.tmp/base.apk (at Binary XML file line #98): aero.sita.airsideapp.activities.MainActivity: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present'
Run Code Online (Sandbox Code Playgroud)
有以下目标并编译sdk版本
compileSdkVersion: 31,
buildToolsVersion: "28.0.2",
minSdkVersion : 16,
targetSdkVersion : 31,
Run Code Online (Sandbox Code Playgroud)
将版本减少到 30 效果很好,但是我无法使用android:windowSplashScreenBackgroundandroid 12 设备的启动屏幕背景更改参数
编辑:添加android:exported="true"到所有 <activity>、<service> …
与这个问题类似,但不一样
更新到 Android 12 (SDK 31) 后,我们更改PendingIntent.getActivity(context, 0, intent, 0)为PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE)建议的。
但PendingIntent.FLAG_IMMUTABLE不适用于 23 以下的 SDK。如果我添加if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)以保留两个版本,我会保留有关未使用正确标志的 lint 警告else。
这里的预期行为是什么?谢谢!
请帮我解决这个问题。我给出了 git 的链接。
https://github.com/Vasajj/radio_tysa_fm.git
PendingIntent 出现问题,包:
在 android 8 上一切都很好
Installing build\app\outputs\flutter-apk\app.apk...
Debug service listening on ws://127.0.0.1:55138/iMdUmbZTaNc=/ws
Syncing files to device sdk gphone64 x86 64...
I/javaClass(18284): Calling to method: initService
I/javaClass(18284): start service invoked
I/javaClass(18284): Attempting to initialize service...
I/javaClass(18284): Service not bound, binding now....
I/javaClass(18284): Mapping method call to player item object
I/javaClass(18284): Firing up service. (onStartCommand)...
I/javaClass(18284): LocalBroadCastManager Received...
W/e.radio_tysa_f(18284): Accessing hidden method Landroid/media/AudioTrack;->getLatency()I (unsupported, reflection, allowed)
I/ExoPlayerImpl(18284): Init 398a550 [ExoPlayerLib/2.13.1] [emulator64_x86_64_arm64, sdk_gphone64_x86_64, Google, 32]
I/javaClass(18284): Pushing Event: …Run Code Online (Sandbox Code Playgroud) 面向 S+(版本 31 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一。强烈考虑使用 FLAG_IMMUTABLE,仅当某些功能依赖于 PendingIntent 可变时才使用 FLAG_MUTABLE
我无法更新 android studio 项目编码中的挂起意图标志
这是AlarmPingSender.java中发生错误的地方
public void start()
{
String action = MqttServiceConstants.PING_SENDER
+ comms.getClient().getClientId();
Log.d(TAG, "Register alarmreceiver to MqttService"+ action);
service.registerReceiver(alarmReceiver, new IntentFilter(action));
pendingIntent = PendingIntent.getBroadcast(service, 0, new Intent(
action), PendingIntent.FLAG_UPDATE_CURRENT);
schedule(comms.getKeepAlive());
hasStarted = true;
}
Run Code Online (Sandbox Code Playgroud)
嘿,我收到了未决意图的警告。所以我根据这个问题和这个中等帖子包围了检查sdk的检查。我收到警告消息
缺少PendingIntent可变性标志
val pendingIntent: PendingIntent = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_IMMUTABLE or PendingIntent.FLAG_UPDATE_CURRENT)
} else {
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
}
Run Code Online (Sandbox Code Playgroud)
如何删除此警告消息?
我已将我的应用程序上传到 Play 商店,但它仍然崩溃,如开发人员控制台的“崩溃报告图像”所示。
在某些设备上,该应用程序根本不运行
而在其他情况下,它在启动 sql 查询时崩溃
顺便说一句,混淆器被禁用
崩溃报告图像

查询方法

android proguard crash-reports sqlcipher-android release-apk
尝试将我的应用程序更新到 Android S 并遇到标题/错误所说的一些问题。我收到错误
针对 S+(版本 10000 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一。强烈考虑使用 FLAG_IMMUTABLE,仅当某些功能依赖于 PendingIntent 是可变的时才使用 FLAG_MUTABLE,例如,如果它需要与内联回复或气泡一起使用。
我的代码中只有 1 个 PendingIntent 用于通知,并且我添加了 Flag
PendingIntent.getActivity(
mContext,
0 /* Request code */,
intentOptional.get(),
PendingIntent.FLAG_IMMUTABLE
)
Run Code Online (Sandbox Code Playgroud)
阅读 Google 的文档,这应该是我在 Android S 中进行此安全更新所需的全部内容。我确实在这里找到了几个月前的帖子,询问了类似的问题,有人说要添加 WorkManager /sf/answers/4702709721/ 4219444进入项目,即使你不使用它。所以我加了
def work_version = "2.7.0-alpha04"
implementation "androidx.work:work-runtime-ktx:$work_version"
Run Code Online (Sandbox Code Playgroud)
这根本没有帮助,因为我仍然收到错误。有谁知道这是 Android S 升级的常见问题还是它也检查库?卡住了,因为应用程序只是不断崩溃,不知道该怎么做。
我创建了一个没有我的库的应用程序,并使用了相同的 PendingIntent,并且能够运行一个带有待处理意图的基本 hello world 应用程序。我从我试图编译的项目中收到的完整错误是:
针对 S+(版本 10000 及更高版本)要求在创建 PendingIntent 时指定 FLAG_IMMUTABLE 或 FLAG_MUTABLE 之一。强烈考虑使用 FLAG_IMMUTABLE,仅当某些功能依赖于 PendingIntent 是可变的时才使用 FLAG_MUTABLE,例如,如果它需要与内联回复或气泡一起使用。在 android.app.PendingIntent.checkFlags(PendingIntent.java:375) 在 android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645) 在 android.app.PendingIntent.getBroadcast(PendingIntent.java:632) 在 com.google。 …
我目前正在开发一个音乐应用程序Wavelet。这是我的依赖项:
package.json
我通常在 Android 11 模拟器上进行调试,但是当在 Android 12L 上使用 Android 12 模拟器和我的物理设备时,它会崩溃。
我能够从我的物理设备中选择此日志。
我的应用程序在定位到 Android 12 时崩溃了
这是崩溃日志:
java.lang.RuntimeException: Unable to create service com.kdr.snipping.CheckRecentRun: java.lang.IllegalArgumentException: com.kdr.snipping: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.ActivityThread.handleCreateService(ActivityThread.java:4500)
at android.app.ActivityThread.access$1700(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2072)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7839)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at …Run Code Online (Sandbox Code Playgroud)javascript android android-pendingintent android-studio android-12
android ×10
android-12 ×3
javascript ×2
kotlin ×2
androidx ×1
exoplayer2.x ×1
flutter ×1
proguard ×1
react-native ×1
release-apk ×1
warnings ×1