mockingbot / react-native-zip-archive

Zip archive utility for react-native
MIT License
422 stars 154 forks source link

Fails to build on Xcode 16 #316

Open tibbe opened 1 day ago

tibbe commented 1 day ago

Describe the bug After upgrading to Xcode 16 the library doesn't seem to build:

    builtin-ScanDependencies -o /Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/RNZipArchive.o.scan -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -ivfsstatcache /Users/tibbe/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.0-22A3362-db63dc9361471f152f572502bdbfe70a.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/tibbe/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Index.noindex/DataStore @/Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/e6072d4f65d7061329687fe24e3d63a7-common-args.resp -GCC_PREPROCESSOR_DEFINITIONS\=HAVE_INTTYPES_H\ HAVE_PKCRYPT\ HAVE_STDINT_H\ HAVE_WZAES\ HAVE_ZLIB\ MZ_ZIP_NO_SIGNING\  -include /Users/tibbe/work/benetics/app/ios/Pods/Target\ Support\ Files/RNZipArchive/RNZipArchive-prefix.pch -MMD -MT dependencies -MF /Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/RNZipArchive.d --serialize-diagnostics /Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/RNZipArchive.dia -c /Users/tibbe/work/benetics/app/node_modules/react-native-zip-archive/ios/RNZipArchive.m -o /Users/tibbe/Library/Developer/Xcode/DerivedData/benetics-dwyvcyxnastihafuyuudjmkkrlue/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/RNZipArchive.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/RNZipArchive.build/Objects-normal/x86_64/RNZipArchive.o
error: unsupported option '-G' for target 'x86_64-apple-ios13.4-simulator' (in target 'RNZipArchive' from project 'Pods')

The issue might be similar to https://github.com/invertase/react-native-firebase/issues/8020.

To Reproduce Steps to reproduce the behavior:

  1. Depend on this library from a RN project.
  2. Try to build project with Xcode 16.

Expected behavior No compilation error.

Env (please complete the following information):

Additional context Add any other context about the problem here.

tibbe commented 1 day ago

Removing react-native-zip-archive from the dependencies of my (large) project fixes the compilation issues and thus provides further evidence that there's a problem here.

mikehardy commented 1 day ago

@tibbe you mentioned in the react-native-firebase issue that there was perhaps a problem with messaging as well? I am unaware of a problem with messaging but wanted to confirm with you that you have things compiling now before I hide that comment.

I'm only aware of the need to:

I'm not aware of anything with messaging at the moment ?

tibbe commented 1 day ago

@tibbe you mentioned in the react-native-firebase issue that there was perhaps a problem with messaging as well? I am unaware of a problem with messaging but wanted to confirm with you that you have things compiling now before I hide that comment.

I'm only aware of the need to:

  • bump the firebase-ios-sdk (either with patch to @react-native-firebase/app/package.json or with a an override https://rnfirebase.io/#ios)
  • patch @react-native-firebase/firestore to remove the transitive dep on nanopb (assuming you use firestore)
  • patch @react-native-firebase/crashlytics to remove dependencies param from init provider (assuming you use crashlytics)

I'm not aware of anything with messaging at the moment ?

I managed to get it to compile by cleaning/recompiling harder so no issue with messaging I believe.

mikehardy commented 1 day ago

Great, thanks for replying, I'm going to hide that comment then to make the issue as easy to digest for people that need the workaround since build breaks are typically "panic mode" for people, but hiding the comment isn't "with prejudice" or anything. I think we've got the full set of workarounds in there but if you see anything else that is a build break obviously + please post it up. Cheers

tibbe commented 9 hours ago

It's not clear to me where '-G' sneaks in. When I do my react native build there's a very long list of EXPORT statements logged somewhere near the top of the build output and one of these contains GCC_WARN_INHIBIT_ALL_WARNINGS. I'm not sure how it gets there. That identifier isn't anywhere in my code base and I can't find it in react-native-zip-archive's either.

kptp commented 6 hours ago

I had the same issue. I think this is due to the GCC_PREPROCESSOR_DEFINITIONS compiler flags that was removed in the latest 7.0.1 version. It was removed in this commit: https://github.com/mockingbot/react-native-zip-archive/commit/9ea64067b2aa56f339ee0b642ff20f8d97b27d49 If you are using version 6.1.0, it is still in the pod spec.

Note that updating to 7.0.1 might require you to raise the minimum iOS version to 15.5 as per this repos README.md.

ankitjpk commented 6 hours ago

@kptp Do you think upgrading to 7.0.1 will resolve this issue?

kptp commented 6 hours ago

@ankitjpk I think it is worth trying, if you are able to upgrade it. The release note specifically mentions the XCode 16 issue: https://github.com/mockingbot/react-native-zip-archive/releases/tag/v7.0.1

ankitjpk commented 5 hours ago

@kptp Upgrading it causes Invalid react-native-config.podspec file: undefined methodvisionos' for #`. for this reason I stopped at 6.1.0 strict.

kptp commented 5 hours ago

@ankitjpk Are you using the react-native-config library? It sounds like an issue with that library, but I don't know anything about it