Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Android build failing when some other plugins are installed #105

Open
hassanthegooner opened this issue Mar 2, 2018 · 5 comments
Open
Labels

Comments

@hassanthegooner
Copy link

hassanthegooner commented Mar 2, 2018

Hi,

I've created a clean Ionic project with the default plugins and added this plugin:

   <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-device" spec="^2.0.1" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="com.couchbase.lite.phonegap" spec="~1.4.1" />

The Android build passes at this point. I then installed the cordova-background-geolocation-lt plugin , removed and added the Android platform and ran the build again. The build fails. Clearly there's an incompatibility with the plugin. Can this be resolved?

The creators of the cordova-background-geolocation-lt plugin say that all plugins must use the same version of play-services for the Android build to pass:

Many other plugins require Google Play Services and/or Firebase libraries. This is a common source of Android build-failures, since the play-services library version must be aligned to the same version for all plugins. For example, when one plugin imports version 11.0.1 and another one imports 11.2.0, a gradle build failure will occur. Use the GOOGLE_API_VERSION to align the required play-services version with other plugins.

Maybe that's the issue and can it be fixed fast?

It's worth noting that there are other plugin incompatibilities when using this plugin e.g. the plugin does not work on iOS when using WKWebView.

@christocracy
Copy link

There's a huge issue with this plugin since it imports dependencies as static jar files. This is not how things are done anymore.

Plugins importing static jar files should be avoided.

Cordova plugins should import dependencies using gradle, eg:

repositories{    
  jcenter()  
  // Google dependencies are now hosted at Maven
  maven {
    url 'https://maven.google.com'
  }
  maven {
    url 'src/android/libs'
  }
}

dependencies {    
  compile 'com.squareup.okhttp3:okhttp:3.10.0'
  .
  .
  .
}

@AlphaCreativeDev
Copy link

We are also encountering this issue. Is this plugin still being maintained?

@christocracy
Copy link

Cordova Android dependencies should be imported using <framework /> tag.

eg:

<platform name="android">
   .
   .
   .
  <framework src="com.squareup.okhttp3:okhttp:3.10.0" />
</platform>

@geraldapeoples
Copy link

Has anyone had any success with https://github.com/cloudant/sync-android? ... with the recent release of couchbase lite we see support for cordova completely dropped ... perhaps cloudant is the solution?

@MikeBecatti
Copy link

I'm in the process of implementing this Cordova plugin: https://github.com/litehelpers/Cordova-sqlite-storage

@djpongh djpongh added the icebox label Jan 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants