EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 444 forks source link

JSON::ParserError - 416: unexpected token at '"CoreOnly/NOTICES' #1619

Closed nmandyam closed 4 years ago

nmandyam commented 4 years ago

I'm not completely sure if my problem is from this Firebase plugin, but here's whatever little analysis I've done:

Looking on Google, the only reference to CoreOnly/NOTICES I can find is in the firebase-ios-sdk package, here: https://github.com/firebase/firebase-ios-sdk/blob/master/CoreOnly/NOTICES. Hence my conclusion that the problem is here, in this plugin, since this is the only Firebase scaffolding I am using. I've tried rebuilding in several ways (the usual panacea of deleting node_modules, platforms, etc), but come back to the same issue. Any ideas on how I can fix this? Thanks!

EddyVerbruggen commented 4 years ago

What are you running pod install manually for? Or am I misinterpreting your 2nd bullet?

nmandyam commented 4 years ago

I am not running pod install, sorry if I was not clear; I am running tns run ios. The pod install happens along the way, from what I can see.

To add to the confusion: the above behaviour is on a Macbook that has Xcode 11.5. I have an older Macbook with Xcode 10.1 and the same code builds OK there!

EddyVerbruggen commented 4 years ago

Thanks for clearing that up, I'll try and build the demo apps today with the latest Xcode and let you know how it goes.

nmandyam commented 4 years ago

I reverted my Xcode to 11.2.1 and I still have exactly the same issue! What am I doing wrong? Will await your response, thanks.

EddyVerbruggen commented 4 years ago

I'm on Xcode 11.5 and successfully build and deployed the demo app in this repo just now.

Can you try that as well? Then we have a common starting point: https://github.com/EddyVerbruggen/nativescript-plugin-firebase#demo-app

nmandyam commented 4 years ago

The same issue occurs with the demo, too. Log below. Sorry if it looks strange - I've not removed the markdown that the log includes.

Installing pods... Analyzing dependencies

――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

Command

/usr/local/bin/pod install

Report

Stack

   CocoaPods : 1.9.3
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.5 (19F101)
       Xcode : 11.2.1 (11B500)
         Git : git version 2.21.0 (Apple Git-122.2)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

Podfile

use_frameworks!

target "demo" do
post_install do |installer|
  post_installnativescript_plugin_firebase_0 installer
end

# NativeScriptPlatformSection /Users/drinr/source-code/nativescript-plugin-firebase-master/demo/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile with 9.0
platform :ios, '9.0'
# End NativeScriptPlatformSection

# Begin Podfile - /Users/drinr/source-code/nativescript-plugin-firebase-master/demo/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile
# platform :ios, '9.0'

pod 'Firebase/Core', '~>6.16.0'

# Analytics
pod 'Firebase/Analytics'

# Authentication
pod 'Firebase/Auth'

# Realtime DB
pod 'Firebase/Database'

# Cloud Firestore
#pod 'Firebase/Firestore'

# Remote Config
pod 'Firebase/RemoteConfig'

# Performance Monitoring
pod 'Firebase/Performance'

# Crashlytics
pod 'Fabric'
pod 'Crashlytics'

# Crashlytics works best without bitcode
def post_installnativescript_plugin_firebase_0 (installer)
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['ENABLE_BITCODE'] = "NO"
            config.build_settings['CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES'] = "YES"
        end
    end
end

# Firebase Cloud Messaging (FCM)
pod 'Firebase/Messaging'

# Firebase In-App Messaging
#pod 'Firebase/InAppMessaging'

# Firebase Cloud Storage
pod 'Firebase/Storage'

# Firebase Cloud Functions
pod 'Firebase/Functions'

# AdMob
pod 'Firebase/AdMob'

# Dynamic Links
pod 'Firebase/DynamicLinks'

# ML Kit
#pod 'Firebase/MLVision'
#pod 'Firebase/MLVisionTextModel'
#pod 'Firebase/MLVisionBarcodeModel'
#pod 'Firebase/MLVisionFaceModel'
#pod 'Firebase/MLVisionLabelModel'
#pod 'Firebase/MLVisionObjectDetection'
#pod 'Firebase/MLModelInterpreter'
#pod 'Firebase/MLVisionAutoML'
#pod 'Firebase/MLNaturalLanguage'
#pod 'Firebase/MLNLLanguageID'
#pod 'Firebase/MLNLTranslate'
#pod 'Firebase/MLCommon'
#pod 'Firebase/MLNLSmartReply'

# Facebook Authentication
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'

# Google Authentication
pod 'GoogleSignIn', '~> 5.0'
# End Podfile

# Begin Podfile - /Users/drinr/source-code/nativescript-plugin-firebase-master/demo/node_modules/@nativescript/core/platforms/ios/Podfile
# platform :ios, '9.0'
use_frameworks!

pod 'MaterialComponents/Tabs', '~> 94.5'
# End Podfile
end

Error

JSON::ParserError - 416: unexpected token at '"CoreOnly/NOTICES'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/json/common.rb:156:in `parse'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/specification/json.rb:61:in `from_json'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/specification.rb:742:in `from_string'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/specification.rb:716:in `from_file'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/source.rb:186:in `specification'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver/lazy_specification.rb:37:in `specification'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver/lazy_specification.rb:29:in `subspec_by_name'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:362:in `block in specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:362:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:362:in `specifications_for_dependency'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:165:in `search_for'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:274:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:267:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:267:in `sort_by'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:267:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:53:in `block in sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:70:in `with_no_such_dependency_error_handling'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/delegates/specification_provider.rb:52:in `sort_dependencies'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:288:in `initial_state'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:210:in `start_resolution'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:168:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/resolver.rb:94:in `resolve'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1065:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:1063:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:410:in `analyze'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:235:in `block in resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:234:in `resolve_dependencies'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/installer.rb:156:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `<main>'

――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

[!] Oh no, an error occurred.

Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=416%3A+unexpected+token+at+%27%22CoreOnly%2FNOTICES%27&type=Issues

If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new

Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md

Don't forget to anonymize any private data!

Looking for related issues on cocoapods/cocoapods... Found no similar issues. To create a new issue, please visit: https://github.com/cocoapods/cocoapods/issues/new 'pod install' command failed.

npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT npm ERR! nativescript-plugin-firebase@10.5.2 demo.ios: npm run preparedemo && cd ../demo && tns run ios npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the nativescript-plugin-firebase@10.5.2 demo.ios script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

EddyVerbruggen commented 4 years ago

Which cocoapods versions do you use? Mine below - perhaps you can use that version as well in case yours is different:

eddyverbruggen@Eddys-MacBook-Pro ~> pod --version
1.9.3
nmandyam commented 4 years ago

I tried with pod 1.9.3, 1.9.1. I upgraded Ruby from 2.6.8 to 2.7.1. No change in behaviour. :(

EddyVerbruggen commented 4 years ago

Do tou have any suggestions for what to change in the plugin? I can’t reproduce it so can’t really fix it..

nmandyam commented 4 years ago

Not yet. I'll poke around a little more, will report back in a bit. Can you please keep this issue open till then?

nmandyam commented 4 years ago

Solved. I did the following (among many things!) and the last one fixed it. So maybe I should have done that first? I can't tell. Anyway, if anyone else has this issue:

  1. Updated Ruby from 2.6.8 to 2.7.1

  2. Cleared cocoapods/repos/trunk as described here.

After step 2, the problem went away. Thanks for all the help - you pointed me in the right direction!