Closed trueb2 closed 1 year ago
I ran into a couple other issues related to inconsistent iOS builds. The number one issue is that all builds stopped working. The root cause was that the $(DERIVED_FILE_DIR) did not exist all the sudden after clean and build. Xcode just stopped making it for some reason. This statement is the one that blew up
if [ -f "$DEP_FILE_SRC" ]; then
DEP_FILE_DST="${DERIVED_FILE_DIR}/${CARGO_XCODE_TARGET_ARCH}-${EXECUTABLE_NAME}.d"
cp -f "$DEP_FILE_SRC" "$DEP_FILE_DST"
echo >> "$DEP_FILE_DST" "$SCRIPT_OUTPUT_FILE_0: $BUILT_SRC"
fi
The native-staticlib framework depends on $DEP_FILE_DST, so I just added mkdir -p $(DERIVED_FILE_DIR)
before the copy attempt. Idk why this stopped working for me.
The other issue I ran into was that the build scheme stopped using Debug and Release correctly (mix and matching flutter and cargo build scheme). If you click on Runner and edit scheme, you can change all of the categories (Analyze especially) to Release or Debug. Again, idk why this changed at some point in using Xcode.
Stuff works again now, I added some echos to make it a little easier to figure out why xcode stopped building the same as before. The only thing that was really different was the lack of a $DERIVED_FILE_DIR.
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
This issue has been marked as stale because it has no activity recently. Please remove the 'stale' label, or comment if the issue persists.
I ran into an issue that I may have missed in the documentation but think are probably misconfigured. You would get errors like these since the library isn't built or linked.
The native framework from cargo-xcode that is in the template was identified via absolute path. I had to change that to a relative path manaully in xcode.
The other issue I had was that the Runner project did not depend on native. I manually added the native framework to Runner, then the build worked.
The last thing that I noticed were warnings about compiling for the right version of iOS, so I set deployment targets manually on native and Runner. I think there was a mismatch in the lipo defaults and Flutter AppFrameworkInfo default.
Here are some screenshots on where to look in Xcode.
All good now! 🎉 Thanks for the template!