我正在使用PhoneGap来构建应用程序。 应用程序在模拟器上正常运行,但是当将推送通知插件添加到项目时,它会产生构建错误。 我搜索了这个问题...最初它被发现是许多人的常见问题...尝试了所有解决方案......但仍然存在相同的构建错误。
这是插件
sudo cordova plugin add phonegap-plugin-push
其中一个解决方案是试用推送通知的1.2.3版本,即
sudo cordova plugin add phonegap-plugin-push@1.2.3
使用此版本时没有错误,但旧版本需要使用最新版本的解决方案。 最新的是在Windows机器上工作,但不在MAC上。
以下是使用最新版本时的详细错误
ANDROID_HOME=/Users/bunty/Library/android-sdk-macosx
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home
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-v13:23+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v13/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v13/
Required by:
:android:unspecified
> Could not find any version that matches com.google.android.gms:play-services-gcm:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
https://repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
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: 37.885 secs
Error: Error code 1 for command: /Users/bunty/Documents/ParsianaApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/bunty/Documents/ParsianaApp/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
有人可以为此提供帮助吗?
答案 0 :(得分:1)
如果您阅读install guide
您需要确保已安装以下项目 通过Android SDK Manager:
- (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; [self.tableView setEditing:editing animated:animated]; // not needed if super is a UITableViewController if (!self.swipeMode) { NSMutableArray* paths = [[NSMutableArray alloc] init]; // fill paths of insertion rows here if( editing ) [self.tableView insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationBottom]; else [self.tableView deleteRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationBottom]; [paths release]; } }
您可以手动或使用此命令执行此操作:
Android Support Library version 23 or greater
Android Support Repository version 20 or greater
Google Play Services version 27 or greater
Google Repository version 22 or greater
答案 1 :(得分:0)
不要使用sudo进行安装。它会导致权限问题。