Skip to content
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

[Bug]: Execution failed for task ':rnmapbox_maps:compileDebugKotlin'. #3601

Closed
neilpmyers opened this issue Aug 29, 2024 · 4 comments
Closed
Labels
bug 🪲 Something isn't working reopen-on-code-fixed

Comments

@neilpmyers
Copy link

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.74.5

Platform

Android

@rnmapbox/maps version

10.1.30

Standalone component to reproduce

[email protected] android
react-native run-android

info A dev server is already running for this project on port 8081.
info Installing the app...

Task :rnmapbox_maps:compileDebugKotlin FAILED
49 actionable tasks: 8 executed, 41 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:212:5 'addView' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:227:5 'removeView' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:236:5 'removeAllViews' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt:13:5 'getChildAt' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt:17:5 'getChildCount' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt:21:5 'addView' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/styles/sources/RNMBXTileSourceManager.kt:25:5 'removeViewAt' overrides nothing
e: file:///C:/Users/npmye/Documents/testMapbox/node_modules/@rnmapbox/maps/android/src/main/rn-compat/rn75/com/rnmapbox/rnmbx/rncompat/ResourceDrawableIdHelper.kt:5:37 Unresolved reference: Companion

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':rnmapbox_maps:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 12s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

Observed behavior and steps to reproduce

I am working on a project that uses Mapbox/maps and I recently upgraded my React Native from 0.71.19 to 0.74.5, it no longer loads, giving the same error as above. After a day of testing and googling, I made a test project to see if it was a configuration/install issue or incompatibility with another package. I have followed the guides found on the repo for installing correctly I believe (again, worked fine before update). So far, no matter what I have done it always ends with the
'Execution failed for task ':rnmapbox_maps:compileDebugKotlin'.

I am running Node.js v20.17.0
package.json:
"@rnmapbox/maps": "^10.1.30",
"react": "18.2.0",
"react-native": "0.74.5"

android/build.gradle:
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
RNMapboxMapsImpl = "mapbox"
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
username = 'mapbox'
password =
}
}
}
}

To Reproduce:

  1. Create test project with RN 0.74.5
  2. npm install @rnmapbox/maps
  3. Follow instructions here: https://rnmapbox.github.io/docs/install?configure-module=android&rebuild=android
  4. npm run android --reset-cache

Expected behavior

Should be able to install test app on emulator

Notes / preliminary analysis

No response

Additional links and references

No response

@neilpmyers neilpmyers added the bug 🪲 Something isn't working label Aug 29, 2024
Copy link

No code example found in issue body - More info

@luniumall
Copy link

did you solve this problem?

@Dat-Mobile
Copy link

Look like it stopped at ...rncompat/ResourceDrawableIdHelper.kt:5:37 Unresolved reference: Companion

@atif089
Copy link

atif089 commented Sep 26, 2024

These 2 steps fixed it for me

  1. Bumped up version in package.json to "@rnmapbox/maps": "^10.1.31", (was previously 27)
  2. bumped up version in app.json "RNMapboxMapsVersion": "11.4.1" (was previously 11.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working reopen-on-code-fixed
Projects
None yet
Development

No branches or pull requests

5 participants
@atif089 @luniumall @neilpmyers @Dat-Mobile and others