Invariant Violation: requireNativeComponent: AIRMap was not found in the UIManager react native
Asked Answered
P

0

8

I'm working with React Native and I need a Map on my Application, for this, I'm trying to use react-native-maps. But when I get it installed, and try to use it, I got these red screens:

enter image description here

I've followed all the steps to installation and examples in this link:

https://github.com/react-community/react-native-maps

Nothing is wrong in my view code, but perhaps something is missing in configuration.

This is my Environment:

"react-native-maps": "github:react-community/react-native-maps"
"react": "16.5.0"
"react-native": "0.57.0"

I'm using the github link to add react-native-maps because some people said this in the Issues page of the react-native-maps (here is a link that one collaborator is saying that > https://github.com/react-community/react-native-maps/issues/2539#issuecomment-428291213 < ), but even doing this it doesn't work.

I forgot to mention that when linked the lib, this happens:

FAILURE: Build failed with an exception.

* What went wrong: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\47.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\50.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\35.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\41.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\38.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\44.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\53.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\3.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\21.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\26.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\18.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\8.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\27.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\12.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\25.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\4.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\9.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\14.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\22.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\17.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\1.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\13.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\5.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\0.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\23.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\16.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\29.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\6.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\10.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\19.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\20.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\2.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\24.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\11.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\7.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\28.jar, D:\Projetos\atitur\android\app\build\intermediates\transforms\dexBuilder\debug\15.jar Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: android.support.v4.app.ActionBarDrawerToggle$Delegate

* 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 33s 48 actionable tasks: 24 executed, 24 up-to-date Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html
Pinch answered 10/10, 2018 at 18:45 Comment(3)
did you follow this: github.com/react-community/react-native-maps/blob/master/docs/… based on the error it seems you did not link the libraryYenta
you need to link the libBanky
I've just edited my question with the output after linking the lib. And when once it happens, it never comes back to normal, I have to discard all modifications from my workspace and uninstall the lib to make my app able to build again.Pinch

© 2022 - 2024 — McMap. All rights reserved.