Skip to content
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

README.md for Compose Multiplatform/iOS development is required. #789

Open
Corvus400 opened this issue Aug 25, 2024 · 12 comments
Open

README.md for Compose Multiplatform/iOS development is required. #789

Corvus400 opened this issue Aug 25, 2024 · 12 comments

Comments

@Corvus400
Copy link
Contributor

A fair amount of knowledge should be required, but nowhere is it mentioned what operations are needed to build the environment or in everyday development.
It might be nice if the README.md was placed in a module such as app-ios-shared and linked from the README.md in the project root.

@Corvus400
Copy link
Contributor Author

I may be able to create a draft for now, but I'm not quite sure if it will be correct.
I would love to get some help from iOS people or people familiar with XCFramework. 🙇

@takahirom
Copy link
Member

We are experiencing some issues with X64 architecture. However, for ARM users, we can refer to the README in the app-ios directory of the DroidKaigi 2024 conference app repository. I believe we are facing two distinct problems: running the app on a physical device and running it on an X64

@takahirom
Copy link
Member

Related discussion:
#768

@takahirom
Copy link
Member

@mannodermaus
Copy link
Contributor

I can confirm that the build was successful on x64 after following the revised instructions! The current script will always build both debug and release builds, however, which adds a lot of time to each build. Maybe we could constrain it to just the debug build for normal development, and then create a separate release pipeline for that variant?

@takahirom
Copy link
Member

@mannodermaus I agree. Could you rename it to "x86_64Debug" or something similar, and filter the debug version as "arm64SimulatorDebug"?

@Corvus400
Copy link
Contributor Author

@takahirom
Thank you for your response! 🙏
However, I can build the iPhone Simulator, but I can't seem to build on the actual iPhone device if I follow the instructions. 😭
I tried adding the command, but still no luck.

./gradlew iosArm64AggregateResources --no-configuration-cache

スクリーンショット 2024-08-26 2 33 00

@Corvus400
Copy link
Contributor Author

@takahirom
I have tried everything since then, but the build to the actual device is still not successful. 😭
We will proceed with development only in the simulator. 🫡

@mannodermaus
Copy link
Contributor

mannodermaus commented Aug 25, 2024

@takahirom I have patched it locally so that the configuration in Xcode dictates which XCFramework to build (debug or release). This works fairly well. I'll submit this proposal as a PR shortly and you can decide what to do with it. 🙇‍♂️

build_xcframework_with_xcode_environment_variable.sh:

 # Initialize the target architecture
 target_arch=""
+target_configuration=""

+if [[ "$CONFIGURATION" == *"Debug"* ]]; then
+  target_configuration="Debug"
+elif [[ "$CONFIGURATION" == *"Release"* ]]; then
+  target_configuration="Release"
+fi

-./gradlew assembleSharedXCFramework --no-configuration-cache -Papp.ios.shared.arch=$target_arch
+./gradlew assembleShared${target_configuration}XCFramework --no-configuration-cache -Papp.ios.shared.arch=$target_arch

@takahirom
Copy link
Member

@Corvus400
I wasn't able to build as I'm seeing the error "Signing for 'DroidKaigi2024App' requires a development team. Select a development team in the Signing & Capabilities editor."

However, I think you can run Clean Build Folder after executing ./gradlew app-ios-shared:assembleSharedXCFramework -Papp.ios.shared.arch=arm64 --no-configuration-cache. (In my environment, this was able to fix the "no library for this platform" error.)

@mannodermaus Thanks!

@Corvus400
Copy link
Contributor Author

@takahirom
Thank you very much!
I will try again when I have more time!

@Corvus400
Copy link
Contributor Author

Corvus400 commented Aug 27, 2024

@takahirom
I was able to install it on the actual iPhone device! 🥳
(It did not crash when activated.)

The steps we tried are as follows

  1. run Clean Project in Android Studio
  2. . Run /gradlew app-ios-shared:assembleSharedXCFramework -Papp.ios.shared.arch=arm64 --no-configuration-cache
  3. run make bootstrap
  4. try to install on the actual device
  5. build error
  6. run Clean Build Folder in Xcode
  7. run . Execute /gradlew app-ios-shared:assembleSharedXCFramework -Papp.ios.shared.arch=arm64 --no-configuration-cache
  8. try to install on the actual device
  9. Installation succeeded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants