paho.mqtt.android icon indicating copy to clipboard operation
paho.mqtt.android copied to clipboard

在应用 build.gradle文件中的 targetSdkVersion需要小于或等于30,否则在连接服务器时会发生崩溃

Open LiVanAk opened this issue 1 year ago • 4 comments

Please fill out the form below before submitting, thank you!

这个错误是因为在 Android 12(API 级别 31)及以上版本中,当你创建 PendingIntent 时,需要明确指定其为不可变(FLAG_IMMUTABLE)或可变(FLAG_MUTABLE)。如果你的 PendingIntent 不需要在未来修改其内容,建议使用 FLAG_IMMUTABLE。

Description of Bug:

E.g. Steps to re-create, how often does this happen etc..

Console Log output (if available):

LiVanAk avatar Nov 27 '24 21:11 LiVanAk

适配到 Android 14 , https://github.com/mayzs/paho.mqtt.android

mayzs avatar Dec 06 '24 09:12 mayzs

适配到 Android 14 , https://github.com/mayzs/paho.mqtt.android

您好,由于我只是在IoT课程之余学习使用android的软件制作,目的是为了简单实现一个应用,满足esp32通信的需求 因此在看到您的消息后我尝试把新的库引入,但我并不会处理这些bug,主要内容为 Execution failed for task ':app:mergeExtDexDebug'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

我没有学习过java,debug也只能在搜索中和与chatgpt斗智斗勇的过程中进行,但最终效果甚微 不知道您有没有时间做些更详细的指导

LiVanAk avatar Dec 06 '24 12:12 LiVanAk

see https://github.com/QingHeYang/MqttFix

stelin avatar Jan 23 '25 03:01 stelin

see https://github.com/QingHeYang/MqttFix

感谢,thank you

LiVanAk avatar Jan 23 '25 03:01 LiVanAk