DroidKaigi / conference-app-2024

The Official Conference App for DroidKaigi 2024
Apache License 2.0
421 stars 200 forks source link

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

Open Corvus400 opened 3 weeks ago

Corvus400 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

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 commented 3 weeks ago

Related discussion: https://github.com/DroidKaigi/conference-app-2024/discussions/768

takahirom commented 2 weeks ago

I've added the Trouble shooting https://github.com/DroidKaigi/conference-app-2024/tree/main/app-ios#case3-you-are-using-x86_64-mac-and-want-to-build-the-project

mannodermaus commented 2 weeks ago

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 commented 2 weeks ago

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

Corvus400 commented 2 weeks ago

@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 commented 2 weeks ago

@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 commented 2 weeks ago

@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 commented 2 weeks ago

@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 commented 2 weeks ago

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

Corvus400 commented 2 weeks ago

@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.