maplibre-native icon indicating copy to clipboard operation
maplibre-native copied to clipboard

Upgrade libs and remove Jetifier

Open carlonzo opened this issue 3 years ago • 2 comments

Upgrade dependencies to remove com.android.support dependency and drop jetifier:

  • upgrade Google location
  • upgrade LeakCanary
  • upgrade robolectric

carlonzo avatar Jan 17 '22 09:01 carlonzo

Do you need to bump all of these at the same time? Are these all needed to remove Jetifier?

tir38 avatar Jan 25 '22 23:01 tir38

if I want to remove the Jetifier flag from the project, yes as all 3 libs depend on a com.android.support.* lib.

if the goal is just to remove com.android.support from the main library so users can drop jetifier, then no. Robolectric is just included in test config classpath and leakcanary for the demo app.

carlonzo avatar Jan 26 '22 06:01 carlonzo

Hi @carlonzo, any update on this pull request? It looks like it would be useful to get in.

ntadej avatar Aug 13 '22 18:08 ntadej

Hi @carlonzo, any update on this pull request? It looks like it would be useful to get in.

thanks @ntadej I actually forgot I didnt update this. let me update and make CI green

carlonzo avatar Aug 17 '22 20:08 carlonzo

@carlonzo , was it possible to make green ci here, or is something blocking it?

birkskyum avatar Sep 03 '22 08:09 birkskyum

I had issue building it locally and went for holidays. I've to go back to this unless someone wants to take over

carlonzo avatar Sep 03 '22 09:09 carlonzo

@birkskyum I built it locally again and everything is fine.

I am running ./gradlew --parallel --max-workers=8 -Pmapbox.buildtype=debug -Pmapbox.stl=c++_static -Dorg.gradle.internal.http.socketTimeout=360000 -Dorg.gradle.internal.http.connectionTimeout=360000 -Pmapbox.abis=none :MapboxGLAndroidSDK:testDebugUnitTest --info and is green. any tip?

carlonzo avatar Sep 11 '22 08:09 carlonzo

It could be just one of more issues, but it does mention that "Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0."

The current setup is for Gradle 3.6.3, but for some reason it's using gradle 7.

There is another PR here #456 I would love to get sorted out to remove that factor. It's an attempt at upgrading gradle, but currently, that is requiring an update of android-sdk-versions-plugin to >= v1.1.1, which for some reason isn't published to maven. @petr-pokorny-1 , @carlonzo, do you know how we can publish a new version of the android-sdk-version?

birkskyum avatar Sep 11 '22 10:09 birkskyum

Yeah actually i noticed that some time ago. I opened an issue here https://github.com/mapbox/android-sdk-versions-plugin/issues/43

Options i see : 1- we could fork and publish internally until the issue is solved? 2- could we get rid of the plugin or just disable until it is available?

carlonzo avatar Sep 11 '22 20:09 carlonzo

I'm cool with either. I'm not sure how to set up a repo to publish it, so what is the consequence of removing it in the repo?

birkskyum avatar Sep 11 '22 20:09 birkskyum

so what the plugin does is registering a task that stores a file in src/main/asset/com.mapbox.mapboxsdk with versionCode and versionName.

I cannot find where it is read. if we remove the plugin it compiles fine but maybe somewhere it fails at runtime looking for this asset. I could suggest to copy-paste the task and just have this asset file generated. best would be if we can find where this file is read and how/why its used. lets play it lazy and create the task?

carlonzo avatar Sep 12 '22 13:09 carlonzo

btw @birkskyum the "Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0." message is just a warning. this is not what is stopping the build. I found the issue. we can move the discussion about AGP upgrade and plugin removal to the PR https://github.com/maplibre/maplibre-gl-native/pull/456

carlonzo avatar Sep 12 '22 13:09 carlonzo

@birkskyum I can reproduce the issue from CI on my local. this is probably due to robolectric upgrade. the robolectric upgrade was necessary to remove jetifier so I cannot revert that change.

solution here is to update CI to compile using JDK 11. I will do that on a separate PR then we can rebase this PR once/if the patch its merged

carlonzo avatar Sep 13 '22 08:09 carlonzo

will rebase and try again once this is merged https://github.com/maplibre/maplibre-gl-native/pull/474

carlonzo avatar Sep 13 '22 08:09 carlonzo

I closed/reopened in an attempt to trigger the CI

birkskyum avatar Sep 13 '22 12:09 birkskyum

OMG finally! Thanks for the support

carlonzo avatar Sep 13 '22 20:09 carlonzo

Thank you for your efforts!

ntadej avatar Sep 13 '22 20:09 ntadej