I am using #react-native-firebase/admob for displaying add on app. It is working fine in Android but when I am using it on ios then app is crash with following error.
ld: warning: directory not found for option '-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphonesimulator'
Undefined symbols for architecture x86_64:
"___isPlatformVersionAtLeast", referenced from:
-[APMMeasurement reportFirstOpenOnWorkerQueue] in GoogleAppMeasurement(APMMeasurement_d6638b533a7cdc437824cf7209ad695a.o)
-[APMSqliteStore prepareSQL:error:] in GoogleAppMeasurement(APMSqliteStore_acc99dfbcd8c054676308fb24061e3f7.o)
+[APMASIdentifierWrapper iOS14OrAbove] in GoogleAppMeasurement(APMASIdentifierWrapper_1d59db0ddd97263057318367c9cd40e6.o)
-[APMIdentity supportsAppTrackingConsentStatus] in GoogleAppMeasurement(APMIdentity_ba0d5d0b5e35834ab5a7bf0571075715.o)
-[APMMeasurement(URL) sendDeepLinkURLToAppDelegateOnMainThread:extraInfo:] in GoogleAppMeasurement(APMMeasurement+URL_89002570063d654e31cbed7a49d52cf9.o)
l002 in GoogleMobileAds(GADAugmentedRealitySignalSource.o)
_GADWindowSceneForViewController in GoogleMobileAds(GADScene.o)
...
ld: symbol(s) not found for architecture x86_64
clang:
error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld /Users/admin/Library/Developer/Xcode/DerivedData/adMob-govjzfsolrnouaecgeggequoemrv/Build/Products/Debug-iphonesimulator/adMob.app/adMob normal x86_64
(1 failure)
adMob is my project name.I followed all the instruction to install it.
package.json
{
"name": "adMob",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"#react-native-firebase/admob": "^7.6.5",
"#react-native-firebase/app": "^8.4.3",
"react": "16.13.1",
"react-native": "0.63.2"
},
"devDependencies": {
"#babel/core": "7.11.6",
"#babel/runtime": "7.11.2",
"#react-native-community/eslint-config": "1.1.0",
"babel-jest": "25.5.1",
"eslint": "6.8.0",
"jest": "25.5.4",
"metro-react-native-babel-preset": "0.59.0",
"react-test-renderer": "16.13.1"
},
"jest": {
"preset": "react-native"
}
}
Podfile
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '10.0'
target 'adMob' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'RNFBAdMob', :path => '../node_modules/#react-native-firebase/admob'
target 'adMobTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable these next few lines.
use_flipper!
post_install do |installer|
flipper_post_install(installer)
end
end
target 'adMob-tvOS' do
# Pods for adMob-tvOS
target 'adMob-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
I also added firebase.json file in root folder
After I did RND and I found that it was the Xcode version issue. I am using Xcode 10 and it is working on Xcode 11 and higher version. So that's why I am facing this issue.
Yes definitely. If you not get ads only archive. then it is mostly permission issue. You should also check google ad mod key which you implemented in react native admod is correct or not.
Related
here is my problem or error I'm facing please click here to see...
Here is my node error in metro bundler..
#######
################
######### #########
######### ##########
######### ###### #########
##########################################
##### ##################### #####
##### ############## #####
##### ### ###### ### #####
##### ####### ####### #####
##### ########### ########### #####
##### ########################## #####
##### ########################## #####
##### ###################### ######
###### ############# #######
######### #### #########
######### #########
######### #########
#########
Welcome to Metro!
Fast - Scalable - Integrated
To reload the app press "r"
To open developer menu press "d"
Failed to construct transformer: Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:71:19)
at Object.createHash (node:crypto:140:10)
at stableHash (D:\EMproject\eMembership-React-Native\node_modules\metro-cache\src\stableHash.js:19:8)
at Object.getCacheKey (D:\EMproject\eMembership-React-Native\node_modules\metro-transform-worker\src\index.js:593:7)
at getTransformCacheKey (D:\EMproject\eMembership-React-Native\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19)
at new Transformer (D:\EMproject\eMembership-React-Native\node_modules\metro\src\DeltaBundler\Transformer.js:48:9)
at D:\EMproject\eMembership-React-Native\node_modules\metro\src\Bundler.js:22:29 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
This is an error I'm getting ...
PS D:\EMproject\eMembership-React-Native> npm run android
eMembershipCard#0.0.4 android
react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 3139 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'eMembershipCard'.
Could not resolve all files for configuration ':classpath'.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
Required by:
project :
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 15s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'eMembershipCard'.
Could not resolve all files for configuration ':classpath'.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/ 1.7.20/kotlin-stdlib-jre7- 1.7.20.pom
Required by:
project :
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 15s
at makeError (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\EMproject\eMembership-React-Native\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
PS D:\EMproject\eMembership-React-Native>
Here is my package.json file...
{
"name": "eMembershipCard",
"version": "0.0.4",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"android_emembershipcard": "react-native run-android --variant=emembershipcardDebug --appIdSuffix = 'membershipdemo' ",
"android_omaha": "react-native run-android --variant=omahaDebug --appIdSuffix = 'ocm' ",
"android_magichouse": "react-native run-android --variant=magichouseDebug --appIdSuffix = 'magichouse' ",
"ios_emembershipcard": "react-native run-ios --scheme eMembershipCard --configuration eMembershipCard",
"ios_omaha": "react-native run-ios --scheme omaha --configuration omaha",
"ios_magichouse": "react-native run-ios --scheme magichouse --configuration magichouse",
"emembership-build": "cd android && ./gradlew assembleemembershipcardRelease",
"emembership-build-debug": "cd android && ./gradlew assembleemembershipcardDebug",
"omaha-build-debug": "cd android && ./gradlew assembleomahaDebug",
"magichouse-build-debug": "cd android && ./gradlew assemblemagichouseDebug",
"emembership-build-debug-bundle": "cd android && ./gradlew bundleemembershipcardDebug",
"omaha-build-debug-bundle": "cd android && ./gradlew bundleomahaDebug",
"magichouse-build-debug-bundle": "cd android && ./gradlew bundlemagichouseDebug"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.0",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.5",
"#react-native-firebase/app": "^14.12.0",
"#react-native-firebase/messaging": "^14.2.2",
"#react-navigation/drawer": "^6.1.8",
"#react-navigation/native": "^6.0.6",
"#react-navigation/stack": "^6.0.11",
"android": "^0.0.8",
"axios": "^0.24.0",
"linkify-html": "^3.0.5",
"moment": "^2.29.1",
"react": "17.0.2",
"react-native": "0.66.4",
"react-native-barcode-builder": "^2.0.0",
"react-native-camera": "^4.2.1",
"react-native-collapsible": "^1.6.0",
"react-native-config": "^1.4.11",
"react-native-dots-pagination": "^0.2.0",
"react-native-flash-message": "^0.2.0",
"react-native-floating-action": "^1.22.0",
"react-native-geolocation-service": "^5.3.0-beta.4",
"react-native-gesture-handler": "^2.0.0",
"react-native-gradient-buttons": "^2.0.2",
"react-native-html-to-pdf": "^0.12.0",
"react-native-hyperlink": "^0.0.19",
"react-native-image-pan-zoom": "^2.1.12",
"react-native-linear-gradient": "^2.5.6",
"react-native-marquee": "^0.3.2",
"react-native-material-menu": "^2.0.0",
"react-native-modal": "^13.0.1",
"react-native-open-maps": "^0.4.0",
"react-native-pager-view": "^5.4.9",
"react-native-permissions": "^3.2.0",
"react-native-phone-number-input": "^2.1.0",
"react-native-qrcode-scanner": "^1.5.4",
"react-native-qrcode-svg": "^6.1.2",
"react-native-reanimated": "^2.2.4",
"react-native-render-html": "^6.3.1",
"react-native-safe-area-context": "^3.3.2",
"react-native-screens": "^3.10.0",
"react-native-share": "^7.3.5",
"react-native-splash-screen": "^3.3.0",
"react-native-sqlite-storage": "^6.0.1",
"react-native-svg": "^12.1.1",
"react-native-unimodules": "^0.14.10",
"react-native-uuid": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-native-wallet": "^1.0.8",
"react-native-webview": "^11.15.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
What I have tried...
I think the commands which is necessary to solve the error I have tried ...
And also I have set the environment setup very properly as the react native setup docs says ...
I have updated gradle version , kotlin version, react native version , npm version , node version etc...
I have also updated Firebase app , Firebase message and Firebase.. where Firebase app and messages version should be same...
I have also set up the SDK TOOLS, Android SDK in Android studio ...
I have uninstalled the nodes, vs code and again reinstalled it but again facing the same issue i.e. Build Failed....
**Here is my android/build.gradle ...
`
buildscript {
ext {
buildToolsVersion = "30.0.2"
minSdkVersion = 21
compileSdkVersion = 29
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlin_version = '1.7.20'
android_plugin_version = '7.3.1'
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath('com.android.tools.build:gradle:7.3.1')
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-stdlib-jre7: 1.7.20"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
maven { url 'https://www.jitpack.io' }
}
}
`
i have battling with this error for days now, trying to start up at a new job. Having issues while trying to run pod install on a react native cli project, i have tried every possible solution on here, doesnt work with mine.
The errors:
[!] Invalid `Podfile` file: /Users/decagon/kumoafrica/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:39: syntax error, unexpected <<
template =<<~EOS
^
/Users/decagon/kumoafrica/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:40: unknown regexp options - ll
/Users/decagon/kumoafrica/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: dynamic constant assignment
RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
^
/Users/decagon/kumoafrica/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: `$(' is not allowed as a global variable name
/Users/decagon/kumoafrica/node_modules/react-native/scripts/react_native_pods_utils/script_phases.rb:41: syntax error, unexpected end-of-input
RCT_SCRIPT_POD_INSTALLATION_ROOT=$(pwd)
^.
# from /Users/decagon/kumoafrica/ios/Podfile:1
# -------------------------------------------
> require_relative '../node_modules/react-native/scripts/react_native_pods'
# require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
# -------------------------------------------
The podfile:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
install! 'cocoapods', :deterministic_uuids => false
target 'kumo' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'kumoTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
package.json:
{
"name": "kumo",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"react": "17.0.2",
"react-native": "0.68.1"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"#types/jest": "^26.0.23",
"#types/react-native": "^0.67.3",
"#types/react-test-renderer": "^17.0.1",
"#typescript-eslint/eslint-plugin": "^5.17.0",
"#typescript-eslint/parser": "^5.17.0",
"babel-jest": "^26.6.3",
"eslint": "^7.32.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.67.0",
"react-test-renderer": "17.0.2",
"typescript": "^4.4.4"
},
"resolutions": {
"#types/react": "^17"
},
"jest": {
"preset": "react-native",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
}
}
if anything else is needed ask, please help.
Don't know if this is helpful now but if you're running React Native from scratch on a M1 Chip machine I was able to fix this issue by doing:
cd ios
bundle install
bundle exec pod install
After hours of struggle this was the way to actually make for pod install work for me.
This same example can be found here: https://reactnative.dev/docs/environment-setup under the "Creating a new application" section.
I think you are Mac M1 user, so follow this steps :
Uninstall the local cocoapods gem
sudo gem uninstall cocoapods
install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
or
Go to Site Web
Finally install cocoapods via Homebrew
brew install cocoapods
And it will Work, Otherwise check this
I created a new react-native project and added my android native module as a dependency.using official doc https://reactnative.dev/docs/native-modules-setup
When I run this I get the error with following stack trace:
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libfbjni.so result: 0
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:825)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:673)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:611)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:559)
at com.facebook.soloader.NativeLoaderToSoLoaderDelegate.loadLibrary(NativeLoaderToSoLoaderDelegate.java:25)
at com.facebook.soloader.nativeloader.NativeLoader.loadLibrary(NativeLoader.java:44)
at com.facebook.jni.HybridData.<clinit>(HybridData.java:34)
at com.facebook.flipper.android.FlipperThread.run(FlipperThread.java:25)
Following is my package.json
{
"name": "albums",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"axios": "^0.19.2",
"react": "16.11.0",
"react-native": "0.62.0-rc.5",
"react-native-my-fancy-library": "../react-native-my-fancy-library/"
},
"devDependencies": {
"#babel/core": "^7.9.0",
"#babel/runtime": "^7.9.2",
"#react-native-community/eslint-config": "^1.0.0",
"babel-jest": "^25.3.0",
"eslint": "^6.8.0",
"jest": "^25.3.0",
"metro-react-native-babel-preset": "^0.59.0",
"react-test-renderer": "16.11.0"
},
"jest": {
"preset": "react-native"
}
}
I have already tried:
https://stackoverflow.com/a/61695629/9715339
https://stackoverflow.com/a/57155606/9715339
https://github.com/facebook/react-native/issues/25415
But none of these solved my issue.
I am a beginner in react-native. So I don't know what other details files I need to post here. Do let me know if you need any other files.
For me the following two solved it (I think it was the latter that did it):
Reset cache: react-native start --reset-cache
Clean Android: cd android -> ./gradlew clean
for me this is resolved after following below steps
3 steps
Up minSdk to 23
In gradle.properties add line:
android.bundle.enableUncompressedNativeLibs=false;
In your manifest file add line:
android:extractNativeLibs=true;
I had the same problem that I solved by updating build.gradle 3.5.2 to 3.5.3 by Android Strudio.
The image shows the update of the classpath in the dependencies in the build.gradle file in the android folder
I currently have a react-native project that uses react-native-maps and Viro. Viro requires a rn version of rn 0.59.9 so I'm not using the latest version in this project.
It's currently set up to use the native apple maps when using an iPhone simulator which works fine and I also have Viro working as well. The next step is to start adding directions from the current user's location to different places around them and I planned on using Google Maps to do this.
Unfortunately I'm having a lot of issues trying to do this and having no luck working through the installation documentation.
My package.json currently looks like this:
{
"name": "LoveWinchester",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"postinstall": "jetifier -r"
},
"dependencies": {
"axios": "^0.19.0",
"react": "16.8.3",
"react-native": "0.59.9",
"react-native-gesture-handler": "~1.4.0",
"react-native-maps": "0.26.1",
"react-native-reanimated": "^1.4.0",
"react-native-screens": "^1.0.0-alpha.23",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3",
"react-viro": "2.17.0",
"rn-bottom-drawer": "^1.4.3"
},
"devDependencies": {
"#babel/core": "^7.7.2",
"#babel/runtime": "^7.7.2",
"babel-jest": "^24.9.0",
"jest": "^24.9.0",
"jetifier": "^1.6.4",
"metro-react-native-babel-preset": "^0.57.0",
"react-test-renderer": "16.8.3"
},
"jest": {
"preset": "react-native"
}
}
And my Podfile looks like below:
target 'LoveWinchester' do
platform :ios, '9.3'
pod 'ViroReact', :path => '../node_modules/react-viro/ios/'
pod 'ViroKit_static_lib', :path => '../node_modules/react-viro/ios/dist/ViroRenderer/static_lib'
pod 'RNReanimated', :path => '../node_modules/react-native-reanimated'
pod 'RNGestureHandler', :path => '../node_modules/react-native-gesture-handler'
pod 'RNScreens', :path => '../node_modules/react-native-screens'
pod 'react-native-maps', :path => '../node_modules/react-native-maps'
end
Any help would be really appreciated!!
Added the pod GoogleMaps
pod 'GoogleMaps'
after that goto iOS folder & install it
cd ios
pod install
Now, you will probably get an error react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.
In order to solve this, go to iOS folder & open your .xcworkspace file because now you need to add AirGoogleMaps to the project.
Go into your node_modules in your project and navigate to the AirGoogleMaps folder.
/node_modules/react-native-maps/lib/ios/AirGoogeMaps
Drag the AirGoogleMaps folder into your project. After dropping that folder into your project there will be a pop-up window in which you will specify to Create groups. (Not create folder references)
Then go inside xcode > build settings > Preprocessor Macros > & add HAVE_GOOGLE_MAPS=1 Preprocessor Macro to Build Settings
In order to use Google Maps, you will need to create a Google Maps API key.
After that go to AppDelegate.m & add below lines to your code
#import <GoogleMaps/GoogleMaps.h>
[GMSServices provideAPIKey:#"YOUR_API_KEY"]
Finally, change your MapView component
import MapView, {PROVIDER_GOOGLE} from "react-native-maps";
<MapView provider={PROVIDER_GOOGLE} />
That's it. Hope this will helps you. Feel free for doubts.
For more informations check this
I want to eject my react-native so I can install mobx but running both 'yarn run eject' and 'npm run eject' doesn't work.i think this is new issue and so couldn't find help online. any help would be appreciated.
this is my package.json file and the error given below.
{
"name": "a2x",
"version": "0.1.0",
"private": true,
"devDependencies": {
"babel-preset-react-native-stage-0": "^1.0.1",
"jest": "^22.4.4",
"jest-react-native": "^18.0.0",
"react-test-renderer": "16.3.1"
},
"scripts": {
"start": "react-native start",
"android": "react-native run-android",
"ios": "react-native run-ios",
"test": "jest",
"eject": "react-native run-eject"
},
"jest": {
"preset": "react-native"
},
"dependencies": {
"axios": "^0.18.0",
"mobx": "^5.5.0",
"mobx-react": "^5.2.8",
"react": "16.3.1",
"react-native": "~0.55.2",
"react-native-elements": "^0.19.1",
"react-navigation": "^2.0.1"
}
}
Try npm run eject..not npm run-eject
But if you trying to add native dependencies later i think better to start project using react native init. not using create-react-native-app.
Actual command is react-native eject.
It will create new folder for android and iOS to run it seperately on native.
As you said you are getting error of Both the iOS and Android folders already exist!, so please delete it and try with this command.
If you already have android and ios folder with some native implementation, there is no need to use eject command at all.
regarding npm run reject command, I guess this will be more useful to clear everything.
Always working for me, only follow two steps
first install in your project
yarn add react-native-eject
and then run
react-native eject
make sure you have install yarn in your pc