将 targetSdkVersion 改为 30
安卓API 32微信支付调用出错https://developers.weixin.qq.com/doc/oplatform/Mobile_App/Access_Guide/Android.html Android接入微信支付。ANDROID SDK版本:targetSDK:32 清单文件已经添加query权限。 <!-- Android>29 微信支付必须从Android 11开始, 需要在AndroidManifest.xml清单文件中加入query权限申请, 才能检测到手机上安装的三方应用包安装状态 --> <queries> <!-- 微信支付&微信分享 --> <package android:name="com.tencent.mm" /> <!-- 阿里支付 --> <package android:name="com.eg.android.AlipayGphone" /> <package android:name="hk.alipay.wallet" /> <!-- 微博 --> <package android:name="com.sina.weibo" /> <!-- QQ空间 --> <package android:name="com.qzone" /> </queries> MMessageAct调用过程出错: 2022-04-06 11:30:31.197 22448-22448/com.qiyu.android.vrapp D/MicroMsg.SDK.MMessageAct: send, targetPkgName = com.tencent.mm, targetClassName = com.tencent.mm.plugin.base.stub.WXPayEntryActivity, launchMode = 2 2022-04-06 11:30:31.197 22448-22448/com.qiyu.android.vrapp I/MicroMsg.SDK.MMessageAct: sendUsingPendingIntent 2022-04-06 11:30:31.197 22448-22448/com.qiyu.android.vrapp E/MicroMsg.SDK.MMessageAct: sendUsingPendingIntent fail, ex = com.qiyu.android.vrapp: 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. --------- beginning of system 2022-04-06 11:30:31.219 22448-22448/com.qiyu.android.vrapp D/MicroMsg.SDK.MMessageAct: send mm message, intent=Intent { flg=0x18000000 cmp=com.tencent.mm/.plugin.base.stub
2023-01-10将 targetSdkVersion 改为31以下后,就可以正常 了,这说明微信sdk还没有适配android11的安全策略
微信授权报错D/MicroMsg.SDK.MMessageAct: send, targetPkgName = com.tencent.mm, targetClassName = com.tencent.mm.plugin.base.stub.WXEntryActivity, launchMode = 2 I/MicroMsg.SDK.MMessageAct: sendUsingPendingIntent E/MicroMsg.SDK.MMessageAct: sendUsingPendingIntent fail, ex = whocanplay.vip.sfclub: 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.
2023-01-10