首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么我的项目需要科多瓦准备两次运行命令?

为什么我的项目需要科多瓦准备两次运行命令?
EN

Stack Overflow用户
提问于 2019-11-05 12:25:40
回答 1查看 447关注 0票数 0

在我的cordova项目中,由于某种原因,在添加所有插件之前,我必须运行两次cordova prepare android。第一次没有错误。

我在用cordova-android@^8.1.0。和

这些是使用的配置文件。有一些额外的文件,但它们与问题无关。我尝试过使用cordova build android,这导致了同样的问题。

config.xml

代码语言:javascript
复制
<?xml version='1.0' encoding='utf-8'?>
<widget defaultlocale="en-US" id="dualinventive.mtinfo3000" ios-CFBundleIdentifier="com.dualinventive.mtinfo3000" version="1.4.5" windows-packageVersion="1.4.4.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:vs="http://schemas.microsoft.com/appx/2014/htmlapps">
    <name>MTinfo 3000</name>
    <description>MTinfo 3000</description>
    <author email="maarten.manders@dualinventive.com" href="http://dualinventive.com">Dual Inventive</author>
    <content src="index.html" />
    <access origin="http://*.mtinfo3000.com" subdomains="true" />
    <access origin="https://*.mtinfo3000.com" subdomains="true" />
    <access origin="https://*.google.com/*" subdomains="true" />
    <access origin="https://sentry.io" />
    <vs:features />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="3000" />
    <preference name="SplashMaintainAspectRatio" value="true" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="windows-target-version" value="10.0" />
    <allow-navigation href="http://localhost:8080/*" />
    <allow-navigation href="https://*.mtinfo3000.com" />
    <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">
        <resource-file src="google-services.json" target="app/google-services.json" />
        <hook src="scripts/android/010_copy_build_extras.js" type="after_platform_add" />
        <allow-navigation href="*" />
        <allow-intent href="market:*" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:usesCleartextTraffic="true" />
        </edit-config>
    </platform>
    <platform name="ios">
        <allow-navigation href="*" />
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <platform name="android">
        <icon density="ldpi" src="res/icons/android/icon-36-ldpi.png" />
        <icon density="mdpi" src="res/icons/android/icon-48-mdpi.png" />
        <icon density="hdpi" src="res/icons/android/icon-72-hdpi.png" />
        <icon density="xhdpi" src="res/icons/android/icon-96-xhdpi.png" />
    </platform>
    <platform name="ios">
        <icon height="180" src="res/icons/ios/icon-60-3x.png" width="180" />
        <icon height="60" src="res/icons/ios/icon-60.png" width="60" />
        <icon height="120" src="res/icons/ios/icon-60-2x.png" width="120" />
        <icon height="76" src="res/icons/ios/icon-76.png" width="76" />
        <icon height="152" src="res/icons/ios/icon-76-2x.png" width="152" />
        <icon height="40" src="res/icons/ios/icon-40.png" width="40" />
        <icon height="80" src="res/icons/ios/icon-40-2x.png" width="80" />
        <icon height="57" src="res/icons/ios/icon-57.png" width="57" />
        <icon height="114" src="res/icons/ios/icon-57-2x.png" width="114" />
        <icon height="72" src="res/icons/ios/icon-72.png" width="72" />
        <icon height="144" src="res/icons/ios/icon-72-2x.png" width="144" />
        <icon height="29" src="res/icons/ios/icon-small.png" width="29" />
        <icon height="58" src="res/icons/ios/icon-small-2x.png" width="58" />
        <icon height="87" src="res/icons/ios/icon-small-3x.png" width="87" />
        <icon height="50" src="res/icons/ios/icon-50.png" width="50" />
        <icon height="100" src="res/icons/ios/icon-50-2x.png" width="100" />
        <icon height="1024" src="res/icons/ios/icon-1024.jpg" width="1024" />
        <icon height="167" src="res/icons/ios/icon-83.5-2x.png" width="167" />
        <icon height="167" src="res/icons/ios/icon-167.png" width="167" />
    </platform>
    <platform name="windows">
        <icon height="150" src="res/icons/windows/Square150x150Logo.scale-100.png" width="150" />
        <icon height="360" src="res/icons/windows/Square150x150Logo.scale-240.png" width="360" />
        <icon height="30" src="res/icons/windows/Square30x30Logo.scale-100.png" width="30" />
        <icon height="310" src="res/icons/windows/Square310x310Logo.scale-100.png" width="310" />
        <icon height="44" src="res/icons/windows/Square44x44Logo.scale-100.png" width="44" />
        <icon height="106" src="res/icons/windows/Square44x44Logo.scale-240.png" width="106" />
        <icon height="70" src="res/icons/windows/Square70x70Logo.scale-100.png" width="70" />
        <icon height="71" src="res/icons/windows/Square71x71Logo.scale-100.png" width="71" />
        <icon height="170" src="res/icons/windows/Square71x71Logo.scale-240.png" width="170" />
        <icon height="50" src="res/icons/windows/StoreLogo.scale-100.png" width="50" />
        <icon height="120" src="res/icons/windows/StoreLogo.scale-240.png" width="120" />
        <icon height="150" src="res/icons/windows/Wide310x150Logo.scale-100.png" width="310" />
        <icon height="360" src="res/icons/windows/Wide310x150Logo.scale-240.png" width="744" />
    </platform>
    <platform name="wp8">
        <icon height="62" src="res/icons/wp8/ApplicationIcon.png" width="62" />
        <icon height="173" src="res/icons/wp8/Background.png" width="173" />
    </platform>
    <platform name="android">
        <splash density="hdpi" src="res/screens/android/screen-hdpi-landscape.png" />
        <splash density="ldpi" src="res/screens/android/screen-ldpi-landscape.png" />
        <splash density="mdpi" src="res/screens/android/screen-mdpi-landscape.png" />
        <splash density="xhdpi" src="res/screens/android/screen-xhdpi-landscape.png" />
        <splash density="port-hdpi" src="res/screens/android/screen-hdpi-portrait.png" />
        <splash density="port-ldpi" src="res/screens/android/screen-ldpi-portrait.png" />
        <splash density="port-mdpi" src="res/screens/android/screen-mdpi-portrait.png" />
        <splash density="port-xhdpi" src="res/screens/android/screen-xhdpi-portrait.png" />
    </platform>
    <platform name="ios">
        <splash src="res/screens/ios/Default@2x~universal~anyany.png" />
    </platform>
    <platform name="windows">
        <splash height="300" src="res/screens/windows/SplashScreen.scale-100.png" width="620" />
        <splash height="1920" src="res/screens/windows/SplashScreen.scale-240.png" width="1152" />
        <splash height="1920" src="res/screens/windows/SplashScreenPhone.scale-240.png" width="1152" />
    </platform>
    <platform name="wp8">
        <splash height="800" src="res/screens/wp8/SplashScreenImage.jpg" width="480" />
    </platform>
    <preference name="KeepRunning" value="True" />
    <preference name="ShowTitle" value="True" />
    <preference name="InAppBrowserStorageEnabled" value="True" />
    <preference name="SuppressesIncrementalRendering" value="True" />
    <preference name="android-targetSdkVersion" value="28" />
    <preference name="StatusBarOverlaysWebView" value="false" />
    <preference name="StatusBarBackgroundColor" value="#009EE0" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="Fullscreen" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="interceptbackbutton" value="false" />
    <preference name="WindowsStoreDisplayName" value="MTinfo 3000" />
    <preference name="WindowsStoreIdentityName" value="DualInventive.MTinfo3000" />
    <preference name="WindowsStorePublisherName" value="Dual Inventive" />
    <preference name="deployment-target" value="9.0" />
    <preference name="ScrollEnabled" value="true" />
    <plugin name="cordova-plugin-compat" spec="^1.2.0" />
    <plugin name="cordova-plugin-device" spec="~1.1.0" />
    <plugin name="cordova-plugin-dialogs" spec="^2.0.1" />
    <plugin name="cordova-plugin-file-transfer" spec="git+https://github.com/dualinventive/cordova-plugin-file-transfer.git" />
    <plugin name="cordova-plugin-geolocation" spec="^2.4.3">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="To share with other MTinfo users" />
    </plugin>
    <plugin name="cordova-plugin-globalization" spec="^1.0.7" />
    <plugin name="cordova-plugin-inappbrowser" spec="~1.5.0" />
    <plugin name="cordova-plugin-sslcertificatechecker" spec="~5.0.0" />
    <plugin name="cordova-plugin-statusbar" spec="~2.0.0" />
    <plugin name="cordova-plugin-whitelist" spec="1.3.2" />
    <plugin name="cordova-plugin-nativestorage" spec="2.2.2" />
    <plugin name="cordova-plugin-network-information" spec="1.3.3" />
    <plugin name="cordova-plugin-cookie-manager" spec="https://github.com/teunsteenbekkers/cordova-plugin-cookie-manager.git" />
    <plugin name="cordova-plugin-add-swift-support" spec="^1.7.2" />
    <plugin name="cordova-plugin-localization-strings" spec="git+https://github.com/cozy/cordova-plugin-localization-strings.git" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-background-download" spec="git+https://github.com/dualinventive/cordova-plugin-background-download.git#0.3.0" />
    <plugin name="phonegap-plugin-push" spec="2.2.3">
        <variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" />
        <variable name="FCM_VERSION" value="11.6.2" />
    </plugin>
    <plugin name="cordova-plugin-windows-webview" spec="^0.5.4" />
    <plugin name="cordova-plugin-file" spec="^5.0.0" />
    <plugin name="phonegap-plugin-barcodescanner" spec="git+https://github.com/dualinventive/phonegap-plugin-barcodescanner.git">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <plugin name="sentry-cordova" spec="^0.16.2" />
    <plugin name="cordova-open-native-settings" spec="git+https://github.com/dualinventive/Cordova-open-native-settings.git#v1.5.2" />
    <plugin name="cordova-support-google-services" spec="~1.1.0" />
    <plugin name="phonegap-plugin-multidex" spec="~1.0.0" />
    <plugin name="cordova-plugin-camera" spec="^4.1.0">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
        <variable name="CAMERA_USAGE_DESCRIPTION " value="To take pictures of equipment and upload them to MTinfo" />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION " value="To select pictures from your library and upload them to MTinfo" />
    </plugin>
    <plugin name="cordova-open-native-settings" spec="git+https://github.com/dualinventive/Cordova-open-native-settings.git#v1.5.2" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="2.2.0" />
    <plugin name="cordova-plugin-ionic-webview" spec="^4.1.2" />
    <plugin name="cordova-support-google-services" spec="~1.1.0" />
    <plugin name="phonegap-plugin-multidex" spec="~1.0.0" />
    <plugin name="cordova-plugin-file-opener2" spec="^2.2.1">
        <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.+" />
    </plugin>
    <engine name="windows" spec="^6.0.1" />
    <engine name="android" spec="^8.1.0" />
    <engine name="ios" spec="^4.5.5" />
</widget>

package.json

代码语言:javascript
复制
{
  "name": "mti",
  "version": "1.0.0",
  "dependencies": {
    "cordova-android": "^8.1.0",
    "cordova-ios": "^4.5.5",
    "cordova-open-native-settings": "git+https://github.com/dualinventive/Cordova-open-native-settings.git#v1.5.2",
    "cordova-plugin-add-swift-support": "^1.7.2",
    "cordova-plugin-background-download": "git+https://github.com/dualinventive/cordova-plugin-background-download.git#0.3.0",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-cookie-manager": "https://github.com/teunsteenbekkers/cordova-plugin-cookie-manager.git",
    "cordova-plugin-device": "~1.1.0",
    "cordova-plugin-dialogs": "^2.0.1",
    "cordova-plugin-file": "^5.0.0",
    "cordova-plugin-file-opener2": "^2.2.1",
    "cordova-plugin-file-transfer": "git+https://github.com/dualinventive/cordova-plugin-file-transfer.git",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-globalization": "^1.0.7",
    "cordova-plugin-inappbrowser": "~1.5.0",
    "cordova-plugin-ionic-keyboard": "2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.2",
    "cordova-plugin-localization-strings": "git+https://github.com/cozy/cordova-plugin-localization-strings.git",
    "cordova-plugin-nativestorage": "2.2.2",
    "cordova-plugin-network-information": "1.3.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-sslcertificatechecker": "~5.0.0",
    "cordova-plugin-statusbar": "~2.0.0",
    "cordova-plugin-whitelist": "1.3.2",
    "cordova-plugin-windows-webview": "^0.5.4",
    "cordova-support-google-services": "~1.1.0",
    "cordova-windows": "^6.0.1",
    "phonegap-plugin-barcodescanner": "git+https://github.com/dualinventive/phonegap-plugin-barcodescanner.git",
    "phonegap-plugin-multidex": "~1.0.0",
    "phonegap-plugin-push": "2.2.3",
    "sentry-cordova": "^0.16.2"
  },
  "cordova": {
    "platforms": [
      "windows",
      "android",
      "ios"
    ],
    "plugins": {
      "cordova-open-native-settings": {},
      "cordova-plugin-compat": {},
      "cordova-plugin-device": {},
      "cordova-plugin-dialogs": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "To share with other MTinfo users"
      },
      "cordova-plugin-globalization": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-sslcertificatechecker": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-cookie-manager": {},
      "cordova-plugin-add-swift-support": {},
      "cordova-plugin-localization-strings": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-background-download": {},
      "phonegap-plugin-push": {
        "ANDROID_SUPPORT_V13_VERSION": "27.+",
        "FCM_VERSION": "11.6.2"
      },
      "cordova-plugin-windows-webview": {},
      "cordova-plugin-file": {},
      "phonegap-plugin-barcodescanner": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "sentry-cordova": {},
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+",
        "CAMERA_USAGE_DESCRIPTION ": "To take pictures of equipment and upload them to MTinfo",
        "PHOTOLIBRARY_USAGE_DESCRIPTION ": "To select pictures from your library and upload them to MTinfo"
      },
      "cordova-plugin-file-opener2": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-support-google-services": {},
      "phonegap-plugin-multidex": {}
    }
  }
}

我期望下列人士出席:

  • android.json
  • cordova-open-native-settings/
  • cordova-plugin-add-swift-support/
  • cordova-plugin-background-download/
  • cordova-plugin-camera/
  • cordova-plugin-compat/
  • cordova-plugin-cookie-manager/
  • cordova-plugin-device/
  • cordova-plugin-dialogs/
  • cordova-plugin-file/
  • cordova-plugin-file-opener2/
  • cordova-plugin-file-transfer/
  • cordova-plugin-geolocation/
  • cordova-plugin-globalization/
  • cordova-plugin-inappbrowser/
  • cordova-plugin-ionic-keyboard/
  • cordova-plugin-ionic-webview/
  • cordova-plugin-localization-strings/
  • cordova-plugin-nativestorage/
  • cordova-plugin-network-information/
  • cordova-plugin-splashscreen/
  • cordova-plugin-sslcertificatechecker/
  • cordova-plugin-statusbar/
  • cordova-plugin-whitelist/
  • cordova-plugin-windows-webview/
  • cordova-support-google-services/
  • fetch.json
  • phonegap-plugin-barcodescanner/
  • phonegap-plugin-multidex/
  • phonegap-plugin-push/
  • sentry-cordova/

然而,只有以下几点:

  • android.json
  • cordova-open-native-settings/
  • cordova-plugin-add-swift-support/
  • cordova-plugin-camera/
  • cordova-plugin-compat/
  • cordova-plugin-cookie-manager/
  • cordova-plugin-device/
  • cordova-plugin-dialogs/
  • cordova-plugin-file/
  • cordova-plugin-geolocation/
  • cordova-plugin-globalization/
  • cordova-plugin-inappbrowser/
  • cordova-plugin-ionic-keyboard/
  • cordova-plugin-ionic-webview/
  • cordova-plugin-localization-strings/
  • cordova-plugin-nativestorage/
  • cordova-plugin-network-information/
  • cordova-plugin-splashscreen/
  • cordova-plugin-sslcertificatechecker/
  • cordova-plugin-statusbar/
  • cordova-plugin-whitelist/
  • cordova-plugin-windows-webview/
  • cordova-support-google-services/
  • fetch.json
  • phonegap-plugin-barcodescanner/
  • phonegap-plugin-multidex/
  • phonegap-plugin-push/
  • sentry-cordova/
EN

回答 1

Stack Overflow用户

发布于 2019-11-05 23:35:50

如果代码按预期运行,我看不出这是个问题的原因。无论如何,试着使用cordova构建android来查看是否发生了错误,并/或尝试使用--详细操作来运行该命令。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58711340

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档