PhoneGap构建赢得';t使用PushPlugin为Android构建
我们有一个PhoneGap应用程序,一旦我们添加了PhoneGap构建赢得';t使用PushPlugin为Android构建,android,cordova,phonegap-build,visual-studio-2015,phonegap-pushplugin,Android,Cordova,Phonegap Build,Visual Studio 2015,Phonegap Pushplugin,我们有一个PhoneGap应用程序,一旦我们添加了PushPlugin,它就会拒绝构建 特别是在使用PhoneGap构建时,我们会得到以下错误: BUILD FAILED /home/ec2-user/android-sdk/tools/ant/build.xml:573: ../../../../../../home/ec2-user/android-sdk/com.android.support:support-v4:+ resolve to a path with no project.p
PushPlugin
,它就会拒绝构建
特别是在使用PhoneGap构建时,我们会得到以下错误:
BUILD FAILED
/home/ec2-user/android-sdk/tools/ant/build.xml:573: ../../../../../../home/ec2-user/android-sdk/com.android.support:support-v4:+ resolve to a path with no project.properties file for project /project
在将PhoneGap($npm update-g PhoneGap
)和PhoneGap Android平台($PhoneGap Platform update Android
)更新到最新版本后,我们偶尔可以使用Ripple emulator(在Visual Studio中构建)来构建它
我们包含了如下插件:
<gap:plugin name="com.phonegap.plugins.pushplugin" />
<plugin name="com.phonegap.plugins.PushPlugin" spec="^2.2.1" />
我们仍然会遇到错误:
C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1>cordova build android
Running command: cmd "/s /c "C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\build.bat""
ANDROID_HOME=C:\Users\XXX\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.7.0_55
Running: C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordova
dle.daemon=true
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find any version that matches com.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
Required by:
:android:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2.897 secs
C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Dev\CordovaBlank\BlankCordovaApp1\BlankCordovaApp1\platforms\android\gradlew cdvBuildDebug -b C:\Dev\Cor
latforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\XXX\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
最近发布了新的推送插件。 请阅读(通过官方博客)并获取详细信息:
更新(2015-10-24):根据2015年9月28日的Phonegap构建博客
.
Ant
仍然可用,可以强制使用-with
发生其他相关更改,包括自动版本控制和9-patch映像验证。阅读博客文章了解详情
注意:在您最初的问题上,gradle(phonegap不正式支持)是问题所在。一些人已经解决了这个问题,他们强迫ant
在它的位置上运行。要查找其他帖子,请从该帖子向后搜索30天;主题与此类似,包括:“构建失败”。对于PhoneGap构建,请使用
强制它使用受支持的较旧版本。尝试删除插件并使用以下命令通过命令行安装:
cordova plugin add com.phonegap.plugins.pushplugin --save
您会注意到插件将显示在config.xml中,如下所示:
<gap:plugin name="com.phonegap.plugins.pushplugin" />
<plugin name="com.phonegap.plugins.PushPlugin" spec="^2.2.1" />
但它不会显示在配置设计器上,为此,请在插件标签前添加“vs:”:
<vs:plugin name="com.phonegap.plugins.PushPlugin" spec="^2.2.1" />
试试这个(不是100%的工作,而是为我工作)
删除platforms/android/project.properties中的此行
cordova.system.library.1=com.android.support:support-v4:+
如果你正在使用facebook插件(像我一样),你可以忽略下面的内容
cordova插件添加android.support.v4