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

A function declaration without a prototype is deprecated in all versions of C #36763

Closed
bbishap opened this issue Apr 2, 2023 · 27 comments
Closed
Labels
Needs: Author Feedback Type: Unsupported Version Issues reported to a version of React Native that is no longer supported

Comments

@bbishap
Copy link

bbishap commented Apr 2, 2023

Description

After updating to xcode 14.3 (14E222b) I faced the issue in #36758. After solving that by using a patch, I came across error :
Error : CompileC /Users/bishapbhusal/Library/Developer/Xcode/DerivedData/xxxx/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/GoogleDataTransport.build/Objects-normal/x86_64/GDTCORPlatform.o /Users/bishapbhusal/Documents/xxxx/xxxx/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORPlatform.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'GoogleDataTransport' from project 'Pods')

React Native Version

0.68.2

Output of npx react-native info

System:
OS: macOS 13.2.1
CPU: (8) arm64 Apple M1 Pro
Memory: 105.47 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 18.0.0 - ~/.nvm/versions/node/v18.0.0/bin/node
Yarn: 1.22.19 - ~/Documents/speedhome/app-speedhome/node_modules/.bin/yarn
npm: 8.6.0 - ~/.nvm/versions/node/v18.0.0/bin/npm
Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
Android SDK: Not Found
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.3/14E222b - /usr/bin/xcodebuild
Languages:
Java: 11.0.16.1 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2
react-native: 0.68.2 => 0.68.2
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

Update Xcode with last version 14.3 (14E222b) and try to build project.

Snack, code example, screenshot, or link to a repository

Screenshot 2023-04-03 at 00 55 19

@github-actions github-actions bot added the Type: Unsupported Version Issues reported to a version of React Native that is no longer supported label Apr 2, 2023
@github-actions
Copy link

github-actions bot commented Apr 2, 2023

⚠️ Unsupported Version of React Native
ℹ️ It looks like your issue or the example you provided uses an unsupported version of React Native. Due to the number of issues we receive, we're currently only accepting new issues against one of the supported versions. Please upgrade to latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If you cannot upgrade, please open your issue on StackOverflow to get further community support.

@Dasoke
Copy link

Dasoke commented Apr 2, 2023

facing the same issue, did you find any solution?

@Dillac
Copy link

Dillac commented Apr 3, 2023

double the '|', it works

@kelset
Copy link
Contributor

kelset commented Apr 3, 2023

duplicate #36739

@kelset kelset closed this as completed Apr 3, 2023
@EdgarSanAla
Copy link

A temporal solution what i found is add void in the params of the method with error.
Example
GDTCORNetworkType GDTCORNetworkTypeMessage (void) { ... }

@JuanDiegoEstrada
Copy link

How do I make the file editable without having to unlock it every time?

@phuongwd
Copy link

phuongwd commented Apr 4, 2023

@JuanDiegoEstrada

This issue is related to the Firebase,
I updated the Firebase/Messaging to 8.12.1. and "@react-native-firebase/app": "14.3.2",

Screenshot 2023-04-03 at 20 26 07

@samstanding
Copy link

I'm getting the same error after installing RN 0.71.6
image

@france-workmail
Copy link

Anybody got solutions for this? I have the same issue on Xcode 14.3 after upgrade. I believe it's caused by Firebase and that adding void on the library function doesn't work. I tried doing pod update as well but no luck.

@Othman-Gueddana
Copy link

hello is there any solution here please, i am still facing the issue .

@ejvet-ct
Copy link

Same, issue, updated firebase packages but had no luck.

@adampatterson
Copy link

A temporal solution what i found is add void in the params of the method with error. Example GDTCORNetworkType GDTCORNetworkTypeMessage (void) { ... }

This does "work" but there are SO many files to change and they are all untracked dependencies.

@unamed000
Copy link

unamed000 commented Apr 16, 2023

Having the same issue even with 0.69.9, my custom module is having the issue ... Any idea how to fix this?

image

@unamed000
Copy link

I'm getting the same error after installing RN 0.71.6 image

Did you found any solution for this?

@adampatterson
Copy link

I found a flag under the build settings that I think disabled strict prototype checking. I think that helped. But I still have other issues so I'm not sure if my new errors are before or after this one 🤷‍♂️

Build Settings / Apple Clang - Warnings - All Languages / String Prototypes = No

@sertony
Copy link

sertony commented Apr 18, 2023

You may disable "CLANG_WARN_STRICT_PROTOTYPES" for "GoogleDataTransport" in your Podfile.
Sth like this:

 post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
    installer.pods_project.targets.each do |target|
      # Make it build with XCode 14
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      # Make it work with GoogleDataTransport
      if target.name.start_with? "GoogleDataTransport"
        target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO' 
        end
      end
    end
  end

@KevinColemanInc
Copy link

google/GoogleDataTransport#92

I believe pod update should fix the issue for future people

@unamed000
Copy link

I found a flag under the build settings that I think disabled strict prototype checking. I think that helped. But I still have other issues so I'm not sure if my new errors are before or after this one 🤷‍♂️

Build Settings / Apple Clang - Warnings - All Languages / String Prototypes = No

Works for me, I've to disable it on Project level

@dchersey
Copy link
Contributor

Thank you everyone who hit this before I did ... using Firebase ~6.13 and RN 0.63 it was necessary to

  1. double the | in Yoga in response to the bitwise error (make it ||)
  2. Modify Podfile to include:
post_install do |installer|
    ...

      # Make it build with XCode 14
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      # Make it work with GoogleDataTransport
      if target.name.start_with? "GoogleDataTransport"
        target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO' 
        end
      end
    end
  end

run pod update

Then it built successfully.

@RaviKiranMakala
Copy link

I am getting Undefined symbol: _GDTCORNetworkMobileSubTypeMessage & Linker command failed with exit code 1 (use -v to see invocation) after trying this. Any idea?

Thank you everyone who hit this before I did ... using Firebase ~6.13 and RN 0.63 it was necessary to

  1. double the | in Yoga in response to the bitwise error (make it ||)
  2. Modify Podfile to include:
post_install do |installer|
    ...

      # Make it build with XCode 14
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      # Make it work with GoogleDataTransport
      if target.name.start_with? "GoogleDataTransport"
        target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO' 
        end
      end
    end
  end

run pod update

Then it built successfully.

@maya-salcedo
Copy link

I'm getting the same error after installing RN 0.71.6 image

Did you found any solution for this?

@unamed000 Were you able to find solution to this issue?

jlewallen added a commit to fieldkit/mobile that referenced this issue Jul 10, 2023
facebook/react-native#36763

/Users/jenkins/workspace/fk_mobile-app-ios_develop/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORClock.m:44:43: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int64_t KernelBootTimeInNanoseconds() {
                                            ^
                                             void

/Users/jenkins/workspace/fk_mobile-app-ios_develop/platforms/ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCORLibrary/GDTCORClock.m:62:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
static int64_t UptimeInNanoseconds() {
@naqeeb-ahmed
Copy link

I found a flag under the build settings that I think disabled strict prototype checking. I think that helped. But I still have other issues so I'm not sure if my new errors are before or after this one 🤷‍♂️

Build Settings / Apple Clang - Warnings - All Languages / String Prototypes = No

is it Strict Prototypes or String Prototypes? I can't find String Prototypes

@WestFlow127
Copy link

WestFlow127 commented Sep 2, 2023

I found a flag under the build settings that I think disabled strict prototype checking. I think that helped. But I still have other issues so I'm not sure if my new errors are before or after this one 🤷‍♂️
Build Settings / Apple Clang - Warnings - All Languages / String Prototypes = No

is it Strict Prototypes or String Prototypes? I can't find String Prototypes

It's Strict Prototypes -> config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO'

@bhomaramgtsinfo
Copy link

I'm getting the same error after installing RN 0.71.6 image

Bro have you got any solution for this?

@alexhunt-78
Copy link

Add void to functions in
ios/Pods/GoogleDataTransport/GoogleDataTransport/GDTCCTLibrary/GDTCCTNanopbHelpers.m:165:44

and about half a dozen more. like this

NSData *GDTCCTConstructNetworkConnectionInfoData(void) {

@CodeWithBikramjeet
Copy link

I am getting above error in IOS project and used everything which is above mentioned but not able to run project. Anyone help me.

@Joezzy
Copy link

Joezzy commented Mar 23, 2024

Thank you everyone who hit this before I did ... using Firebase ~6.13 and RN 0.63 it was necessary to

1. double the | in Yoga in response to the bitwise error (make it ||)

2. Modify Podfile to include:
post_install do |installer|
    ...

      # Make it build with XCode 14
      if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
        target.build_configurations.each do |config|
            config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
      # Make it work with GoogleDataTransport
      if target.name.start_with? "GoogleDataTransport"
        target.build_configurations.each do |config|
          config.build_settings['CLANG_WARN_STRICT_PROTOTYPES'] = 'NO' 
        end
      end
    end
  end

run pod update

Then it built successfully.

This worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Type: Unsupported Version Issues reported to a version of React Native that is no longer supported
Projects
None yet
Development

No branches or pull requests