Trying to run it on iOS #74

Open
opened 2021-05-10 19:19:17 +00:00 by ineiti · 2 comments

Hi there,

I'm trying to get the app running on iOS. So far I used https://rogchap.com/2020/09/14/running-go-code-on-ios-and-android/ to compile libcwtch-go for iOS and then tried to convince Xcode that it puts it all together. You'll have to run it on a Mac - I used the following versions:

  • go 1.16.3
  • Android Studio 4.1.1
  • XCode Version 12.5 (12E262)
git clone gogs@git.openprivacy.ca:ineiti/flutter_app
cd flutter_app
make ios

And then open the project with Android Studio and do the following:

  • choose an iPhone in the device list
  • click the Run button

It starts to compile, and after 2-3 minutes, I get the following error in the app:

======== Exception caught by widgets library =======================================================
The following ArgumentError was thrown attaching to the render tree:
Invalid argument(s): Failed to load dynamic library (dlopen(cwtch.a, 1): no suitable image found.  Did find:
	/Users/.../Library/Developer/CoreSimulator/Devices/3D7064C5-8392-4BF8-9C49-FE6898022AE6/data/Containers/Bundle/Application/CC43A084-5DF6-4931-95AC-854D28134174/Runner.app/Frameworks/cwtch.a: no matching architecture in universal wrapper

What is strange is, that lipo reports x86_64 and armv7 as architectures:

lipo -info /Users/.../cwtch.a 
Architectures in the fat file: /Users/.../cwtch.a are: x86_64 arm64 

I tried all kinds of arguments, asked Google, tried running it on an ipad simulation, but it refuses to run.

Any idea would be very welcome :)

Hi there, I'm trying to get the app running on iOS. So far I used https://rogchap.com/2020/09/14/running-go-code-on-ios-and-android/ to compile libcwtch-go for iOS and then tried to convince Xcode that it puts it all together. You'll have to run it on a Mac - I used the following versions: - go 1.16.3 - Android Studio 4.1.1 - XCode Version 12.5 (12E262) ``` git clone gogs@git.openprivacy.ca:ineiti/flutter_app cd flutter_app make ios ``` And then open the project with Android Studio and do the following: - choose an iPhone in the device list - click the `Run` button It starts to compile, and after 2-3 minutes, I get the following error in the app: ``` ======== Exception caught by widgets library ======================================================= The following ArgumentError was thrown attaching to the render tree: Invalid argument(s): Failed to load dynamic library (dlopen(cwtch.a, 1): no suitable image found. Did find: /Users/.../Library/Developer/CoreSimulator/Devices/3D7064C5-8392-4BF8-9C49-FE6898022AE6/data/Containers/Bundle/Application/CC43A084-5DF6-4931-95AC-854D28134174/Runner.app/Frameworks/cwtch.a: no matching architecture in universal wrapper ``` What is strange is, that `lipo` reports `x86_64` and `armv7` as architectures: ``` lipo -info /Users/.../cwtch.a Architectures in the fat file: /Users/.../cwtch.a are: x86_64 arm64 ``` I tried all kinds of arguments, asked Google, tried running it on an ipad simulation, but it refuses to run. Any idea would be very welcome :)
Owner

Hi @ineiti thanks for diving into this!

I think the best next step is probably to open a PR in https://git.openprivacy.ca/flutter/libcwtch-go to include the iOS build steps in the makefile - that will give us a common reference to the build steps and we can start working out where the archiecture issue is being introduced. It will also give us a path towards eventual automation.

(Doing a quick check I did fine this discussion in dart: https://github.com/dart-lang/sdk/issues/39231 which has some additional considerations regarding the M1 and also code signing which may or may not be applicable)

Hi @ineiti thanks for diving into this! I think the best next step is probably to open a PR in https://git.openprivacy.ca/flutter/libcwtch-go to include the iOS build steps in the makefile - that will give us a common reference to the build steps and we can start working out where the archiecture issue is being introduced. It will also give us a path towards eventual automation. (Doing a quick check I did fine this discussion in dart: https://github.com/dart-lang/sdk/issues/39231 which has some additional considerations regarding the M1 and also code signing which may or may not be applicable)
Author

OK, added the PR for flutter/libcwtch-go#39 and one for flutter/flutter_app#78

Both are draft-PRs, the libcwtch-go specifically because it doesn't work yet in flutter_app!

For the link about dart-lang, I think you're one step ahead of me, and this will only bite me later. I'm not concerned yet with app-signing, even though this is known to be tricky with iOS. I have bad memories about this ;) Or perhaps it is app-signing?

I'll try the simple example from scratch, and then try to take it from there.

OK, added the PR for flutter/libcwtch-go#39 and one for flutter/flutter_app#78 Both are draft-PRs, the libcwtch-go specifically because it doesn't work yet in flutter_app! For the link about `dart-lang`, I think you're one step ahead of me, and this will only bite me later. I'm not concerned yet with app-signing, even though this is known to be tricky with iOS. I have bad memories about this ;) Or perhaps it is app-signing? I'll try the simple example from scratch, and then try to take it from there.
ineiti started working 2021-05-11 18:26:38 +00:00
ineiti stopped working 2021-05-11 18:26:46 +00:00
8s
sarah added the
enhancement
label 2021-06-02 07:44:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Total Time Spent: 8 seconds
ineiti
8 seconds
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: flutter/flutter_app#74
No description provided.