Android APP WeChat third-party login stepping on the pit - WeChat third-party login fails after modifying the application package name on the WeChat open platform

Only by registering the mobile application on the WeChat open platform can " WeChat login " and " WeChat payment "     be realized in the APP .

    Recently, due to business needs, the package name of the application needs to be modified, so the application for modifying the "basic information" of the application has been resubmitted on the WeChat development platform. Provide basic information and related introductions of the application, and also require the official website of the application to be decent and complete. The requirements for application developers are getting higher and higher. I just wanted to change a package name, but the audit failed three times, and it was not approved until the fourth time. Fortunately, in addition to the Anroid client and background development, the front end of the official website can barely deal with it. In short, the process is really torture:

  • Your app review was rejected. The category selected for your application does not meet the requirements, please select again.
  • Your app review was rejected. Reason for rejection: Hello, the application name you applied for is inconsistent with the application information on the website. This application is not approved. It is recommended to resubmit the application after changing the name that is consistent with the application information on the website. . The app is still running normally in WeChat with the status of the last review
  • Your app review was rejected. Reason for rejection: Hello, website content, layout, etc. must meet the requirements of regular websites, and website content with only a few lines of text, or only one or a few pictures, or in the form of documents is not supported. The content of the website must include but not limited to the homepage, product display, relevant application names and words and application introduction, user agreement, copyright owner, website filing information, contact information and other basic service information. . The app is still running normally in WeChat with the status of passing the last review.

    After finally passing the basic information review of the application, the signature and package name of the application can be modified, as shown in the figure below:

    After filling in the new application package name, synchronously modify the applicationId in the build.gradle file in the root directory of the Android project:

applicationId "com.xxx.xxx"
    After the modification, repackage and install the APK package. As a result, after clicking "Allow Authorization" on the third-party login page, no feedback is received. So I went online to find a solution, and found a solution in the WeChat open platform community. This method is to delete all WeChat data or uninstall and reinstall, as shown in the following two pictures, one is the user asking a question, and the other is Responses given by community managers:

 
 

    But considering that this solution will clear up all the chat records of the user, the author thinks it is too troublesome, so at the beginning, I tried to set the WeChat settings on the mobile phone - after clearing the cache (not deleting all data), including logging out and logging in again, or even replacing Tested the phone, but none of these methods worked. In the end, I had to uninstall WeChat and reinstall it, but I was disappointed that it still didn't work out, wasting so much of my time. I didn't get any response to my post in the WeChat development platform community, so I could only calm down and think. Now that I have tried all the methods, if it is not the problem of the WeChat open platform, then it is my own problem. Going back to the official website to find the answer, the original answer is in the information page of modifying the package name:

The unique identifier of the application on a device, declared in the manifest file , the package name should be the same as the package name of the officially released application. For example, the package name of WeChat is com.tencent.mm.

It turns out that not only the "applicationId" but also the "manifest file" must be modified :

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.xxx.xxx">

     If you modify the package here, you must modify the package name of the entire project, and you need to recompile and package. So if you come here, all the pits are over. Generally, applying to add a new application on the WeChat development platform is not easy to make mistakes. If you modify the package name later, you will often make mistakes. Remember to read the official website instructions carefully. Uninstall and reinstall WeChat or delete all WeChat data in the phone system settings.

Guess you like

Origin blog.csdn.net/crazestone0614/article/details/127589659