Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LiVanAk opened this issue Nov 27, 2024 · 4 comments

Comments

@LiVanAk
Copy link

LiVanAk commented Nov 27, 2024

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):

@mayzs
Copy link

mayzs commented Dec 6, 2024

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

@LiVanAk
Copy link
Author

LiVanAk commented Dec 6, 2024

适配到 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斗智斗勇的过程中进行,但最终效果甚微
不知道您有没有时间做些更详细的指导

@stelin
Copy link

stelin commented Jan 23, 2025

@LiVanAk
Copy link
Author

LiVanAk commented Jan 23, 2025

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

感谢,thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants