您好,在我的Cordova项目中,我正在创建自己的位置跟踪插件。当我单独运行时插件工作正常,但我还需要用于GCM的Cordova插件cordova-plugin-fcm。现在,当我运行我的项目时,我收到了这个错误。
我的plugin.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="Cordova-Location-Plugin"
version="0.0.1">
<name>Cordova-Location-Plugin</name>
<description>Cordova Plugin for Location Tracking by ACL</description>
<license>Apache 2.0</license>
<keywords>cordova,tracking,ACL,loaction,gps</keywords>
<info>
ACL Location tracking using android app
</info>
<js-module src="www/LocationPlugin.js" name="locationTracking">
<clobbers target="LocationPlugin" />
</js-module>
<engines>
<engine name="cordova-android" version=">=4.0.0" />
</engines>
<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="Cordova-Location-Plugin">
<param name="android-package" value="com.location.locationPlugin"/>
</feature>
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature
android:name="android.hardware.location"
android:required="true" />
<uses-feature
android:name="android.hardware.location.gps"
android:required="true" />
</config-file>
<config-file target="AndroidManifest.xml" parent="/manifest/application">
<activity
android:name="com.location.locationPlugin"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service
android:name="com.location.service.locationService"
android:enabled="true"
android:exported="true"></service>
</config-file>
<framework src="com.android.support:appcompat-v7:21+" />
<framework src="com.google.android.gms:play-services:10+" />
<framework src="com.android.support:support-v4:23+" />
<framework src="src/android/Cordova-Location-Plugin.gradle" custom="true" type="gradleReference" />
<source-file src="src/android/locationPlugin.java" target-dir="src/com/location/" />
<source-file src="src/android/service/locationService.java" target-dir="src/com/location/service" />
<!-- <source-file src="src/android/org.apache.http.legacy.jar" target-dir="libs/org.apache.http.legacy.jar" />-->
<source-file src="src/android/org.apache.http.legacy.jar" target-dir="libs/" />
</platform>
</plugin>
我的Cordova-Location-Plugin.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
//useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.getlocation"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile files('libs/org.apache.http.legacy.jar')
//compile 'com.google.android.gms:play-services:10.0.1'
//compile 'com.android.support:support-v4:25.1.0'
compile 'com.loopj.android:android-async-http:1.4.9'
}
错误我得到了
:processDebugGoogleServices
Found com.google.android.gms:play-services:10+, but version 9.0.0 is needed for
the google-services plugin.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-s
ervices plugin (information about the latest version is available at https://bin
tray.com/android/android-tools/com.google.gms.google-services/) or updating the
version of com.google.android.gms to 9.0.0.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
:processDebugGoogleServices FAILED
BUILD FAILED
Total time: 2.4 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-s
ervices plugin (information about the latest version is available at https://bin
tray.com/android/android-tools/com.google.gms.google-services/) or updating the
version of com.google.android.gms to 9.0.0.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
请帮我解决这个问题。