react-native-unity
react-native-unity copied to clipboard
Remote builds with new setup. EAS Build. Framework not found.
We are having some trouble updating to the latest version of this excellent package:
-
We are using a development client build with EAS and using the EAS build service to deploy. If I am understanding the latest README correctly, the framework would sit inside the node_modules directory. As the cloud service installs a fresh set of dependencies on every build how would we have the framework in the node_modules?
-
When trying to build the latest example I am getting the error :
fatal error: 'UnityFramework/UnityFramework.h' file not found include <UnityFramework/UnityFramework.h>
Any help is appreciated, thanks.
Hi
You can try customizing the path to your framework in the react-native-unity.podspec file
s.vendored_frameworks = ["<YOUR_PATH>"]
OR
You can comment out the line s.vendored_frameworks = ["ios/UnityFramework.framework"]
and use the method from the previous version of the package
OR
edit react-native-unity.podspec
and now you can put UnityFramework.framework in the unity folder in the project and send it to EAS
s.prepare_command =
<<-CMD
cp -R ../../../unity/builds/ios/ ios/
CMD
s.vendored_frameworks = ["ios/UnityFramework.framework"]
I had the same issue, updating to the latest version (1.0.6) fixed the unable to find UnityFramework error for me.
However, I am now getting compiler errors. I do not get these errors running the unity app standalone, and I didn't have them before the update. Any ideas?
Errors:
react-native-unity/Libraries/external/baselib/includes/C/Baselib_Debug.h - line4: A type specifier is required for all declarations
react-native-unity/Libraries/libil2cpp/include/os/c-api/il2cpp-config-api-platforns.h - line3: 'os/c-api/il2cpp-config-platforms.h' file not found
Environment: Unity - 2021.3.32f1 Xcode - 15.0.1
I had the same issue, updating to the latest version (1.0.6) fixed the unable to find UnityFramework error for me.
However, I am now getting compiler errors. I do not get these errors running the unity app standalone, and I didn't have them before the update. Any ideas?
Errors:
react-native-unity/Libraries/external/baselib/includes/C/Baselib_Debug.h - line4: A type specifier is required for all declarations
react-native-unity/Libraries/libil2cpp/include/os/c-api/il2cpp-config-api-platforns.h - line3: 'os/c-api/il2cpp-config-platforms.h' file not found
Environment: Unity - 2021.3.32f1 Xcode - 15.0.1
It's hard to tell without seeing what and how you have it set up But there is no such path in the project, where did it come from?
I think potentially because the unity project is now wrapped in your pod it's picking up compiler settings etc from your pod xcode settings. Reverted to having the unity app as its own project.
I had the same issue, updating to the latest version (1.0.6) fixed <UnityFramework/UnityFramework.h>
.
But seems copying the unity project (cp -R ../../../unity/builds/ios/ ios/) brings other errors.
Environment: Unity - 2022.3.11f1 Xcode - 15.0.1
I had the same issue, updating to the latest version (1.0.6) fixed
<UnityFramework/UnityFramework.h>
. But seems copying the unity project (cp -R ../../../unity/builds/ios/ ios/) brings other errors.Environment: Unity - 2022.3.11f1 Xcode - 15.0.1
it is advisable to run the command after adding a new framework to the unity/builds/ios
folder
rm -rf ./ios/Pods && rm -r ./ios/Podfile.lock && npx pod-install
it is advisable to run the command after adding a new framework to the
unity/builds/ios
folderrm -rf ./ios/Pods && rm -r ./ios/Podfile.lock && npx pod-install
by running the command does help. It looks very close now.
Not sure why there's issue on Preprocessor.h
and cannot reference to <XCTest/XCTest.h>
Hi
You can try customizing the path to your framework in the react-native-unity.podspec file
s.vendored_frameworks = ["<YOUR_PATH>"]
OR
You can comment out the line
s.vendored_frameworks = ["ios/UnityFramework.framework"]
and use the method from the previous version of the packageOR
edit
react-native-unity.podspec
and now you can put UnityFramework.framework in the unity folder in the project and send it to EASs.prepare_command = <<-CMD cp -R ../../../unity/builds/ios/ ios/ CMD s.vendored_frameworks = ["ios/UnityFramework.framework"]
I'm having a really hard time understanding why I'm getting this error now as well. I've been using v0.3.1 and I've had no issues building android or iOS projects. Thank you so much again for such an amazing asset BTW. As of last night, I haven't built my project in Xcode since November 24th. In the past I recall seeing this error and fixing it with a rebuild/reboot. However, now I can't seem to resolve it. Because v0.3.1 has worked so well for me, I haven't upgraded the project, my phone or MacOS(Xcode) and nor do I want to at this time in fear of running into other issues.
@azesmway I know you have been busy with tons of issues. I've been watching them come across my phone over the last couple of months. However, if you have the time and the energy. Would you please advise as yo any reasoning I may be getting this error more consistently now? Especially given that nothing has changed in my local environment. It's probably for sure something odd on my side. But doing a quick sanity check and asking here for peace of mind.
Kind regards,
Truman
Hi
You can try customizing the path to your framework in the react-native-unity.podspec file
s.vendored_frameworks = ["<YOUR_PATH>"]
OR
You can comment out the line
s.vendored_frameworks = ["ios/UnityFramework.framework"]
and use the method from the previous version of the packageOR
edit
react-native-unity.podspec
and now you can put UnityFramework.framework in the unity folder in the project and send it to EASs.prepare_command = <<-CMD cp -R ../../../unity/builds/ios/ ios/ CMD s.vendored_frameworks = ["ios/UnityFramework.framework"]
I'm having a really hard time understanding why I'm getting this error now as well. I've been using v0.3.1 and I've had no issues building android or iOS projects. Thank you so much again for such an amazing asset BTW. As of last night, I haven't built my project in Xcode since November 24th. In the past I recall seeing this error and fixing it with a rebuild/reboot. However, now I can't seem to resolve it. Because v0.3.1 has worked so well for me, I haven't upgraded the project, my phone or MacOS(Xcode) and nor do I want to at this time in fear of running into other issues.
@azesmway I know you have been busy with tons of issues. I've been watching them come across my phone over the last couple of months. However, if you have the time and the energy. Would you please advise as yo any reasoning I may be getting this error more consistently now? Especially given that nothing has changed in my local environment. It's probably for sure something odd on my side. But doing a quick sanity check and asking here for peace of mind.
Kind regards,
Truman
This is the error I can't shake since my last build November 24th, 2023. I tried updating to 1.0.6 and saw so many errors I reverted back to 0.3.1, if I can clear this file error I'd very much like to stay until my project development has gotten a bit further.
The instructions for how to manually force the file path I haven't figured out yet. Is this odd that I started getting this error using an older package version?
Please advise when and if able...
Hi You can try customizing the path to your framework in the react-native-unity.podspec file
s.vendored_frameworks = ["<YOUR_PATH>"]
OR You can comment out the lines.vendored_frameworks = ["ios/UnityFramework.framework"]
and use the method from the previous version of the package OR editreact-native-unity.podspec
and now you can put UnityFramework.framework in the unity folder in the project and send it to EASs.prepare_command = <<-CMD cp -R ../../../unity/builds/ios/ ios/ CMD s.vendored_frameworks = ["ios/UnityFramework.framework"]
I'm having a really hard time understanding why I'm getting this error now as well. I've been using v0.3.1 and I've had no issues building android or iOS projects. Thank you so much again for such an amazing asset BTW. As of last night, I haven't built my project in Xcode since November 24th. In the past I recall seeing this error and fixing it with a rebuild/reboot. However, now I can't seem to resolve it. Because v0.3.1 has worked so well for me, I haven't upgraded the project, my phone or MacOS(Xcode) and nor do I want to at this time in fear of running into other issues. @azesmway I know you have been busy with tons of issues. I've been watching them come across my phone over the last couple of months. However, if you have the time and the energy. Would you please advise as yo any reasoning I may be getting this error more consistently now? Especially given that nothing has changed in my local environment. It's probably for sure something odd on my side. But doing a quick sanity check and asking here for peace of mind. Kind regards, Truman
This is the error I can't shake since my last build November 24th, 2023. I tried updating to 1.0.6 and saw so many errors I reverted back to 0.3.1, if I can clear this file error I'd very much like to stay until my project development has gotten a bit further.
The instructions for how to manually force the file path I haven't figured out yet. Is this odd that I started getting this error using an older package version?
Please advise when and if able...
The UnityFramework is not built yet.
Add the Unity framework in a Build Phase > Target Dependencies will force it to build the Unity framework first. Then the error will be gone.
@jimMatterless Hi Jim, thank you for reaching out. I was able verify I have this configured for the Unity exported project. I don't have it configured for the React-Native project. Is this how you mean? Having the target dependencies in the exported Unity-iPhone project?
@jimMatterless Hi Jim, thank you for reaching out. I was able verify I have this configured for the Unity exported project. I don't have it configured for the React-Native project. Is this how you mean? Having the target dependencies in the exported Unity-iPhone project?
My configuration for reference:
Unity 2021.3.25f1 React-Native 18.2.0 Azesmay react-native-Unity 0.3.1
I've been running this configuration building for iOS and Android for several months now. Only having the Unity framework issue as of today.
I have other projects with the same asset and I can build just fine. I must of did something while coding tired that I don't recall.🫠
@jimMatterless Hi Jim, thank you for reaching out. I was able verify I have this configured for the Unity exported project. I don't have it configured for the React-Native project. Is this how you mean? Having the target dependencies in the exported Unity-iPhone project?
@TruAmbition I did it in the final embedded project instead. The one exported from Unity is fine. I tried many ways and there are two solutions I could fix.
-
Add the Unity framework in a Build Phase > Target Dependencies in the final project, so it builds the Unity framework again.
-
Look at the UnityFramework.framework in the final project and check the size, if it is zero kb, I copy the built one to replace it.
I feel like the iOS pipeline is missing something to link the framework properly.
I've added a description to the plugin Please - read the Readme.md
I've added a description to the plugin Please - read the Readme.md
Reading through the a few times today. When you mentioned the following:
If you used a previous version of the plugin - then be sure to delete everything that was related to Unity in the main react native project!
You are referring to deleting the unity framework references in the general and build phases tabs in Xcode ?
I'm trying to work through this by upgrading the package and working through the readme but I keep getting blasted with errors on build.
@jimMatterless Hi Jim, thank you for reaching out. I was able verify I have this configured for the Unity exported project. I don't have it configured for the React-Native project. Is this how you mean? Having the target dependencies in the exported Unity-iPhone project?
@TruAmbition I did it in the final embedded project instead. The one exported from Unity is fine. I tried many ways and there are two solutions I could fix.
- Add the Unity framework in a Build Phase > Target Dependencies in the final project, so it builds the Unity framework again.
- Look at the UnityFramework.framework in the final project and check the size, if it is zero kb, I copy the built one to replace it.
I feel like the iOS pipeline is missing something to link the framework properly.
@jimMatterless Thank you! I'm trying to find a way to add it as a target in my main project. Also working on trying to get the 1.0.6 package to work so I can be aligned with the latest changes since I'm already in a broken state. I really appreciate you and your community support on this.
@TruAmbition hi The react native project in xcode should now be clean - no Unity at all! You create an ios build from Unity to ANY folder on your computer. You build it in xcode as it is written in the documentation - pull "UnityFramework.framework" from there and move it to the folder - <YOUR_PROJECT_RN>/unity/builds/ios Execute the command in the root of the main RN project rm -rf ios/Pods && rm -f ios/Podfile.lock && npx pod-install
@TruAmbition hi The react native project in xcode should now be clean - no Unity at all! You create an ios build from Unity to ANY folder on your computer. You build it in xcode as it is written in the documentation - pull "UnityFramework.framework" from there and move it to the folder - <YOUR_PROJECT_RN>/unity/builds/ios Execute the command in the root of the main RN project rm -rf ios/Pods && rm -f ios/Podfile.lock && npx pod-install
It works! I have UnityFramework.framework folder in my unity/builds/ios
right now and I no longer have that error.
Thanks all! I'll take some time to try this when the time comes. For now, I reverting my project back to the last successful build and have proceeded with my react-native dev work. Still using 0.3.1 for now however, I very much appreciate the help and insight from everyone that responded. 🦾
I had the same issue, at version with "@azesmway/react-native-unity": "^1.0.7"
Environment: Unity - 2022.3.11f1 Xcode - 15.0.1
I have spend a lot of time to attempt it for last one week & tried manys ways to resolve it but remain until falied so kindly guide me properly that how to solve it.
Now using latest version (1.0.7) with react-native "@azesmway/react-native-unity": "^1.0.7", "react": "18.2.0", "react-native": "0.72.3"
I have cleand properly with this below command Replace [PRJECT_NAME] with RNUnity "cd ios; rm -rf ~/Library/Caches/CocoaPods; rm -rf Pods; rm -rf [PROJECT_NAME].xcworkspace; rm -rf ~/Library/Developer/Xcode/DerivedData/*; pod deintegrate; rm -f ios/Podfile.lock; pod setup; arch -x86_64 pod install;"
Also you may look the short video at below for better understanding of this issue coming
https://drive.google.com/file/d/18LZpOL3uOZZ5Ae5XkGdaQdQGFjrVZrhC/view?usp=sharing
I shall be very thankful to you for this guideness to resolving @azesmway @Silver292 @jack-wood @TruAmbition @dattran1232003
If there are many issues occuring such that then you shifted to lower version "@azesmway/react-native-unity": "^0.4.0", After doing this you have scceeded to relsolve the multiple errors and achive to run the build with successfully
@TruAmbition hi The react native project in xcode should now be clean - no Unity at all! You create an ios build from Unity to ANY folder on your computer. You build it in xcode as it is written in the documentation - pull "UnityFramework.framework" from there and move it to the folder - <YOUR_PROJECT_RN>/unity/builds/ios Execute the command in the root of the main RN project rm -rf ios/Pods && rm -f ios/Podfile.lock && npx pod-install
Thank you for answer, but i dont understand some details.
Where i can find "UnityFramework.framework" ? When i am exported my Unity game from Unity , i dont have this file in my folder