Cordova 无法使用 cordova-plugin-local-notifications 构建
Cordova not able to build with cordova-plugin-local-notifications
我已经使用这个命令添加了通知插件:
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git
然而,当我构建应用程序时,它失败并出现以下错误。
> cordova build android --release
ANDROID_HOME=E:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
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: 4.119 secs
Error: Error code 1 for command: cmd with args: /s,/c,"E:\PhoneGap\MyApp\platforms\android\gradlew
cdvBuildRelease -b E:\PhoneGap\MyApp\platforms\android\build.gradle
-Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
我有类似的问题,我找到了解决方法。创建平台后,用android Studio
打开platform/android文件夹
在项目左侧选项卡中,左键单击 android,然后 select "Open Module Settings"
转到 "Dependencies" 选项卡,单击“+”和 "Library Dependency"
Select "support v4" 然后点击 "OK"
现在您可以构建它了。
另外,添加
也可以实现
<framework src="com.android.support:support-v4:+" />
给你的 config.xml,但对我没用
您也可以在这里获得更多信息:
https://github.com/phonegap-build/PushPlugin/issues/492
也许这对你有帮助。
请post你的结果
从@Del 那里得到提示,我安装了以下额外的,并且构建成功。我正在使用 Cordova 6.1.1
我已经使用这个命令添加了通知插件:
cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications.git
然而,当我构建应用程序时,它失败并出现以下错误。
> cordova build android --release
ANDROID_HOME=E:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
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: 4.119 secs
Error: Error code 1 for command: cmd with args: /s,/c,"E:\PhoneGap\MyApp\platforms\android\gradlew
cdvBuildRelease -b E:\PhoneGap\MyApp\platforms\android\build.gradle
-Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
我有类似的问题,我找到了解决方法。创建平台后,用android Studio
打开platform/android文件夹在项目左侧选项卡中,左键单击 android,然后 select "Open Module Settings"
转到 "Dependencies" 选项卡,单击“+”和 "Library Dependency"
Select "support v4" 然后点击 "OK"
现在您可以构建它了。
另外,添加
也可以实现<framework src="com.android.support:support-v4:+" />
给你的 config.xml,但对我没用
您也可以在这里获得更多信息:
https://github.com/phonegap-build/PushPlugin/issues/492
也许这对你有帮助。
请post你的结果
从@Del 那里得到提示,我安装了以下额外的,并且构建成功。我正在使用 Cordova 6.1.1