Cordova 构建不传播从 config.xml 到 AndroidManifest.xml 的版本更改

问题描述 投票:0回答:1

由于某种原因,在更改

config.xml
中的版本后,
cordova clean
cordova build
命令都不会从生成的
AndroidManifest.xml
文件中更新我的 android:versionCodeandroid:versionName。我每次都必须手动编辑清单以更改版本号。

我记得这在过去和/或与其他应用程序一起工作得非常好,任何建议将不胜感激。

cordova-信息输出

Cordova Packages:

    cli: 12.0.0
        common: 5.0.0
        create: 5.0.0
        lib: 12.0.1
            common: 5.0.0
            fetch: 4.0.0
            serve: 4.0.1

Project Installed Platforms:

    android: 11.0.0
    browser: 7.0.0

Project Installed Plugins:

    cordova-plugin-app-version: 0.1.14
    cordova-plugin-camera: 6.0.0
    cordova-plugin-device: 2.1.0
    cordova-plugin-dialogs: 2.0.2
    cordova-plugin-geolocation: 4.0.2
    cordova-plugin-in-app-updates: 2.1.0
    cordova-plugin-inappbrowser: 5.0.0
    cordova-plugin-native-spinner: 1.1.4
    cordova-plugin-network-information: 3.0.0
    cordova-plugin-splashscreen: 6.0.0
    cordova-plugin-statusbar: 4.0.0
    cordova-plugin-x-toast: 2.7.3

Environment:

    OS: Microsoft Windows 8.1 Pro 6.3.9600 (9600) (Windows 6.3.9600) x64
    Node: v18.12.1
    npm: 8.19.2

android Environment:

    android:
ERROR: Command failed with exit code 1: avdmanager list target
"avdmanager" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.


Project Setting Files:

    config.xml:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.co
m/apk/res/android" id="net.cdn.app" android-versionCode="1510000" version="1.5.1" defaultlocale="es-MX">
        <name>***</name>
        <description>***</description>
        <preference name="fullscreen" value="false"/>
        <preference name="webviewbounce" value="false"/>
        <content src="index.html"/>
        <allow-intent href="http://*/*" />
        <allow-intent href="https://*/*" />
        <allow-intent href="tel:*" />
        <allow-intent href="sms:*" />
        <allow-intent href="mailto:*" />
        <allow-intent href="geo:*" />

        <preference name="AndroidXEnabled" value="true"/>
        <preference name="android-minSdkVersion" value="21" />
        <preference name="android-compileSdkVersion" value="32" />
        <preference name="android-targetSdkVersion" value="33" />
        <preference name="DisallowOverscroll" value="true" />
        <preference name="KeepRunning" value="false" />
        <preference name="InAppBrowserStorageEnabled" value="true" />
        <preference name="LoadUrlTimeoutValue" value="999999" />
        <preference name="FadeSplashScreen" value="false" />
        <preference name="FadeSplashScreenDuration" value="0" />
        <preference name="SplashScreen" value="screen" />
        <preference name="SplashScreenDelay" value="3000" />
        <preference name="SplashMaintainAspectRatio" value="true" />
        <preference name="SplashShowOnlyFirstTime" value="false" />
        <preference name="ShowSplashScreenSpinner" value="false" />
        <preference name="StatusBarOverlaysWebView" value="false" />
        <preference name="StatusBarBackgroundColor" value="#FFCA28" />
        <preference name="StatusBarStyle" value="lightcontent" />

        <platform name="android">
                <allow-intent href="market:*"/>
        </platform>
        <platform name="android">
                <icon background="res/icons/android/bg/ldpi.png" density="ldpi" foreground="res/icons/android/fg/ldpi.png" src="re
s/icons/android/launcher/ldpi.png" />
                <icon background="res/icons/android/bg/mdpi.png" density="mdpi" foreground="res/icons/android/fg/mdpi.png" src="re
s/icons/android/launcher/mdpi.png" />
                <icon background="res/icons/android/bg/hdpi.png" density="hdpi" foreground="res/icons/android/fg/hdpi.png" src="re
s/icons/android/launcher/hdpi.png" />
                <icon background="res/icons/android/bg/xhdpi.png" density="xhdpi" foreground="res/icons/android/fg/xhdpi.png" src=
"res/icons/android/launcher/xhdpi.png" />
                <icon background="res/icons/android/bg/xxhdpi.png" density="xxhdpi" foreground="res/icons/android/fg/xxhdpi.png" s
rc="res/icons/android/launcher/xxhdpi.png" />
                <icon background="res/icons/android/bg/xxxhdpi.png" density="xxxhdpi" foreground="res/icons/android/fg/xxxhdpi.png
" src="res/icons/android/launcher/xxxhdpi.png" />
        </platform>
        <platform name="browser">
                <preference name="AutoHideSplashScreen" value="true" /> <!-- defaults to "true" -->
                <preference name="FadeSplashScreen" value="false" />
                <preference name="ShowSplashScreen" value="false" /> <!-- defaults to "true" -->
                <preference name="SplashScreen" value="res/screens/android/icon.png" /> <!-- defaults to "/img/logo.png" -->
                <preference name="SplashScreenBackgroundColor" value="#FBCA0D" /> <!-- defaults to "#464646" -->
                <preference name="SplashScreenDelay" value="3000" /> <!-- defaults to "3000" -->
                <preference name="SplashScreenHeight" value="960" /> <!-- defaults to "200" -->
                <preference name="SplashScreenWidth" value="720" /> <!-- defaults to "170" -->
        </platform>

        <preference name="AndroidPersistentFileLocation" value="Compatibility" />
        <preference name="AndroidWindowSplashScreenAnimatedIcon" value="res/screens/android/icon.png" />
        <preference name="AndroidWindowSplashScreenBackground" value="#FBCA0D" />
        <preference name="GradlePluginKotlinEnabled" value="true" />
        <preference name="GradlePluginKotlinVersion" value="1.5.21" />

        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest">
                <manifest android:installLocation="auto" />
        </edit-config>
</widget>

    package.json:
--- Start of Cordova JSON Snippet ---
{
  "plugins": {
    "cordova-plugin-dialogs": {},
    "cordova-plugin-geolocation": {},
    "cordova-plugin-splashscreen": {},
    "cordova-plugin-native-spinner": {},
    "cordova-plugin-device": {},
    "cordova-plugin-network-information": {},
    "cordova-plugin-statusbar": {},
    "cordova-plugin-x-toast": {},
    "cordova-plugin-camera": {
      "ANDROIDX_CORE_VERSION": "1.6.+"
    },
    "cordova-plugin-in-app-updates": {
      "ANDROIDX_APPCOMPAT_VERSION": "1.5.1",
      "ANDROID_PLAY_APP_UPDATE_VERSION": "2.1.0",
      "ANDROID_MATERIAL_VERSION": "1.3.0"
    },
    "cordova-plugin-inappbrowser": {},
    "cordova-plugin-app-version": {}
  },
  "platforms": [
    "browser",
    "android"
  ]
}
--- End of Cordova JSON Snippet ---
cordova android-manifest cordova-android
1个回答
0
投票

你的错误是显而易见的

ERROR: Command failed with exit code 1: avdmanager list target
"avdmanager" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

SDK 目标似乎是错误的,或者你甚至没有 avdmanager

© www.soinside.com 2019 - 2024. All rights reserved.