Android upgrades SDK to 30, causing WeChat login and payment failure

At that time, in order to upload the application to Google Play, I upgraded the SDK version number targetSdkVersion = 30. Later I found that after the upgrade, WeChat login and WeChat payment in the application could not be launched. When I clicked to log in or pay, there was no response.

By looking at the logs, we found that sendReq failed for wechat app signature check failed because WeChat was not launched.

Later, I learned about the information and found that there was a version adaptation issue. On Android 11, when an app accesses other apps on the phone, rules have been added, and a package name statement needs to be added to the AndroidMainifest manifest file. Note that it is within the manifest tag . After adding the statement, log in with WeChat and payment can be used normally.

<queries>

<package android:name="com.tencent.mm" />

</queries>

Solution 1

Downgrade the sdk version. In build.gradle, reduce the value of targetSdkVersion to 29

Solution 2

Under the <manifest> tag in AndroidMainifest.xml , add the WeChat package name statement

Guess you like

Origin blog.csdn.net/zhaojunhua_123/article/details/129672105