-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
[iOS] RN 0.60.0-rc.2 fails to build with CocoaPods frameworks #25349
Comments
I've met the same issue trying to integrate |
I have been looking into this some more and I wanted to give a quick update to share what I have found. The build error I posted in the description is easily solved by adding Once I did this, I started seeing a different error:
I fixed this by setting Next I saw this error:
I solved this by adding Now I saw this error:
This was solved by adding Finally, I am now seeing the following error:
This is where I am stuck. It seems that Update: I have been able to resolve the import error above by changing
|
I am continuing to dump everything I find here. Hopefully it will be helpful for coming to a solution. I have made some more progress but I think some non-trivial changes will be needed. I have managed to get things building, but only by adding I believe the reason for the last error in my previous comment ( If I am correct about the cause here, I think there are a few options:
I would love to hear if others think I am on the right track here. I am happy to jump in with any implementation as needed. We are hoping to adopt 0.60.0 in https://github.com/wordpress-mobile/gutenberg-mobile once it is released and this is a blocker for us. |
Hey @jtreanor thanks for all your work! I've tried to raise this in the core contributors discord - but sadly I haven't got much feedback (one dev really good at iOS-fu should be back from holidays tomorrow 😅). One of the few things I got told is that this overall issue with And also, it seems that in most scenarios not having (anyway, I'll try to raise this to a few more people in the meantime) |
Thanks for the response @kelset.
I really appreciate this!
Unfortunately, that's not going to be possible for us because Gutenberg, the project we are working on, is itself a pod that is written in Swift. Swift pods can only be installed with the I don't have a good answer on the number of pods that don't support After more investigation, I found a way to avoid the larger changes I suggested in my previous comment. I have opened a PR here: #25393 It's possible that changing the |
I will have a play, but I created a simple repo way back with Swift (without |
I will check that out @jenshandersson but unfortunately, I don't think it will work with 0.60+. That is the same workflow we are using and it was fine until 0.60.0. |
@jtreanor I got the same workflow working with 0.60.0-rc.2 just now. It might be easier to fix projects by removing What pods are you using so I can test it in my repo? |
@jenshandersson Sorry I misread your previous comment. That is a different workflow. Thanks for checking!
As I mentioned above, in our case the problem isn't any individual pod but the fact that our project defines a podspec which depends on
And if I try to solve this warning by using This may be a slightly unusual use case but I do think that if React Native is going to integrate with CocoaPods, it should be compatible with most common setups, and |
Usually the fix is to change the .m extension to .mm. The extension change will be needed when including the new system like fabric/turbomodule as well, so we can change it as needed. |
Yes, changing to .mm where C++ is imported is usually the way to go, but the error here isn't that |
Summary: This is the first step towards fixing #25349. These are the changes to the podspec to correctly update dependencies and build config that will cause any breaking change for users or libraries. I am breaking these changes out from #25393 as suggested by fkgozali in #25393 (comment). These are the changes: - Made C++ headers in `React-Core` private by default so that ObjC files can import the module without failures. - Reduced the number of `yoga` headers that are exposed for the same reason as above. As far as I can see this doesn't cause issues but we can find another solution if it does. - Adding some missing dependencies to fix undefined symbols errors. - Added `DoubleConversion` to `HEADER_SEARCH_PATHS` where it was missing. ## Changelog [iOS] [Fixed] - Updated podspecs for improved compatibility with different install types. Pull Request resolved: #25496 Test Plan: Everything should work exactly as before. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which points at this branch to show that it is still working `Podfile` to demonstrate this is fixed. You can see that it works with these steps: 1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git` 2. `git checkout podspec-updates` 3. `cd ios && pod install` 4. `cd .. && react-native run-ios` The sample app will build and run successfully. Reviewed By: mmmulani Differential Revision: D16167346 Pulled By: fkgozali fbshipit-source-id: 1917b2f8779cb172362a457fb3fce686c55056d3
We faced a very similar issue when doing cocoapod repo lint when
|
Oh, interesting @MaRuifeng. Unless I'm mistaken that error should have been fixed in #25496, which is now in master. |
@jtreanor Ah, we will check again. We encountered this issue a few days ago. |
I also encountered the same problem, I used 0.59 before, swift version is 4.2, everything is normal, but the latest version of xcode, only supports swift5.0 version, I have to upgrade my own version of the framework to swift5. 0. But at this time ReactNative0.59 has another bug. I found that I need to upgrade to the latest version of ReactNative in the discussion. When I have upgraded to ReactNative 0.60.3, I still have the bug mentioned above. |
This comment has been minimized.
This comment has been minimized.
Is it known - has this fix finally been released (or at least scheduled) as of version |
@genuinezack Nope, the fix isn’t in 0.60.5 due to the breaking changes involved. I would expect to see it in 0.61.0 |
Didn't use |
@jtreanor where to add the 'DEFINES_MODULE' => 'NO' ? |
Works for me! Especially the switching to a legacy system. |
Changing this line in Conv.h just fixed it for me:
to
RN: 0.60.5 |
@gdavidetanca Haha, that works. I mean, obviously not what you should be doing, but... It works. |
That works for me too! although I shouldn't be doing that. Is there a proper way to fix this? |
The changes I made to fix this are included in 0.61.0-rc.3 so that version should now be working with |
I can confirm. I'm on 0.61-rc3 and it works. |
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
I am facing 'React/RCTBundleURLProvider.h' file not found in AppDelegate file. I am not using frameworks. Using libraries libpods.app.a file to link. Here my question is all my packages in the podfile is removed automatically after run pod install
|
@nihp There are multiple things off in your Podfile. It seems you converted from a <=0.59 project? |
Redefinition of Module React , previously defined here in Dev Support module, Any idea. I have upgraded react-native version from 0.59.8 to 0.60.6. Any idea anyone? |
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
…ase BoM - [android] upgrade to Android X - [android] upgrade gradle wrapper to v5.4.1 - [android][ios][tests] remove manual packages & enable auto-linking - [tests][internal] upgrade tests project to RN 60 - [ios] temporarily remove framework support in pods - broken in RN 60 - see facebook/react-native#25349 - [linting] switch to use rn community linting rules
The changes in 0.60.0 to integrate CocoaPods by default are causing build failures if your
Podfile
includesuse_frameworks!
.use_frameworks!
is a very commonly used CocoaPods option and it is required by many pods. Prior to 0.60.0 it worked fine with the React Native podspec.React Native version:
Steps To Reproduce
react-native init AwesomeProject --version 0.60.0-rc.2
.use_frameworks!
to the top ofios/Podfile
cd ios && pod install
.cd .. && react-native run-ios
You will see build failures that look something like this:
Describe what you expected to happen:
The app should build and run successfully.
Snack, code example, or link to a repository:
I have created a sample repository to demonstrate the issue here: https://github.com/jtreanor/react-native-cocoapods-frameworks.
Causes and fixes
I have been able to fix the error shown in the log above with some
.podspec
changes, but there are few more errors I haven't been able to solve. You can see my WIPreact-native
branch here.The text was updated successfully, but these errors were encountered: