首页 文章

Cordova - 构建版本 - “无法解析配置':_debugCompile'的所有依赖项?

提问于
浏览
1

我在Visual Studio 2015中有一个使用cordova的项目 . 它以纹波运行,调试版没有任何错误 . 但是,在切换到“发布版本”后,它出现了以下错误?

Severity    Code    Description Project File    Line    Suppression State
Error       FAILURE: Build failed with an exception.    stapp       1   
Error       * What went wrong:  stapp       1   
Error       A problem occurred configuring root project 'android'.  stapp       1   
Error       > Could not resolve all dependencies for configuration ':_debugCompile'.    stapp       1   
Error        > Could not find any version that matches com.android.support:support-v4:+.    stapp       1   
Error        Searched in the following locations:   stapp       1   
Error        https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml   stapp       1   
Error        https://repo1.maven.org/maven2/com/android/support/support-v4/ stapp       1   
Error        Required by:   stapp       1   
Error        :android:unspecified   stapp       1   
Error       * Try:  stapp       1   
Error       Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.  stapp       1   
Error       Error code 1 for command: cmd with args: /s,/c,"D:\Users\.......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"  stapp       1
1>  Wrote out Android package name to "com.greywolfdesign.scenetip"
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-hdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-ldpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-mdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\icon.png
1>  copying image from D:\Users\......\stapp\resources\android\icon\drawable-ldpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-ldpi\icon.png
1>  copying image from D:\Users\......\stapp\resources\android\icon\drawable-mdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-mdpi\icon.png
1>  copying image from D:\Users\......\stapp\resources\android\icon\drawable-hdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-hdpi\icon.png
1>  copying image from D:\Users\......\stapp\resources\android\icon\drawable-xhdpi-icon.png to D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\icon.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-hdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-ldpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-mdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\screen.png
1>  Deleted D:\Users\......\stapp\platforms\android\res\drawable-xhdpi\screen.png
1>  splash screens: [{"src":"resources/android/splash/drawable-land-hdpi-screen.png","density":"land-hdpi","platform":"android"},{"src":"resources/android/splash/drawable-land-ldpi-screen.png","density":"land-ldpi","platform":"android"},{"src":"resources/android/splash/drawable-land-mdpi-screen.png","density":"land-mdpi","platform":"android"},{"src":"resources/android/splash/drawable-land-xhdpi-screen.png","density":"land-xhdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-hdpi-screen.png","density":"port-hdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-ldpi-screen.png","density":"port-ldpi","platform":"android"},{"src":"resources/android/splash/drawable-port-mdpi-screen.png","density":"port-mdpi","platform":"android"},{"src":"resources/android/splash/drawable-port-xhdpi-screen.png","density":"port-xhdpi","platform":"android"}]
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-hdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-hdpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-ldpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-ldpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-mdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-mdpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-land-xhdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-land-xhdpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-hdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-hdpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-ldpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-ldpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-mdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-mdpi\screen.png
1>  copying image from D:\Users\......\stapp\resources\android\splash\drawable-port-xhdpi-screen.png to D:\Users\......\stapp\platforms\android\res\drawable-port-xhdpi\screen.png
1>  updated project successfully
1>  Executing "after_prepare"  hook for all plugins.
1>  Running command: C:\Users\Nick\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm\2.14.9\node.exe D:\Users\......\stapp\hooks\after_prepare\010_add_platform_class.js D:\Users\......\stapp
1>  add to body class: platform-android
1>  Command finished with error code 0: C:\Users\Nick\AppData\Roaming\Microsoft\VisualStudio\MDA\vs-npm\2.14.9\node.exe D:\Users\......\stapp\hooks\after_prepare\010_add_platform_class.js,D:\Users\......\stapp
1>  ------ Copied D:\Users\......\stapp\bin\Android\Release\VSBuildInfo.xml to platforms\android\assets\www\VSBuildInfo.xml
1>  ------ Building platform: android
1>  Release
1>  ------ Build configuration options: --release
1>  Executing "before_compile"  hook for all plugins.
1>  ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
1>  JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71
1>  Reading build config file: D:\Users\......\stapp\build.json
1>  Reading the keystore from: d:\downloads\gwdandapp.keystore
1>
1>MSBUILD : cordova-build error : FAILURE: Build failed with an exception.
1>  FAILURE: Build failed with an exception.
1>
1>MSBUILD : cordova-build error : * What went wrong:
1>  * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1>  A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Could not resolve all dependencies for configuration ':_debugCompile'.
1>  > Could not resolve all dependencies for configuration ':_debugCompile'.
1>MSBUILD : cordova-build error :  > Could not find any version that matches com.android.support:support-v4:+.
1>     > Could not find any version that matches com.android.support:support-v4:+.
1>MSBUILD : cordova-build error :  Searched in the following locations:
1>       Searched in the following locations:
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
1>           https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
1>MSBUILD : cordova-build error :  https://repo1.maven.org/maven2/com/android/support/support-v4/
1>           https://repo1.maven.org/maven2/com/android/support/support-v4/
1>MSBUILD : cordova-build error :  Required by:
1>       Required by:
1>MSBUILD : cordova-build error :  :android:unspecified
1>           :android:unspecified
1>
1>MSBUILD : cordova-build error : * Try:
1>  * Try:
1>
1>MSBUILD : cordova-build error : Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>  BUILD FAILED
1>
1>  Total time: 1.938 secs
1>  ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>  You may not have the required environment or OS to build this project
1>MSBUILD : cordova-build error : Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
1>  Error code 1 for command: cmd with args: /s,/c,"D:\Users\......\stapp\platforms\android\gradlew cdvBuildRelease -b D:\Users\......\stapp\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

1 回答

  • 1

    您是否尝试使用Android SDK更新Android支持存储库和Android支持库?这通常是构建失败的原因,这种类型的行出现在您的日志中:

    Could not find any version that matches com.android.support:support-v4:+
    

相关问题