简体   繁体   English

无法构建cordova android应用程序

[英]Cannot build cordova android app

Today I wanted to update my app in google play store but got the following error:今天我想在 google play 商店更新我的应用程序,但出现以下错误: 在此处输入图片说明

My config.xml looks like:我的 config.xml 看起来像:

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<widget 
    id="com.bla.blabla.bla"
    version="1.3.8"
    xmlns="http://www.w3.org/ns/widgets" 
    xmlns:cdv="http://cordova.apache.org/ns/1.0"
    xmlns:gap="http://phonegap.com/ns/1.0">

    <name>MyApp</name>

    <author>MyName</author>

    <preference name="AutoHideSplashScreen" value="false" />

    <content src="index.html"/>

    <access origin="*"/> 
    <allow-navigation href="*" />

    <!-- START: Android and iOS Quirks -->
    <preference name="FadeSplashScreen" value="false"/>

    <!-- START: Android section -->
    <preference name="android-minSdkVersion" value="17" />

    <!-- android quirks -->
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="10000" />

    <platform name="android">
        <splash src="www/resources/device/android/splash/land/hdpi.png" density="land-hdpi"/>
        <splash src="www/resources/device/android/splash/land/hdpi.png" density="land-ldpi"/>
        <splash src="www/resources/device/android/splash/land/hdpi.png" density="land-mdpi"/>
        <splash src="www/resources/device/android/splash/land/hdpi.png" density="land-xhdpi"/>

        <splash src="www/resources/device/android/splash/port/hdpi.png" density="port-hdpi"/>
        <splash src="www/resources/device/android/splash/port/ldpi.png" density="port-ldpi"/>
        <splash src="www/resources/device/android/splash/port/mdpi.png" density="port-mdpi"/>
        <splash src="www/resources/device/android/splash/port/xhdpi.png" density="port-xhdpi"/>

        <icon src="www/resources/device/android/ldpi.png" density="ldpi" />
        <icon src="www/resources/device/android/mdpi.png" density="mdpi" />
        <icon src="www/resources/device/android/hdpi.png" density="hdpi" />
        <icon src="www/resources/device/android/xhdpi.png" density="xhdpi" />
    </platform>
     <!-- END: Android section -->

</widget>

My build script looks like:我的构建脚本如下所示:

    call cordova platform add android

    call cordova plugin add cordova-plugin-device
    call cordova plugin add cordova-plugin-file
    call cordova plugin add cordova-plugin-file-transfer
    call cordova plugin add cordova-plugin-network-information
    call cordova plugin add cordova-plugin-splashscreen
    call cordova plugin add cordova-plugin-inappbrowser
    call cordova plugin add cordova-plugin-whitelist
    call cordova plugin add cordova-plugin-file-opener2

    call cordova build android

What could be the problem?可能是什么问题呢? Some months ago this script worked.几个月前,这个脚本奏效了。 I searched a lot in the web but did not find the solution.我在网上搜索了很多,但没有找到解决方案。 Mostly I read that the solution is to edit the AndroidManifest.xml but I am in cordova and not in a native android app development so I cannot edit the AndroidManifest.xml.大多数情况下,我读到解决方案是编辑 AndroidManifest.xml,但我使用的是cordova 而不是本机Android 应用程序开发,因此我无法编辑AndroidManifest.xml。

Ok now I resolved it by installing specific version of cordova:好的,现在我通过安装特定版本的cordova来解决它:

npm install -g cordova@5.4.0

Before there was cordova 6.0.0 installed.在安装cordova 6.0.0之前。 I have no idea what changed from 5.4.0 to 6.0.0.我不知道从 5.4.0 到 6.0.0 有什么变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM