科尔多瓦建立失败

时间:2019-03-05 23:51:29

标签: cordova ionic-framework gradle cordova-plugins

因此,我尝试在我的(正在运行的)Ionic应用程序中安装一个新插件,该插件应为https://ionicframework.com/docs/native/firebase-dynamic-links/

我遇到了一个奇怪的错误,所以我尝试了一些尝试,最终回到了使用git reset来完全撤消所做操作的位置。

...但是错误不会消失。

我试图升级Cordova和Ionic,再次删除node_modules和npm install,然后删除并重新添加Android平台...没有任何帮助。

cordova build android
cordova-android-firebase-gradle-release: Android platform: V7+
cordova-android-firebase-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\JB\Dropbox\dev\azkara\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\JB\Dropbox\dev\azkara\platforms\android\cordova-android-support-gradle-release\azkara-cordova-android-support-gradle-release.gradle
Android Studio project detected
config file res/values/facebookconnect.xml requested for changes not found at C:\Users\JB\Dropbox\dev\azkara\platforms\android\res\values\facebookconnect.xml, ignoring
config file res/values/facebookconnect.xml requested for changes not found at C:\Users\JB\Dropbox\dev\azkara\platforms\android\res\values\facebookconnect.xml, ignoring
config file res/values/facebookconnect.xml requested for changes not found at C:\Users\JB\Dropbox\dev\azkara\platforms\android\res\values\facebookconnect.xml, ignoring
cordova-android-firebase-gradle-release: Android platform: V7+
cordova-android-firebase-gradle-release: No custom version found in config.xml - using plugin default
cordova-android-support-gradle-release: Android platform: V7+
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\JB\Dropbox\dev\azkara\platforms\android\app\build.gradle
cordova-android-support-gradle-release: Wrote custom version '27.+' to C:\Users\JB\Dropbox\dev\azkara\platforms\android\cordova-android-support-gradle-release\azkara-cordova-android-support-gradle-release.gradle
Preparing Firebase on Android
ANDROID_HOME=C:\Users\JB\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_171
studio
:wrapper

BUILD SUCCESSFUL in 0s
1 actionable task: 1 executed
Subproject Path: CordovaLib
Subproject Path: app
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
+-----------------------------------------------------------------
| cordova-android-firebase-gradle-release: 15.+
+-----------------------------------------------------------------
+-----------------------------------------------------------------
| cordova-android-support-gradle-release: 27.+
+-----------------------------------------------------------------
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_889mq4973ul5dy09k37yyn7v6.run(C:\Users\JB\Dropbox\dev\azkara\platforms\android\app\build.gradle:155)

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\JB\Dropbox\dev\azkara\platforms\android\cordova-support-google-services\azkara-build.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
   > Cannot add extension with name 'googleServices', as there is an extension already registered with that name.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\JB\Dropbox\dev\azkara\platforms\android\cordova-support-google-services\azkara-build.gradle' line: 16

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
   > Cannot add extension with name 'googleServices', as there is an extension already registered with that name.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
[ERROR] An error occurred while running subprocess cordova.

我真的需要帮助来了解到底发生了什么以及如何克服它。

1 个答案:

答案 0 :(得分:0)

好的,终于让它工作了。删除了plugins文件夹,在我的插件列表中删除了不必要的东西,删除了node_modules文件夹,删除了Android平台,升级了所有内容,重新安装了所有内容(如果需要,您可以将ionic cordova prepare用于插件,或者如果您删除了Android平台,则将其重新添加将可以获取插件)。构建。