-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[tvOS] - Xcode build failing with babel/webpack/metro related errors #1754
Comments
@iAMkVIN-S thanks for very detail description, will look into it and try to reproduce, as for now I see you are asking for demo app, so in renative monorepo there are 2 app packages, one is app-harness, the other is template-starter |
@pauliusguzas Thank you for your prompt reply. I will compare the As added information: Please let me know how I can assist further in fixing the issue 🙏 |
@pauliusguzas Following up with last night's response: I have tried matching the Xcode builds are still failing with the same set of errors. |
I have the same issue alas. Anyone figured it out already? I can run but not build |
@ChristopheSnacken - Out of curiosity, did you get the same trail of errors/fixes as above? |
With me it's mainly that metro is not picking up on .tvos extension. He is going for the standard index.js file instead of the index.tvos.js file. When I use the "run" instead of "build" command, and without the "-s release" it picks up the correct file extensions. `None of these files exist :
|
@iAMkVIN-S Hello. I can't reproduce this. Could you create a minimal reproducible example to help? Note: entryFile points to the index.js file in the root of the project. Why did you try to change that? |
@ElenaDiachenko I'm sorry for the delay, I was away last week. To confirm, what should the value of I will work on trying to strip the project down for a reproducible example. |
Sorry for the confusion @ElenaDiachenko - It must have been between tries, I can confirm the errors above were happening with |
@ElenaDiachenko What's the best way to share a reproducible example with you privately? |
Can you try adding |
@RobertArissen This seems to have fixed the issue. After adding the above to my babel.config.js :
I have a successful build. Thank you so much. ![]() How can we improve the documentation around the above (babel,webpack,metro files which needed modifications to build) as well as some other non-documented items such as the Happy to help if needed. |
@ElenaDiachenko // @RobertArissen Although my Xcode Archive is now building from the suggestion above, when I try launching the tvOS App, it instantly crashes. When attempting to run build on a Apple TV Simulator using
|
Because of the discrepancy between the documentation pages for iOS and tvOS, is it possible to have confirmation on what commands should be ran in order to generate a tvOS build for:
Also, can you confirm the I have countless combinations, most recently:
My current
However, the build still crashes on launch. Thank you very much! |
I think I may have found the problem. It appears that none of the RNV environment variables work with How can we resolve this? @Marius456 @ElenaDiachenko |
That's a great find Robert! What should the value of Or do you think even when passing it like this, it's being lost by the commands that are executed following this one? |
Yes, it seems that during the step The file |
@iAMkVIN-S Can you try updating rnv packages to |
@RobertArissen Hello Robert, thank you for the quick reply. Here are the steps that I did: (3) Updated the (4) Updated the (5) Installed node_modules with (6) Built for tvOS with (7) Opened the ![]() I still get the following error in the simulator after a successful build: ![]()
|
@RobertArissen // @Marius456 // @ElenaDiachenko // @pauliusguzas Good monday morning to you beautiful people! 👋 Have you got any update on the Thank you so much |
@iAMkVIN-S hello, this should be solved with 1.8.0-rc.0 (should be published very soon). Please try it and tell if it is solved |
@iAMkVIN-S When you run To create a release build, you need to specify the release scheme explicitly. For example:
|
The issue has been fixed. Thank you so much for the help, and I wish everyone on the team a Happy New Year! ✌️ |
Describe the bug
When trying to build for tvOS, the renative build succeeds, but the Xcode archive fails with syntax errors that seem related to babel/webpack/metro. However, no custom babel/webpack configuration has been added on our side.
tvOS simulator works fine.
AndroidTV simulator works fine.
AndroidTV build works fine.
To Reproduce
1.
npx rnv build
2. Select tvos
3. When build succeeds, open RNVApp.xcworkspace
4. In Xcode, on the middle navigation menu, select target RNVApp-tvOS
![image](https://private-user-images.githubusercontent.com/40800721/375857247-a5da9a09-428e-4d39-bc78-35b7f547ebe1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAzNDAsIm5iZiI6MTczOTAxMDA0MCwicGF0aCI6Ii80MDgwMDcyMS8zNzU4NTcyNDctYTVkYTlhMDktNDI4ZS00ZDM5LWJjNzgtMzViN2Y1NDdlYmUxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMjA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI4NzUzNDdiZmUxZTg1NmM1OGFmYjQ1NDE1YjAwODI1ZjAxZWE3ZjY3Y2VmNTY0OTZjMzE4ZGFjNmE0YzYzYjQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.f1CLfyROFW_i0_0kFyFtcxtMEEdV3OoFks1_iSMsMOA)
5. At the top navigation menu, select tab General
![image](https://private-user-images.githubusercontent.com/40800721/375857976-7d78ed2e-85d5-4484-aaa1-d7be5aa75922.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAzNDAsIm5iZiI6MTczOTAxMDA0MCwicGF0aCI6Ii80MDgwMDcyMS8zNzU4NTc5NzYtN2Q3OGVkMmUtODVkNS00NDg0LWFhYTEtZDdiZTVhYTc1OTIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMjA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg2MDVmNjgxNTgzNWY5ZDhhMjVmMjYzMzc0NDA4OGYzMjI0M2Y0MWJmNjdhY2EzMGFkNzdhYWI3MGFkNWU4MTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hgZXJT7gmYrmedRzr6C3tA5Hf1zPmINR5jLzJdd_O5g)
6. Set the Display Name , Bundle Identifier, Version and Build
7. At the top navigation menu, select tab Signing & Capabilities and set your Team
![image](https://private-user-images.githubusercontent.com/40800721/375858437-ca08b44e-ba35-46ec-a0f6-719777f107b9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAzNDAsIm5iZiI6MTczOTAxMDA0MCwicGF0aCI6Ii80MDgwMDcyMS8zNzU4NTg0MzctY2EwOGI0NGUtYmEzNS00NmVjLWEwZjYtNzE5Nzc3ZjEwN2I5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMjA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBhZWI3NTU4ZmZhODc1NDVlM2Q3YjAyZjRjMjVkMjQzZTMzMGM5YTRiN2Q4ZmYzODRkZmQzMWZjZjA3NTNlMGImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.MOU8wto96EZbd8cv4_TpzgKFqviYKgAi8jHd9iPszXw)
8. Using the MacOS toolbar, select Product and then Archive to start the Xcode build
![image](https://private-user-images.githubusercontent.com/40800721/375859196-458e4633-6dd3-48b2-b68a-305e44067cf6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwMTAzNDAsIm5iZiI6MTczOTAxMDA0MCwicGF0aCI6Ii80MDgwMDcyMS8zNzU4NTkxOTYtNDU4ZTQ2MzMtNmRkMy00OGIyLWI2OGEtMzA1ZTQ0MDY3Y2Y2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA4VDEwMjA0MFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQyM2RiOTg2MzE4YTcxOTAxNzBhNDZiODAwZGI2YTU3MzViNzMxNTk5Zjk2M2M1Njc3ZDVjM2ZiYjhmNTUyZjEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.P72COY5SusYR-qlWBwKdMiW6roJE89N2_QPDDRZvt9M)
The build will fail with the following error:
error SyntaxError: /Users/kevin/Documents/REPOS/jimmy/jstv/js-tv/src/app/index.tsx: Support for the experimental syntax 'jsx' isn't currently enabled (32:5):
Upon following the instructions in the error and looking for a solution, there seems to be two steps to do:
9. Add a babel presets to your devDependencies using
npm i @babel/preset-react --save-dev
andnpm i @babel/preset-flow --save-dev
10. Modify your babel.config.js :
11. Rebuild with steps 1 to 8
The build will now fail with the following error:
error SyntaxError: /Users/kevin/Documents/REPOS/jimmy/jstv/js-tv/node_modules/react-native/index.js: Unexpected keyword 'typeof'. (14:7)
Upon following the instructions in the error and looking for a solution, there seems to be one step to do:
12. Modify your webpack.config.json :
13. Rebuild with steps 1 to 8
The build will now fail with the following error:
error Unable to resolve module missing-asset-registry-path from /Users/kevin/Documents/REPOS/jimmy/jstv/js-tv/src/assets/defaultThumbnail.jpg: missing-asset-registry-path could not be found within the project or in these directories:
Upon following the instructions in the error and looking for a solution, there seems to be two steps to do:
14: Add a metro dependencies
npm i @react-native/metro-config --save-dev
andnpm i react-native-svg-transformer --save-dev
15: Modify your modify.config.json :
16. Rebuild with steps 1 to 8
The build will now fail with the following error:
error node_modules/react-native-svg/src/elements/Symbol.tsx: /Users/kevin/Documents/REPOS/jimmy/jstv/js-tv/node_modules/react-native-svg/src/elements/Symbol.tsx: We don't know what to do with this node type. We were previously a Statement but we can't fit in here?.
Upon following the instructions in the error and looking for a solution, there seems to be one step to do:
17: Install missing dependencies from step 9 with
npm i @babel/preset-env --save-dev
andnpm i @babel/preset-typescript --save-dev
(my bad, we added them in the babel.config.json and I had not installed them)18. Rebuild with steps 1 to 8
The build will now fail with the following error:
private properties are not supported
At this point, I cannot find any working solutions, and feel as if I don't want to go too far off course from the default Renative setup. Any suggestions? How should the tvOS build normally go? Does renative have a functional demo app to compare to?
Expected behavior
Xcode archive should succeed without any build errors.
Desktop and other information:
My renative.json
/platforms/tvos
:The text was updated successfully, but these errors were encountered: