Can the android build.gradle file be modified during the build process? Trying to get UXCam working on ionic

I’m trying to get UXCam work on my ionic android app and it requires me to add a dependency in the platform>android>app>build.gradle in the dependencies section.

I build my app on ionic and I can’t find a way to have the build process automatically modify the build.gradle file for me. It works if I modify it by hand, but I’m looking to automate that. Is there any way to have the gradle file be edited automatically during the build process?

Hey @trackitforward Gabriel here from UXCam.

You should be able to simply add the plugin by typing ionic cordova plugin add cordova-uxcam in your terminal.

Here’s a more detailed, yet easy guide for Ionic integration.

Please, let me know if you have any more questions.

Yes I was following that. In that document there is a line that says:

" If you are getting the following message: Failed resolution of: Lokhttp3/Callback; - Please follow this steps:

  1. Go to Platforms > Android > App > build.gradle and add the following dependency:
  2. implementation(“com.squareup.okhttp3:okhttp:4.9.3”)

This should solve the problem and the integration should be completed."

That is the line that I’m finding impossible to do using ionic build tools. I can do that manually on my local dev and it works but it’s not possible to use ionicframework build tools (which what I use to launch) because I can’t automate it. Thats what I was hoping there’d be a build script which could do that automatically? Do you have any suggestions with that?

I see, and have you tested adding the plugin with npm i cordova-plugin-okhttp on your end?

I’m assuming you’re getting the Failed resolution message, correct? Because if not, there should be no need to add it.

Please let me know