Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 316 Vote(s) - 3.59 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Import Frameworks on Apple Silicon

#1
When I try to integrate a framework into an iOS app, then building will fail on an M1 MacBook (i.e., Apple Silicon), but does not fail on an Intel Mac. This occurs with the default build settings on the latest Xcode and also the latest Xcode Beta.
The error is as follows:

```
ld: building for iOS Simulator, but linking in object file built for iOS, file '/.../testm1/GooglePlaces.framework/GooglePlaces' for architecture arm64
clang: error: linker command failed with exit code 1 (use - v to see invocation)
```

I tried to check which architectures are included in the framework, then I am presented with the following info:

*Command:*
```
lipo -info GooglePlaces.framework/GooglePlaces
```

*Output:*
```
GooglePlaces.framework/GooglePlaces: Mach-O universal binary with 2 architectures: [x86_64cMach-O 64-bit object x86_64] [arm64]
GooglePlaces.framework/GooglePlaces (for architecture x86_64): Mach-O 64-bit object x86_64
GooglePlaces.framework/GooglePlaces (for architecture arm64): Mach-O 64-bit object arm64
```

and I also tried to check with 'file':

*Command:*

```
file GooglePlaces.framework/GooglePlaces
```

*Output:*
```
GooglePlaces.framework/GooglePlaces: Mach-O universal binary with 2 architectures: [x86_64cMach-O 64-bit object x86_64] [arm64]
GooglePlaces.framework/GooglePlaces (for architecture x86_64): Mach-O 64-bit object x86_64
GooglePlaces.framework/GooglePlaces (for architecture arm64): Mach-O 64-bit object arm64
```

Both commands show that it contains arm64.
<br><br><br>

**Configuration:**

MacBook Pro. 13'' M1 2020, <br>
16 GB <br>
Big Sur 11.4 <br>
Xcode 12.5.1 & Xcode 13.0 (Beta 3)
<br>
<br>

**Steps to reproduce:**

1. Create a new project (select SwiftUI)
2. Integrate the GooglePlaces framework (as described in "Manually" here -->

[To see links please register here]

)
3. Import "GooglePlaces" in a file
4. try to build the project on an M1 Mac (Config 1)
5. observe the following error:
```
ld: building for iOS Simulator, but linking in object file built for iOS, file '/.../testm1/GooglePlaces.framework/GooglePlaces' for architecture arm64
clang: error: linker command failed with exit code 1 (use - v to see invocation)
```

<br><br>
**Questions:**

* Is this resolvable if I do not have control over the sources of the framework, just the built framework?
* How can I check, given the .framework file, if the framework supports arm64 for iphonesimulator, or only supports arm64 for iphoneos?



<br>
<br>

**As suggested:**

I excluded the arm64 for any ios simulators - then building is successful.
BUT: When I want to test the project without a host application the following error occurs:
```
2021-07-21 12:07:54.021519+0200 xctest[84732:517962] The bundle “testm1Tests” couldn’t be loaded because it doesn’t contain a version for the current architecture. Try installing a universal version of the bundle.
2021-07-21 12:07:54.021692+0200 xctest[84732:517962] (dlopen_preflight(/.../Build/Products/Debug-iphonesimulator/testm1Tests.xctest/testm1Tests): no suitable image found. Did find:
/.../Library/Developer/Xcode/DerivedData/testm1-bkwdzlmojcaocfabaqfrhjnlzfim/Build/Products/Debug-iphonesimulator/testm1Tests.xctest/testm1Tests: mach-o, but wrong architecture)
Program ended with exit code: 80
```
<br><br>
**A workaround option:**
* As not all frameworks support xcframeworks, launch Xcode with `Rosetta`. Then you will have no issues with any of those erros. I know that's not the best workaround as Apple may remove `Rosetta` in future MacOS releases.
Reply

#2
In your project go to the

1. Xcode project Build Settings
2. Add arm64 to the Excluded Architectures for "iOS Simulator" builds only.
Reply

#3
Since you have specifically mentioned you are trying to build Google Places on M1 Mac, this is not possible was of now since GooglePlaces has not been updated to the new XCFrameworks,

Even you can check out the open issue here:

[To see links please register here]



Moreover for any frameworks to be run on M1 Mac simulator they should be shipped as XCFramework or you could as of now run on a physical device

Or apart from Google Places, for other frameworks you could use [Carthage][1] to consume them as xcframework by the use of below commnand:

```
carthage update --use-xcframeworks
```


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through