Skip to content
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

Call to undeclared function 'RCTLog'; ISO C99 and later do not support implicit function declarations #3217

Closed
xts-bit opened this issue Aug 26, 2023 · 13 comments
Assignees
Labels
critical for release demo requested Please submit a simple app that shows the issue Platform: iOS

Comments

@xts-bit
Copy link

xts-bit commented Aug 26, 2023

Bug

I was following the docs for iOS installation with video caching, But after i followed it didi pod install everything worked fine but as soon i started my project with npm start and run on an iOS simulator it crashes and i found these error in my Xcode

/Users/user/Desktop/myProject/node_modules/react-native-video/ios/VideoCaching/RCTVideoCache.m:33:7 Call to undeclared function 'RCTLog'; ISO C99 and later do not support implicit function declarations

Platform

Which player are you experiencing the problem on:

  • iOS

Environment info

macOS

Library version: 6.0.0-alpha.7
Device: iPhone 14 pro

Steps To Reproduce

npm start
i

Expected behaviour

  1. It should run my project

Reproducible sample code

# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
  'require.resolve(
    "react-native/scripts/react_native_pods.rb",
    {paths: [process.argv[1]]},
  )', __dir__]).strip

platform :ios, min_ios_version_supported
use_modular_headers!
prepare_react_native_project!
pod 'react-native-video/VideoCaching', :path => '../node_modules/react-native-video/react-native-video.podspec'
$RNVideoUseGoogleIMA=true
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
#
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
# ```
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
  Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
  use_frameworks! :linkage => linkage.to_sym
end

target 'myProject' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # Hermes is now enabled by default. Disable by setting this flag to false.
    :hermes_enabled => flags[:hermes_enabled],
    :fabric_enabled => flags[:fabric_enabled],
    # Enables Flipper.
    #
    # Note that if you have use_frameworks! enabled, Flipper will not work and
    # you should disable the next line.
    :flipper_configuration => flipper_config,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  target 'myProjectTests' do
    inherit! :complete
    # Pods for testing
  end

  post_install do |installer|
    # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end
end
@xts-bit
Copy link
Author

xts-bit commented Aug 26, 2023

@freeboub Any about this?

@freeboub freeboub added Platform: iOS critical for release demo requested Please submit a simple app that shows the issue labels Sep 3, 2023
@xha123
Copy link

xha123 commented Sep 15, 2023

+1

@AEP20
Copy link

AEP20 commented Sep 15, 2023

any update ?

@AnastasiyaHaidanovich
Copy link

+1

2 similar comments
@trmti
Copy link

trmti commented Oct 13, 2023

+1

@joaonew
Copy link

joaonew commented Oct 19, 2023

+1

@salisyb
Copy link

salisyb commented Oct 25, 2023

You can remove 'RCTLog' or comment it, that what worked for me.

@freeboub
Copy link
Collaborator

freeboub commented Nov 8, 2023

I provided a fix for this issue.
Be careful I changed strategy to enable the feature.
Please let me know if you are able to use it.
Thank you

@freeboub
Copy link
Collaborator

fix has been integrated for alpha.10. let me know if it is working for you !

@freeboub
Copy link
Collaborator

feedback from @chayin in: #3346

I had this problem with video caching and here is my fix

in react-native-video.podspec

  • ss.source_files = "ios/Video//*.{h,m,swift}" "ios/VideoCaching//*.{h,m,swift}"
  • s.source_files = "ios//**/.{h,m,swift}"
    I likewise fixed another video caching issue in /ios/VideoCaching/RCTVideoCachingHandler.swift
  • func dvAssetLoaderDelegate(loaderDelegate:DVAssetLoaderDelegate!, didLoadData data:NSData!, forURL url:NSURL!) {
  • func dvAssetLoaderDelegate(_ loaderDelegate: DVAssetLoaderDelegate!, didLoad data: Data!, for url: URL!) {
    _videoCache.storeItem(data as Data?, forUri:url.absoluteString, withCallback:{ (success:Bool) in
    DebugLog("Cache data stored successfully 🎉")
    })
    }
    Plus, canImport(RCTVideoCache) doesn't work and i have absolutely no idea.

@freeboub

@freeboub
Copy link
Collaborator

freeboub commented Nov 15, 2023

so, @chayin I pushed a patch with your proposals, and I also change dynamic import management to fix canImport(RCTVideoCache) issue.
Can you please. test following PR: #3348

@freeboub
Copy link
Collaborator

has been merged for alpha.11 or beta.0

@chayin
Copy link

chayin commented Nov 17, 2023

@freeboub Sorry I'm so late. Thanks for the update. It's working fine, and save() is also working on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical for release demo requested Please submit a simple app that shows the issue Platform: iOS
Projects
None yet
Development

No branches or pull requests

9 participants