React Native - Android - Duplicate Class Found - react-native

I have come across a really strange problem here. The react native app works perfectly on iOS but not on Android. Every time I try to build for Andorid I get the error:
Duplicate class found
I've searched everywhere online but can't find a solution.
When I click on the "Duplicate class found" warning I get hundreds of messages like this:
Duplicate class org.bouncycastle.x509.util.StreamParsingException found in modules jetified-bcprov-jdk15on-1.65 (org.bouncycastle:bcprov-jdk15on:1.65) and jetified-bcprov-jdk15to18-1.69 (org.bouncycastle:bcprov-jdk15to18:1.69)
I'm all out of ideas so any help is welcome!
Android Studio version: Android Studio Dolphin | 2021.3.1
classpath('com.android.tools.build:gradle:4.2.2')
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip

Related

React-Native Android Build - Could not determine artifacts for com.facebook.soloader:soloader:0.8.2:

This is a brand new issue. I reviewed the code, and no changes have been made to the libraries in 3 months. All of a sudden I am getting the error "Could not determine artifacts for com.facebook.soloader:soloader:0.8.2:" I tried updating this to 0.9.0+ based on React Native: App crashes on start due to SoLoader issue, but then I just got a bunch of "xxxx library uses a deprecated API". I have cleaned the project multiple times, invalidated caches, restarted computer, etc. but I can't find anything about how to fix this problem, nor do I know why it started happening. Does anyone have any insight?

`ReactApp/App.js`: Module 'react' does not exist in the Haste Module map - following instructions of iOS simulator with no success

I'm running 'react-native run-ios' for a new react app i'm init but I keep getting this error.
I followed through the instructions given by the debugger in iOS simulator but unfortunately the problem is persisting.
Has anyone experienced the same problem and knows another solution other than the one presented in the IOS simulator? Would be much appreciated.

React Native Maps Error - Native component for "AIRMap" does not exist

I’m struggling with the Google Maps API in React Native, for Android.
I’ve followed the installation instructions for Android but I keep receiving the same error (see title) when I try to use the Mapview Component. I'm using the Android Studio emulator.
versions: react native - 0.55.4 / react-native-maps - 0.18.0 and 0.22.0
Haven't found any online solution for Android. Does anyone has a way to get me out of this trouble?
Please, tell me if you want to see my code. Thanks!
I really struggled with this for a few days also. I think it's a bug with the installation process, and it's very frustrating their docs no longer provide manual installation instructions. Honestly, I eventually gave up and used react-native-mapbox-gl

Adding React Native to an existing iOS app - fails to compile

I followed the official guide on adding React Native to existing iOS apps (Swift).
pod install finished successfully and I got to the point when I import React in a Swift file and try to compile the app.
The build fails with an error in the yoga dependency. Xcode cannot find the C++ standard library:
However, then I click "Go to definition" on <algorithm>, Xcode can find it:
These are my project settings (I tried a few different combinations):
I'm fairly new to iOS development, so this might be a simple issue with our existing project, Xcode, Command Line Tools, or my machine. I Googled around a bit, no luck so far.
Any help from someone familiar with iOS development is appreciated! When we find the solution I'd like to update the official guide so others don't get stuck adding React Native to their app.
I believe your issue is fixed by this PR https://github.com/facebook/react-native/pull/17764, which reduces the number of exported Yoga headers to those that are actually needed to be able to build and as part of that removes headers that require C++ and its stdlib.

How can I get the connected hotspot BSSID/MAC Address in a React Native app?

I can easily do that using existing packages for Android, but I couldn't find any package that would do the same both on Android and iOS.
Update (Feb-08, 2017):
After waiting over two weeks and placing a bounty on the question which resulted in zero answers, I decided to implement a new package (react-native-gateway-finder) that returns the exact info I was looking for.
It is currently implemented for Android only and an iOS implementation is welcomed.
After I did some search on google, got the result as below:
react-native-network-info works with both Android and iOS. But you might need to upgrade your react-native version to 0.48 or higher.
react-native-android-wifi works with Android platform.
If you only need some basic info, NetInfo provided by react-native is a good choice.