我正在尝试通过Visual Studio 2015插件安装来安装Phonegap Push Notification Plugin。我能够在项目中成功添加推送通知插件。
但是,当我构建解决方案时,我收到错误,如下所示。 以下是输出日志
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Rebuild All started: Project: work, Configuration: Debug Android ------
1> Buildfile: c:\Users\deep.mehta\Documents\Visual Studio 2015\Projects1\work\work\platforms\android\build.xml
1> [taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
1>
1> -check-env:
1> [checkenv] Android SDK Tools Revision 23.0.0
1> [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk
1>
1> -setup:
1> [echo] Project Name: MainActivity
1> [gettype] Project Type: Application
1>
1> -pre-clean:
1>
1> clean:
1> [getlibpath] Library dependencies:
1> [getlibpath]
1> [getlibpath] ------------------
1> [getlibpath] Ordered libraries:
1> [taskdef] Could not load definitions from resource emma_ant.properties. It could not be found.
1>
1> nodeps:
1>
1> -check-env:
1> [checkenv] Android SDK Tools Revision 23.0.0
1> [checkenv] Installed at C:\Program Files (x86)\Android\android-sdk
1>
1> -setup:
1> [echo] Project Name: MainActivity
1> [gettype] Project Type: Android Library
1>
1> -pre-clean:
1>
1> clean:
1>
1> BUILD SUCCESSFUL
1> Total time: 0 seconds
1> Picked up _JAVA_OPTIONS: -Xmx512M
1> Your environment has been set up for using Node.js 0.10.33 (ia32) and npm.
1> ------ Ensuring correct global installation of package from source package directory: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\ApacheCordovaTools\packages\vs-tac
1>
1> c:\users\deep.mehta\documents\visual studio 2015\Projects1\work\work>"C:\Users\deep.mehta\AppData\Roaming\npm\\node_modules\vs-tac\vs-tac-cli.cmd" build --platform Android --configuration Debug --projectDir . --projectName work --npmInstallDir C:\Users\deep.mehta\AppData\Roaming\npm --language en-US --buildTarget AndroidDevice
1> ------ Cordova tools 4.3.0 already installed.
1> ------ Build Settings:
1> ------ Build Settings:
1> ------ platformConfigurationBldDir: c:\users\deep.mehta\documents\visual studio 2015\Projects1\work\work\bld\Android\Debug
1> ------ platformConfigurationBinDir: c:\users\deep.mehta\documents\visual studio 2015\Projects1\work\work\bin\Android\Debug
1> ------ buildCommand: build
1> ------ platform: Android
1> ------ cordovaPlatform: android
1> ------ configuration: Debug
1> ------ cordovaConfiguration: Debug
1> ------ projectName: work
1> ------ projectSourceDir: c:\users\deep.mehta\documents\visual studio 2015\Projects1\work\work
1> ------ npmInstallDir: C:\Users\deep.mehta\AppData\Roaming\npm
1> ------ buildTarget: AndroidDevice
1> ------ language: en-US
1> ------ Platform android already exists
1> ------ Copying native files from c:\users\deep.mehta\documents\visual studio 2015\Projects1\work\work\res\native\android to platforms\android
1> ------ Done copying native files to platforms\android
1> ------ Updating plugins
1> ------ Currently installed plugins: org.apache.cordova.device@0.3.0
1> ------ Currently installed dependent plugins:
1> ------ Currently configured plugins: org.apache.cordova.device@0.3.0,com.phonegap.plugins.PushPlugin@2.5.0
1> ------ Adding plugin: com.phonegap.plugins.PushPlugin@2.5.0
1> Calling plugman.fetch on plugin "com.phonegap.plugins.PushPlugin@2.5.0"
1> Fetching plugin "com.phonegap.plugins.PushPlugin@2.5.0" via plugin registry
1>MDAVSCLI : npm error : 404 Not Found: com.phonegap.plugins.PushPlugin
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
我尝试过手动添加插件的其他工作,即在本地添加相同的错误。创建新项目并尝试安装推送通知插件但获得相同的结果。如果我删除推送通知并构建解决方案,它的工作原理。 我使用的视觉工作室的版本是
答案 0 :(得分:1)
您可以使用命令行安装它(首先更改目录):
cordova plugin add https://github.com/phonegap-build/PushPlugin.git
如果那些人不能工作:
cd C:\SomePath
git clone https://github.com/phonegap-build/PushPlugin.git
cordova plugin add C:\SomePath\PushPlugin
如果使用PhoneGap,则命令为:
phonegap local plugin add https://github.com/phonegap-build/PushPlugin.git
phonegap local plugin add C:\SomePath\PushPlugin