-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
JSON::ParserError - 419: unexpected token #3305
Comments
There are so many ways for things to wrong, I typically request people clone this repo and run the script for their versions (https://github.com/mikehardy/rnfbdemo/blob/master/make-demo.sh for you) and see what things should look like. The problem is in the difference between what you have and what runs based on that script |
Thanks Mike. I ran the make-demo-v6.sh . After that I Next, I add run And I get the similar errors as posted above. |
In the template you indicate you are using 5.4.3. Why do you run the v6 script? |
Sorry, I let "@react-native-firebase/app": "^6.3.4", In my project firestore wasn't installed. Following the documentation that says I also tried to remove firestore |
My example adds firestore, and works fine. I can't reproduce. |
I am having the same error even through the script. I am assuming it's coming at the same point when pod install is run for firestore. Please let me know if there is a better way to describe my problem. |
Perhaps cocoapods 1.9 requires a higher ruby? I'm using ruby 2.7.0 (specifically 'ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]' managed by rvm) I can't think of anything else though, although after running my script firestore should already be there, yarn adding it again doesn't seem right? But also shouldn't actually harm, and pod install should work. Definitely use the react-native-clean-project module at least once to see if it blows out something corrupt in cached state |
Thanks! the following from this link CocoaPods/CocoaPods#9260 worked -
|
Cool, thanks for helping debug ! |
I believe react-native-clean-project is the canonical solution for purging local state to achieve clean reproducible react-native builds, so I just opened an enhancement there to add this functionality as it's a new one for me pmadruga/react-native-clean-project#42 |
Thanks Mike. react-native-clean-project however didn't help me in this particular case. Maybe because I didn't want to delete the ios folder. I wonder if it removes the trunk (or it is necessary at all to remove it). Removing the trunk part was mentioned here CocoaPods/CocoaPods#9260 |
@mks11 you linked that twice but I see nothing relevant there in the 2773 link? But no, react-native-clean-project would not have worked in this case it needs an enhancement before it can work which is the item I linked - good working finding the cause |
@mikehardy Oh apologies! made the correction. This is the link CocoaPods/CocoaPods#9260 |
Thanks that helps! I cross-linked it with the react-native-clean-project enhancement request to provide it with support |
When I tried to upgrade my react-native package from v0.61 to v0.63. I encounter JSONParse error below command is what i use to solve the issue `gem list --local | grep cocoapods sudo gem uninstall (each item from above command) sudo rm -rf ~/.cocoapods sudo gem install cocoapods cd (PROJECT DIRECTORY) pod init (put cocoapod in podfile) pod install rm -rf ~/.cocoapods/repos/trunk/ pod cache clean --all pod install` credit from https://stackoverflow.com/a/60849495/7702345 |
Issue
Describe your issue here
Pod install seems to work fine until I install the firestore package and run pod install afterwards. ( details below are from a bare-bone project that gives this error, I am getting the same error in the main project)
yarn add @react-native-firebase/firestore
While running
cd ios && pod install
I get this error
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Project Files
Javascript
Click To Expand
package.json
:{
"name": "FirestorInstall",
"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/app": "^6.3.4",
"@react-native-firebase/auth": "^6.3.4",
"@react-native-firebase/firestore": "^6.3.4",
"react": "16.9.0",
"react-native": "0.61.5"
},
"devDependencies": {
"@babel/core": "^7.8.7",
"@babel/runtime": "^7.8.7",
"@react-native-community/eslint-config": "^0.0.7",
"babel-jest": "^25.1.0",
"eslint": "^6.8.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.58.0",
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
}
}
# N/A
firebase.json
for react-native-firebase v6:# N/A
iOS
Click To Expand
ios/Podfile
:platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
target 'FirestorInstall' do
Pods for FirestorInstall
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/'
pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
target 'FirestorInstallTests' do
inherit! :search_paths
# Pods for testing
end
use_native_modules!
end
target 'FirestorInstall-tvOS' do
Pods for FirestorInstall-tvOS
target 'FirestorInstall-tvOSTests' do
inherit! :search_paths
# Pods for testing
end
end
# N/A
AppDelegate.m
:// N/A
Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settings
jetifier=true
for Android compatibility?jetifier
for react-native compatibility?android/build.gradle
:// N/A
android/app/build.gradle
:// N/A
android/settings.gradle
:// N/A
MainApplication.java
:// N/A
AndroidManifest.xml
:<!-- N/A -->
Environment
Click To Expand
react-native info
output:react-native-firebase
version you're using that has this issue:Firebase
module(s) you're using that has the issue:e.g. Instance ID
TypeScript
?Y/N
&VERSION
N
Think
react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]React Native Firebase
andInvertase
on Twitter for updates on the library.The text was updated successfully, but these errors were encountered: