[SOLVED] ConnectSDK Plugin Failing to Build for Mobile

Hey everyone,

I’m having a problem getting an Android app that uses the ConnectSDK cordova plugin to build. There’s an error that occurs while trying to build the ConnectSDK that causes the build to fail and I can’t figure out how to solve it easily.

These are the steps to reproduce the problem I run form the command line with their respective outputs:

  1. meteor create connectsdk-test
  2. cd connectsdk-test
  3. meteor add-platform android
  4. meteor add cordova:cordova-plugin-connectsdk@1.6.0
  5. meteor run android-device --verbose

It seems to be having a problem due to the generated gradle file:

error: Untracked working tree file ‘build.gradle’ would be overwritten by merge.
fatal: unable to checkout working tree

Does anyone know what could be causing this problem?

1 Like

With much fumbling and many wasted working hours, I finally got the ConnectSDK plugin for Cordova to build. The problem really was the auto-generated builde.gradle file. I consider it the problem because using plain Cordova and not Meteor’s integrated version works just fine for including the ConnectSDK plugin.

SOLUTION:
Since the plugin wanted to clone, checkout, and update submodules to install itself, I completely removed all those steps because I couldn’t get rid of the build.gradle file. This leads to one solution: do all the install steps before hand and put the resulting plugin code into my own repository and have my app depend on the new repository instead of the regular ConnectSDK plugin’s repository. This is not ideal and quite a hassle when updates come out for the ConnectSDK but will have to do the trick for now.

1 Like