ionic(ionic CLI):4.2.1(/usr/lib/node_modules/ionic)ionic框架:ionic-Angular 3.9.2@ionic/App-脚本:3.2.1
科尔多瓦:
cordova(cordova CLI):8.1.2(Cordova-lib@8.1.1)cordova平台:android 7.1.2、浏览器5.0.4 cordova插件:cordova-plugin-ionic-keyboard 2.1.3、cordova-plugin-ionic-webview 2.2.5(和23个其他插件)
系统:
Android SDK工具:26.1.1(/home/hitesh/Android/SDK)NodeJS:V8.11.3(/usr/bin/node)npm:6.4.1OS:Linux 4.13
cordova插件列表
cordova-open-native-settings 1.5.1 "Native settings"
cordova-plugin-actionsheet 2.3.3 "ActionSheet"
cordova-plugin-advanced-http 2.0.1 "Advanced HTTP plugin"
cordova-plugin-bg-location-sender 2.1.2 "BGLocationSender"
cordova-plugin-camera 4.0.3 "Camera"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-dialogs 2.0.1 "Notification"
cordova-plugin-email-composer 0.8.15 "EmailComposer"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-geolocation 4.0.1 "Geolocation"
cordova-plugin-googlemaps 2.4.6 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 2.2.5 "cordova-plugin-ionic-webview"
cordova-plugin-nativeaudio 3.0.9 "Cordova Native Audio"
cordova-plugin-nativegeocoder 3.1.3 "NativeGeocoder"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-request-location-accuracy 2.2.3 "Request Location Accuracy"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-socialsharing 5.4.3 "SocialSharing"
cordova-support-google-services 1.1.0 "cordova-support-google-services"
es6-promise-plugin 4.2.2 "Promise"
mx.ferreyra.callnumber 0.0.2 "Cordova Call Number Plugin"
paywitheasebuzz-cordova-plugin 0.0.1 "easebuzz-cordova-kit"
phonegap-plugin-multidex 1.0.0 "Multidex"
phonegap-plugin-push 2.2.3 "PushPlugin"
uk.co.workingedge.phonegap.plugin.launchnavigator 4.2.2 "Launch Navigator"
:app:processDebugGoogleServices
Parsing json file: /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/google-services.json
:app:mergeDebugResources
[string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
[string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
:app:mergeDebugResources FAILED
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
[string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
[string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
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
What went wrong:
Execution failed for task ':app:mergeDebugResources'.
[string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_app_id] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
[string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/src/main/res/values/strings.xml [string/google_api_key] /home/hitesh/Documents/IONIC/APPLICATIONS/Taxiwala/IN_taxiwala/platforms/android/app/build/generated/res/google-services/debug/values/values.xml: Error: Duplicate resources
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
生成在23s内失败
添加project build.gradle/project/Platforms/Android/build.gradle:
buildscript {
repositories {
jcenter ()
maven {
url "https://maven.google.com"
}
Google()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.3'
// Firebase
classpath 'com.google.gms: google-services: 4.0.0'
}
}
并添加模块build.gradle/project/platforms/android/app/build.gradle:
buildscript {
repositories {
mavenCentral ()
jcenter ()
maven {
url "https://maven.google.com"
}
Google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// Firebase
classpath 'com.google.gms: google-services: 4.0.0'
classpath 'com.google.firebase: firebase-core: 16.0.0'
}
}
// Firebase, add at the end of the same file
apply plugin: 'com.google.gms.google-services'
解决方案:
buildscript {
repositories {
jcenter ()
maven {
url "https://maven.google.com"
}
Google()
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.3'
// Firebase
// classpath 'com.google.gms: google-services: 4.0.0'
}
}
文件:/project/platforms/android/app/build.gradle:
buildscript {
repositories {
mavenCentral ()
jcenter ()
maven {
url "https://maven.google.com"
}
Google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// Firebase
//classpath 'com.google.gms: google-services: 4.0.0'
//classpath 'com.google.firebase: firebase-core: 16.0.0'
}
}
// Firebase, add at the end of the same file
//apply plugin: 'com.google.gms.google-services'
完成这些步骤后,一切工作正常,我能够运行$cordova build android
而没有任何问题。
建议:如果出现其他错误,请尝试删除插件和平台,然后重新创建:
$ ionic cordova plugin rm cordova-plugin-bg-location-sender --save
$ ionic cordova platform rm android
$ ionic cordova plugin add cordova-plugin-bg-location-sender --save
$ ionic cordova platform add android
null 这里建议的解决方案如下:将google-services.json复制到目录,但这会产生另一个错误: 失败:生成失败,出现异常。 PS:我尝试了SO中提出的几种修复方法,但都没有解决我的问题,有没有人可以帮助我?
我使用Cordova创建了一个应用程序,然后按照说明准备该应用程序与Firebase插件集成: null :App:ProcessDebugGoogleServices失败 失败:生成失败,出现异常。 *错误:任务“:app:ProcessDebugGoogleServices”执行失败。>文件google-services.json丢失。没有它,Google服务插件就无法运行。搜索位置:/mya
然后我尝试“Cordova build Android”并收到以下错误: 错误:在构建android项目时发生了一个错误。请安装Android Target17(Android最新SDK)。确保你也安装了最新的Android工具。从命令行运行“Android”来安装/更新任何丢失的SDK或工具。 所以我运行了“Android”,安装了与目标17相关的一切。 有什么想法/建议吗?
我试图用visual studio community 2015构建一个android应用程序。基本上现在,我只是试图构建一个测试应用程序,这样我就可以检查IDE是否适合构建我的主要应用程序!但当我试图构建应用程序时,它显示了错误。下面是VS中的输出错误消息- 这是VS中的完整错误消息输出。请帮助我解决这个问题,并建立我的应用程序成功!
1-我安装了PushWoosh:cordova插件添加https://github.com/PushWoosh/pushwoosh-phoneGap-3.0-plugin.git 2-PushWoosh代码: 3-构建项目时使用:cordova build android 生成失败/users/newAccount/opt/android-sdk/tools/ant/BUILD.xml:892:执