Solve the problem of WebView and JS interaction invalidation after Android signature is confused

Source: Internet
Author: User

"The article in this blog is my study note summary, if there are errors please criticize correct, thank you!" Welcome to the group 285077071 Discussion

Problem Description: In the process of developing the company project, it is found that the webview of the app after packaging and signing is not loading the webpage normally, but the app without package is normal! What's the problem??

Solution: Packing the signature before and after loading is the same page, different only after the signature app is confused ... So, open the Proguard-project.txt file, there is a line of annotated statements, such as

650) this.width=650; "Src=" http://img.blog.csdn.net/20160422103955112?watermark/2/text/ Ahr0cdovl2jsb2cuy3nkbi5uzxqv/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/dissolve/70/gravity/center "Style=" Border:none; "/>

Since the packaging signature is confused and cannot be called, then we will open this comment, and replace it with the corresponding class name and package name to try ...

Sure enough, after the packaged app can load the Web page, very excited ...

Summary: Confusion will result in WebView Java code and JS communication failure, to ensure that the normal communication must be guaranteed not to be confused.


This article is from the "Fukung-Kunming Mobile Internet" blog, please be sure to keep this source http://kinbos.blog.51cto.com/2092114/1766607

Solve the problem of WebView and JS interaction invalidation after Android signature is confused

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.