I wound up having to do your second piece of advice. I had to go into the project, then the project settings under general, scroll down to the area where frameworks and libraries are listed, and I saw my package listed there. I wound up having to click the minus sign to remove my package from that area. Then, I went to my Target and went to Package dependencies menu and I deleted the package reference in that location as well. Once I did another build action, I got a build error wherever I called import package in my swiftUI files. Once I clicked on the error, it asked for me to associate a package. I went and found my package locally on disk and added it. Once I did that, I went to my target build dependencies menu and saw that the package was then re-inserted and then went back to my project settings under general and found that that package had also been added to the frameworks and library section. At that point I was able to build again and with no errors.
So I guess the issue is that with both Xcode 15 and Xcode 16, at least with a Reality Composer Pro package, Xcode doesn’t properly preserve a Reality Composer Pro package going into a new branch created from my main branch. This happened multiple times during my app development process this summer. I submitted this issue in a couple of radar feedbacks earlier in the summer, but they were closed supposedly because there wasn’t enough information. I’d appreciate if Apple could go look at those two feedbacks and reopen them and fix it so that whenever a Reality Composer Pro package manifest is part of a branch repository and a new branch repository is created from an existing one, that these package dependency errors don’t occur.
Here are the feedback numbers:
FB14829607 and
FB14786606
Post
Replies
Boosts
Views
Activity
This is consistent in Xcode 16 Beta 6 and occurs on alll my source control feature branches, as well as my main branch. Does not occur on any of my source control feature branches, nor on my main branch, in Xcode 15.4.
it seems Xcode 16 is not properly handling my project‘s Reality Composer Pro package and is unable to locate the package even though it’s definitely in the path location to which the error is referring
Doing a clean build folder fails. Also resetting package cache executes but does not work to fix the build error. Deleting the DerivedData folder under /Library/Developer/Xcode does not work.
Link to similar issue I recently had:
https://developer.apple.com/forums/thread/761776
Apple. Please respond to this. I need Apple DTS support to understand how to fix these package build errors.
I am no longer getting the error when I build. Something about copying file content between source control branches and doing branch commits when switching branches caused the error to go away when I built the project again. I can’t explain.
Apple Developer support case number is 102373010395.
Feedback FB14786606 created.
Need Apple support on this. I’m stuck due to this build error and can’t proceed with my development.
Fixed in iOS and iPadOS 18 Developer Beta 5. Did not see a mention of the fix in the release notes.
SampleOrbitAnimationAppApp.swift
ImmersiveView.swift
ContentView.swift
I’d appreciate if you can provide some more information about systems. I’ve watched the WWDC session that shows a slide trying to relate entities components and systems. However, I still don’t really understand the relationship and when systems are used. Maybe your explanation can help me better understand that, and the relationships with entities and components and also help others.
Also, can you explain what you mean by my app’s initializer code? Can you explain that in terms of my feedback sample test project code in the cross referencedDeveloper forum post that I provided previously and linked you to. I need to understand it in terms of my actual code in my sample test app because I don’t know what you mean by my app’s initializer code. I don’t understand that context.
Finally, can you explain why I need to use a system versus an entity animation like I previously did for an orbit animation. I’m trying to work everything by defining them in Reality Composer Pro as entities with transform components, but I don’t understand why this has to be treated separately as a system and what is the point of registering that system. It seems inconsistent in the use of RealityKit entities and how we animate certain things. For instance, animating an orbit of entities seems was handled differently than doing a rotation of an earth entity. Orbit animation was basically handled through animation with a play animation method. Yet this earth rotation approach that you show here seems not to be an animation, but some other type of method for the Earth to rotate. It doesn’t make sense to me why the orbit of an entity is handled differently than a rotation of an entity. Any further explanation you can give to try to explain why this system is like this would be appreciated.
separate forum post
Thanks for the advice. In my code I actually didn't need to create the starship or earth entities because I already had them fully defined in Reality Composer Pro. I just added the orientToPath: true parameter and that kept the starship at the same orientation throughout the orbit path.
Also, I fixed the orbit plane problem by resetting the Earth (parent) transform component, rotation z value to 0, instead of 23. Now the starship orbits the earth on a level tilt around the earth.
Once last thing (I hope, :)) how would I have the earth (parent) entity rotate CCW underneath the orbiting starship child?
I tried adding the following code block to the RealityView but it is not working:
if let rotatingEarth = starshipEntity.findEntity(named: "Earth") {
rotatingEarth.transform.rotation = simd_quatf.init(angle: 360, axis: SIMD3(x: 0, y: 1, z: 0))
if let animation = try? AnimationResource.generate(with: rotatingEarth as! AnimationDefinition) {
rotatingEarth.playAnimation(animation)
}
}
Any advice on getting the earth to rotate?
I tried reviewing the Hello World WWDC23 project code, but I was unable to understand the complexity and how that sample project got the earth to rotate.
I have some progress but still need help.
I needed to make a new scene in RCP where the starship is a child to the Earth. The OrbitAnimation struct causes a child entity to orbit around a parent entity.
It now works, but I have a lot to fix to make the starship rotate its orientation so the same side always faces the earth and I need to adjust the angle of the orbit and other parameters. So help is still needed.
iOS/iPadOS 18 Developer Beta 3 still has this bug.