Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the common problems of cordova packaging android

2025-03-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the cordova packaging android common problems how to solve the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this cordova packaging android common problems how to solve the article will have a harvest, let's take a look.

Problem 1 android cannot send a network request

A problem with cordova when packaging android is that it cannot send a request (whether it's http or https) after packing. In the end, the original project was deleted and then a new one was built.

Question 2 build android reported an error

Cordova reported an error when packaging with cordova build android after installing the cordova-plugin-image-picker plug-in

Report in the file * *\ ImageFetcher.java:294 that Entry is not public in LinkedHashMap and cannot be accessed from an external package. Protected boolean removeEldestEntry (LinkedHashMap.Entry eldest) {

The final solution is to first introduce the class package import java.util.Map into ImageFetcher.java, and then go to line 294 of the file, which is the location of the code shown in the error above, and modify the code as follows

Protected boolean removeEldestEntry (Map.Entry eldest)... / / the following code will be omitted.

Then save it and cordova build android it again to be successful.

Question 3 gradle version problem

When packing, sometimes the error will be as follows

Minimum supported Gradle version is 4.6. Current version is 4.1If using the gradle wrapper try editint the distributionUrl in * *\ gradle-wrapper.properties to gradle-4.6-all.zip

As can be seen from the above information, the version of gradle we currently support is 4.6, but we are currently using 4.1. So we need to upgrade. The upgrade is actually very simple. Find the 227th line in the platform/android/cordova/lib/builders/StudioBuilder.js file and change the following gradle-4.1-all.zip to gradle-4.6-all.zip. Then cordova build android can be executed normally.

This is the end of the article on "how to solve common problems in cordova packaging android". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to solve common problems in cordova packaging android". If you want to learn more knowledge, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report