簡體   English   中英

Cordova地理位置插件和Cordova Firebase插件沖突

[英]Cordova geolocation plugin & cordova firebase plugin conflicting

使用兩個插件時,我遇到了這個問題: cordova-plugin-geolocation-firebasecordova-plugin-firebase 似乎他們兩個都試圖添加擴展googleServices ,這導致構建失敗。 任何對此的幫助將非常有幫助:)

FAILURE: Build failed with an exception.

* Where:
Script 'app/platforms/android/cordova-support-google-services/www-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 3s
app/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* Where:
Script 'app/platforms/android/cordova-support-google-services/www-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.

謝謝。

這是我的AndroidManifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" android:versionCode="2" android:versionName="0.0.2" package="kz.starget.www" xmlns:android="http://schemas.android.com/apk/res/android">
    <supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true" />
    <uses-permission android:name="android.permission.INTERNET" />
    <application android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true">
        <activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <meta-data android:name="com.transistorsoft.locationmanager.license_key" android:value="" />
        <service android:exported="true" android:name="com.transistorsoft.cordova.backgroundfetch.HeadlessJobService" android:permission="android.permission.BIND_JOB_SERVICE" />
        <receiver android:name="com.transistorsoft.cordova.backgroundfetch.HeadlessBroadcastReceiver">
            <intent-filter>
                <action android:name="${applicationId}.event.BACKGROUND_FETCH" />
            </intent-filter>
        </receiver>
        <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths" />
        </provider>
        <activity android:label="@string/multi_app_name" android:name="com.synconset.MultiImageChooserActivity" android:theme="@style/Theme.AppCompat.Light" />
    </application>
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.BLUETOOTH" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-feature android:name="android.hardware.telephony" android:required="false" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

更改Projected.properties文件,替換那些

cordova.system.library.4=com.google.android.gms:play-services-gcm:11.0.1
cordova.system.library.5=com.google.android.gms:play-services-location:11.0.1

那些與你的問題有關

https://github.com/jeduan/cordova-plugin-facebook4/issues/507

https://forum.ionicframework.com/t/failed-to-apply-plugin-class-com-google-gms-googleservices-googleservicesplugin/101086/11

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM