Visual Studio中的Cordova项目无法在Android上构建:找不到com.Android。支持:support-v4

Visual Studio中的Cordova项目无法在Android上构建:找不到com.Android。支持:support-v4,android,cordova,phonegap-plugins,visual-studio-cordova,Android,Cordova,Phonegap Plugins,Visual Studio Cordova,当我尝试在Visual Studio 2017中为Android构建使用phonegap插件barcodescanner插件的Cordova项目时,我得到以下错误: 1>MSBUILD : cordova-build error : * What went wrong: 1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'. 1>MSBUILD : cord

当我尝试在Visual Studio 2017中为Android构建使用phonegap插件barcodescanner插件的Cordova项目时,我得到以下错误:

1>MSBUILD : cordova-build error : * What went wrong:
1>MSBUILD : cordova-build error : A problem occurred configuring root project 'android'.
1>MSBUILD : cordova-build error : > Could not resolve all dependencies for configuration ':_debugCompile'.
1>MSBUILD : cordova-build error :  > Could not find any matches for com.android.support:support-v4:+ as no versions of com.android.support:support-v4 are available.
1>MSBUILD : cordova-build error :  Searched in the following locations:
1>MSBUILD : cordova-build error :  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>MSBUILD : cordova-build error :  https://jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml
1>MSBUILD : cordova-build error :  https://jcenter.bintray.com/com/android/support/support-v4/
1>MSBUILD : cordova-build error :  file:/C:/Users/ischemm/Git/engage-cordova-app/engage-cordova-app/platforms/android/libs/
1>MSBUILD : cordova-build error :  file:/C:/ProgramData/Microsoft/AndroidSDK/25/extras/android/m2repository/com/android/support/support-v4/maven-metadata.xml
1>MSBUILD : cordova-build error :  file:/C:/ProgramData/Microsoft/AndroidSDK/25/extras/android/m2repository/com/android/support/support-v4/
1>MSBUILD : cordova-build error :  Required by:
1>MSBUILD : cordova-build error :  :android:unspecified
1>MSBUILD : cordova-build error : * Try:
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>MSBUILD : cordova-build error : Picked up _JAVA_OPTIONS: -Xmx512M

使用Android SDK管理器(工具>Android>Android SDK管理器)

首先,将Android SDK的目录更改为Visual Studio的安装目录,通常为:

C:\ProgramData\Microsoft\AndroidSDK\{version}
(请注意,C:\ProgramData是一个隐藏文件夹,因此您需要更改文件资源管理器设置以使隐藏文件夹可见。)

然后卸载并重新安装Android支持存储库,在Extras下列出