-
-
Notifications
You must be signed in to change notification settings - Fork 857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8.4.0 broke Android build with custom version of the Mapbox SDK #1601
Comments
hi @doomsower, thanks for bringing this to our attention 🙇🏿 Can you clarify against which Android version you're building. Cheers 🍻 |
@ferdicus Here's my buildscript {
ext {
ndkVersion = "21.4.7075529"
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "28.0.0"
kotlinVersion = "1.5.21"
appCompatVersion = "1.3.1"
swiperefreshlayoutVersion = "1.1.0"
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:1.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
} And it worked with |
@doomsower, can you also please post your |
Here they are: dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
// Require by detox
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'
// Required by react-navigation
implementation("androidx.appcompat:appcompat:${rootProject.ext.appCompatVersion}")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:${rootProject.ext.swiperefreshlayoutVersion}")
// Required by mapbox
// https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md#mapbox-maps-sdk
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0'
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
debugDetoxImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
releaseStagingImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
} |
Thanks 🙇🏿 |
BTW one should be able to use the customisation points made for MapLibre, to change all the mapbox related libs, it can be used for different mabox version as well as for maplibre https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md#using-maplibre |
ah, yes - we should probably point that our more prominently in the guide |
I can verify this issue @doomsower - looking into a solution |
hmm, I can't seem to get rid of the duplicate class issue 😕 Things I tried: implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.1') {
exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-telemetry'
} resolution strategy configurations.all {
resolutionStrategy {
force 'com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0'
}
} your hunch is right @doomsower, when I remove the dependency I've seen, that with release 9.6.2 mapbox introduced:
@mfazekas, any ideas for this? |
@doomsower , I was able to build without the mentioned error with this solution: Add this block to rnmbglMapboxLibs = {
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.8.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0'
} This will overwrite our packages dependencies here: Notice I used android/rctmgl/src/main/java/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.java:510: error: <anonymous com.mapbox.rctmgl.components.mapview.RCTMGLMapView$6> is not abstract and does not override abstract method onAnnotationClick(com.mapbox.mapboxsdk.plugins.annotation.Symbol) in com.mapbox.mapboxsdk.plugins.annotation.OnAnnotationClickListener
symbolManager.addClickListener(new OnSymbolClickListener() {
^
android/rctmgl/src/main/java/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.java:512: error: onAnnotationClick(com.mapbox.mapboxsdk.plugins.annotation.Symbol) in <anonymous com.mapbox.rctmgl.components.mapview.RCTMGLMapView$6> cannot implement onAnnotationClick(T) in com.mapbox.mapboxsdk.plugins.annotation.OnAnnotationClickListener
public void onAnnotationClick(Symbol symbol) {
^
return type void is not compatible with boolean
android/rctmgl/src/main/java/com/mapbox/rctmgl/components/mapview/RCTMGLMapView.java:511: error: method does not override or implement a method from a supertype
@Override Also notice, that you're still using most of the default plugins, I've not checked those with updated versions: You can also overwrite/ disable them with the same approach as above, instead So in essence, using the method Miklós mentioned 😅 Can you please try and report back, would be swell - thanks in advance 🙇🏿 |
@ferdicus I've deleted my patch and also deleted all mapbox references from buildscript {
ext {
ndkVersion = "21.4.7075529"
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
supportLibVersion = "28.0.0"
kotlinVersion = "1.5.21"
appCompatVersion = "1.3.1"
swiperefreshlayoutVersion = "1.1.0"
// Required by mapbox
// https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md#mapbox-maps-sdk
rnmbglMapboxLibs = {
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.7.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:5.8.0'
}
rnmbglMapboxPlugins = {
implementation "com.mapbox.mapboxsdk:mapbox-android-gestures:0.7.0"
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v9:0.14.0"
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.8.0"
implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-markerview-v9:0.4.0"
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.8.0'
}
}
...
Seems to be working in both dev and prod builds. Dependency tree contains only one version of telemetry lib, I think I tried this approach originally, but it was not clear to me what goes into |
yeah, agreed it's a bit opaque. Closing this ticket and gonna update the docs a bit. Thanks for your patience and support on this @doomsower 🙇🏿 |
Describe the bug
I have customized
app/build.gradle
as described here in android installation guide to use latest version of native sdk:Expected behavior
My app was building and running fine with version 8.3.0, so I expected it continue working after upgrade to 8.4.0
Actual behavior
I'm getting build error:
It seems that #1550 affects breaks versions, so I had to monkey-patch to remove mapbox-android-telemetry-6.1.0 from react-native-mapbox-gl/maps dependencies as a workaround
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: