Apache Cordova(Cordova-android)出现错误net :: err_connection_refuse

发布于 2025-01-31 12:17:12 字数 1757 浏览 2 评论 0原文

我正在尝试使用Apache Cordova构建一个Android应用程序,我遇到了一个错误:

Application Error
net::ERR_CONNECTION_REFUSED (http://localhost:8080/index.html)

在此处查看图像

现在我不知道该怎么办...

我的config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.blabla" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <!-- metadata ...... !-->
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon src="icons/mdpi.png" density="mdpi" />
        <icon src="icons/hdpi.png" density="hdpi" />
        <icon src="icons/xhdpi.png" density="xhdpi" />
        <icon src="icons/xxhdpi.png" density="xxhdpi" />
        <icon src="icons/xxxhdpi.png" density="xxxhdpi" />
        <preference name="android-minSdkVersion" value="23" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:usesCleartextTraffic="true" />
        </edit-config>
    </platform>
</widget>

我的插件

cordova-plugin-inappbrowser
cordova-android-support-gradle-release
cordova-plugin-crypt-file-android

Apache Cordova V11.0.0

非常感谢!

i'm trying to build a Android app with Apache Cordova, i got an error:

Application Error
net::ERR_CONNECTION_REFUSED (http://localhost:8080/index.html)

View image here

Now I don't know what to do...

My config.xml

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.blabla" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <!-- metadata ...... !-->
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon src="icons/mdpi.png" density="mdpi" />
        <icon src="icons/hdpi.png" density="hdpi" />
        <icon src="icons/xhdpi.png" density="xhdpi" />
        <icon src="icons/xxhdpi.png" density="xxhdpi" />
        <icon src="icons/xxxhdpi.png" density="xxxhdpi" />
        <preference name="android-minSdkVersion" value="23" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:usesCleartextTraffic="true" />
        </edit-config>
    </platform>
</widget>

My plugins

cordova-plugin-inappbrowser
cordova-android-support-gradle-release
cordova-plugin-crypt-file-android

Apache Cordova v11.0.0

Thanks so much!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文