我正在尝试将推送通知添加到空白的VS2017 Cordova应用程序中,但看起来Cordova版本6.3.1可能还不够。 (警告:插件不支持此项目的cordova版本.cordova:6.3.1,版本要求失败:> = 7.1.0)
无论如何在Visual Studio中更新此内容? 微软团队是否可能放弃Cordova?这似乎很可疑。
Installing plugin 'phonegap-plugin-push'
No scripts found for hook "before_plugin_add".
No version specified for phonegap-plugin-push, retrieving version from config.xml
No version for phonegap-plugin-push saved in config.xml
Attempting to use npm info for phonegap-plugin-push to choose a compatible release
Running command: cmd "/s /c "C:\WSP\App\BlankCordovaApp3\platforms\android\cordova\version.bat""
Command finished with error code 0: cmd /s /c "C:\WSP\App\BlankCordovaApp3\platforms\android\cordova\version.bat"
Warning: Unmet project requirements for latest version of phonegap-plugin-push:
Unmet project requirements for latest version of phonegap-plugin-push:
Warning: cordova-android (5.2.1 in project, >=7.1.0 required)
cordova-android (5.2.1 in project, >=7.1.0 required)
Warning: cordova (6.3.1 in project, >=7.1.0 required)
cordova (6.3.1 in project, >=7.1.0 required)
Warning: Current project does not satisfy the engine requirements specified by any version of phonegap-plugin-push. Fetching latest version of plugin anyway (may be incompatible)
Current project does not satisfy the engine requirements specified by any version of phonegap-plugin-push. Fetching latest version of plugin anyway (may be incompatible)
Calling plugman.fetch on plugin "phonegap-plugin-push"
Fetching plugin "phonegap-plugin-push" via npm
Copying plugin "C:\Users\randall.tomes\AppData\Roaming\npm-cache\phonegap-plugin-push\2.2.2\package" => "C:\WSP\App\BlankCordovaApp3\plugins\phonegap-plugin-push"
Calling plugman.install on plugin "C:\WSP\App\BlankCordovaApp3\plugins\phonegap-plugin-push" for platform "android
Installing "phonegap-plugin-push" for android
Running command: cmd "/s /c "C:\WSP\App\BlankCordovaApp3\platforms\android\cordova\version.bat""
Command finished with error code 0: cmd /s /c "C:\WSP\App\BlankCordovaApp3\platforms\android\cordova\version.bat"
Warning: Plugin doesn't support this project's cordova version. cordova: 6.3.1, failed version requirement: >=7.1.0
Plugin doesn't support this project's cordova version. cordova: 6.3.1, failed version requirement: >=7.1.0
Warning: Skipping 'phonegap-plugin-push' for android
Skipping 'phonegap-plugin-push' for android
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at C:\WSP\App\BlankCordovaApp3\platforms\android\res\xml\config.xml
Merging project's config.xml into platform-specific android config.xml
Found "merges/android" folder. Copying its contents into the android project.
Merging and updating files from [www, platforms\android\platform_www, merges\android] to platforms\android\assets\www
copy platforms\android\platform_www\cordova_plugins.js platforms\android\assets\www\cordova_plugins.js (updated file)
Wrote out android application name "some game" to C:\WSP\App\BlankCordovaApp3\platforms\android\res\values\strings.xml
android-versionCode not found in config.xml. Generating a code based on version in config.xml (1.0.0): 10000
Wrote out Android package name "com.testapp.somegame" to C:\WSP\App\BlankCordovaApp3\platforms\android\src\com\testapp\somegame\MainActivity.java
Updating icons at platforms\android\res
Updating splash screens at platforms\android\res
Prepared android project successfully
No scripts found for hook "after_plugin_add".
Done
答案 0 :(得分:0)
看看Taco roadmap - Update 11 with Cordova 7 support
在我的回答中,我已报告如何将 TACO 升级为 cordova 7.1.0 :
请按照以下步骤操作:
- 在visual studio中的
在您的计算机上安装nodejs 4.8.7
进入工具>选项>"用于apache cordova的工具"和 deflag chekbox"使用沙盒版本的NodeJS"
编辑项目的 taco.json 文件并设置" cordova-cli":" 7.1.0"
打开一个新控制台并在您的计算机上安装cordova(npm install -g cordova@7.1.0)
对于android build:
- 打开提示,数字android并按返回
- 从中下载API 26 SDK 工具
- 下载gradle 2.x并将bin文件夹放入系统路径
- 安装jdk 1.8.x并将java_home系统var设置为
- 重新启动
希望它有所帮助。