Giter VIP home page Giter VIP logo

Comments (25)

snowdamiz avatar snowdamiz commented on September 27, 2024 1

Force the rnmapbox version to be 10.1.29 or lower. This library raised the gradle target version so its no longer matching your RN gradle version.

My workiing setup although I am using expo:

{
    "react-native": "0.74.5",
    "@rnmapbox/maps": "10.1.29",
}

from maps.

snowdamiz avatar snowdamiz commented on September 27, 2024 1

Hey folks, I'm having a similar issue:

Environment

Dev OS: Windows @rnmapbox/maps version: 10.1.29 React Native version: 0.74.3 Expo version: 51.0.23

Result running yarn android

> Task :rnmapbox_maps:compileDebugKotlin FAILED
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:212:5 'addView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:227:5 'removeView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:236:5 'removeAllViews' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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.

Here is my working setup for expo right now

{
   "expo": "~51.0.26",
   "@rnmapbox/maps": "10.1.29",
   "react-native": "0.74.5",
}

from maps.

Ception avatar Ception commented on September 27, 2024 1

Hey folks, I'm having a similar issue:

Environment

Dev OS: Windows @rnmapbox/maps version: 10.1.29 React Native version: 0.74.3 Expo version: 51.0.23

Result running yarn android

> Task :rnmapbox_maps:compileDebugKotlin FAILED
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:212:5 'addView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:227:5 'removeView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:236:5 'removeAllViews' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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.

Here is my working setup for expo right now

{
   "expo": "~51.0.26",
   "@rnmapbox/maps": "10.1.29",
   "react-native": "0.74.5",
}

Thank you, you just saved me a LOT of headache. Granted it's my own fault, I should've checked the issues earlier. I Thought It was something I did in my code. For now this is the best solution and can confirm works.

from maps.

Gp2mv3 avatar Gp2mv3 commented on September 27, 2024 1

I also had the issue on RN 0.74, reverting to rnmapbox/maps 10.1.27 solved the issue.

from maps.

snowdamiz avatar snowdamiz commented on September 27, 2024 1

same:

"@rnmapbox/maps": "^10.1.28",

Remove the ^. What is your RN version?

from maps.

periakteon avatar periakteon commented on September 27, 2024 1

same:
"@rnmapbox/maps": "^10.1.28",

Remove the ^. What is your RN version?

I fixed by changing to:

#3598 (comment)

from maps.

badredaha avatar badredaha commented on September 27, 2024

Yes same here ++

from maps.

dandrykevych avatar dandrykevych commented on September 27, 2024

same here, 10.1.29 doesnt solve the issue, ios is fine

image

from maps.

snowdamiz avatar snowdamiz commented on September 27, 2024

same here, 10.1.29 doesnt solve the issue, ios is fine

image

Yea it looks like you are having a different issue than what op had

from maps.

Lucasdsk avatar Lucasdsk commented on September 27, 2024

Hey folks, I'm having a similar issue:

Environment

Dev OS: Windows
@rnmapbox/maps version: 10.1.29
React Native version: 0.74.3
Expo version: 51.0.23

Result running yarn android

> Task :rnmapbox_maps:compileDebugKotlin FAILED
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:212:5 'addView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:227:5 'removeView' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/node_modules/@rnmapbox/maps/android/src/main/java/com/rnmapbox/rnmbx/components/images/RNMBXImagesManager.kt:236:5 'removeAllViews' overrides nothing
e: file:///C:/Users/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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/lucas/Documents/development/app/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.

from maps.

TobiDevloft avatar TobiDevloft commented on September 27, 2024

@snowdamiz Thank you, reverting to "10.1.29" resolved the issue for me!

from maps.

mfazekas avatar mfazekas commented on September 27, 2024

@TobiDevloft you can open the issue. I'll need to take a look, to see if we can make rnmapbox compatible with both RN<0.75 and >=0.75. In 10.1.30 I've made it compile with RN 0.75, but it sounds like this breaks with <=RN 0.74. At worst we'll need to provide patches so ppl can use the latest version with older react using patch-packages

from maps.

TobiDevloft avatar TobiDevloft commented on September 27, 2024

Alright, reopening! Thanks for your work :)

from maps.

Lacerda53 avatar Lacerda53 commented on September 27, 2024

I have the same problem, did you find a solution?

"react-native": "0.72.1",
"@rnmapbox/maps": "10.1.29"

from maps.

periakteon avatar periakteon commented on September 27, 2024

same:

"@rnmapbox/maps": "^10.1.28",

from maps.

mfazekas avatar mfazekas commented on September 27, 2024

released v10.1.31-rc.0 this should work with RN 0.75, and 0.72 pls test

from maps.

mattijsf avatar mattijsf commented on September 27, 2024

I still have this issue with v10.1.31-rc.0:

Task :rnmapbox_maps:compileDebugKotlin FAILED
e: ResourceDrawableIdHelper.kt:5:37 Unresolved reference: Companion

ext.kotlinVersion = '1.9.21'
[email protected]
@rnmapbox/[email protected]

Just did another test with 0.72 but it still fails with rc.0:

npx react-native init MapboxTest --version 0.72.1
cd MapboxTest
yarn add @rnmapbox/[email protected]
# update android/build.grale with maven repo details
yarn android
> Task :rnmapbox_maps:compileDebugKotlin FAILED
45 actionable tasks: 45 executed

info 💡 Tip: Make sure that you have set up your development environment correctly, by running 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: /Users/mattijs/Development/MapboxTest/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

from maps.

mattijsf avatar mattijsf commented on September 27, 2024

@mfazekas

I think it's better for now to either not override ResourceDrawableIdHelper.getInstance and just use the deprecated ResourceDrawableIdHelper.getInstance in the codebase. Or create a

class ResourceDrawableIdHelperCompat {
    companion object {
        fun getInstance(): ResourceDrawableIdHelper {
            return ResourceDrawableIdHelper.getInstance() // deprecated, .instance is preferred but can't be used on rn <0.75
        }
    }
}

and reference ResourceDrawableIdHelperCompat everywhere but it doesn't make much sense expect for have a single point for refactoring the accessor later on.

from maps.

mfazekas avatar mfazekas commented on September 27, 2024

@mattijsf thanks, do you have new arch enabled? Not sure why I haven't seen this issue, while testing...
Sure we can remove getInstance override. I think a few RC's ago this was RN0.75 was not working without it. Sure we can live with deprecated.

from maps.

mattijsf avatar mattijsf commented on September 27, 2024

@mattijsf thanks, do you have new arch enabled? Not sure why I haven't seen this issue, while testing... Sure we can remove getInstance override. I think a few RC's ago this was RN0.75 was not working without it. Sure we can live with deprecated.

I'm not using new arch. Just the instructions I wrote in #3598 (comment) are enough. Maybe you hit some caching / node_modules situation where the build succeeded with the change 🤷

from maps.

luniumall avatar luniumall commented on September 27, 2024

Force the rnmapbox version to be 10.1.29 or lower. This library raised the gradle target version so its no longer matching your RN gradle version.

My workiing setup although I am using expo:

{
    "react-native": "0.74.5",
    "@rnmapbox/maps": "10.1.29",
}

I am using the same version, but still failed

from maps.

luniumall avatar luniumall commented on September 27, 2024

I still have this issue with v10.1.31-rc.0:

Task :rnmapbox_maps:compileDebugKotlin FAILED
e: ResourceDrawableIdHelper.kt:5:37 Unresolved reference: Companion

ext.kotlinVersion = '1.9.21' [email protected] @rnmapbox/[email protected]

Just did another test with 0.72 but it still fails with rc.0:

npx react-native init MapboxTest --version 0.72.1
cd MapboxTest
yarn add @rnmapbox/[email protected]
# update android/build.grale with maven repo details
yarn android
> Task :rnmapbox_maps:compileDebugKotlin FAILED
45 actionable tasks: 45 executed

info 💡 Tip: Make sure that you have set up your development environment correctly, by running 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: /Users/mattijs/Development/MapboxTest/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

same here

from maps.

Ception avatar Ception commented on September 27, 2024

It's unbelievable the amount of people that don't bother reading comments. Pure laziness 😂

from maps.

mfazekas avatar mfazekas commented on September 27, 2024

Can you try with v10.1.31-rc.1 ?

released v10.1.31-rc.1 this should work with RN 0.75, and 0.72 pls test

from maps.

Dat-Mobile avatar Dat-Mobile commented on September 27, 2024

I can confirm this is working for me

{
    "react-native": "0.74.3",
    "@rnmapbox/maps": "10.1.29",
}

from maps.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.