googlesamples / googlesamples/unity-jar-resolver
[Bug] Build for iOS Simulator doesn't compile in Debug mode
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 371
- Avg merge
- 14h 21m
- Merged PRs (30d)
- 3
Description
### [REQUIRED] Please fill in the following fields:
* Unity editor version: 2020.3.17f1
* External Dependency Manager version: 1.2.170
* Source you installed EDM4U: Unity Package Manager (manually unpacked to Packages/ folder; embedded package)
* Features in External Dependency Manager in use: iOS Resolver
* Plugins SDK in use: None
* Platform you are using the Unity editor on: Mac (MacBook Pro, Apple M1 Pro)
### [REQUIRED] Please describe the issue here:
Build for iOS Simulator doesn't compile in Debug mode.
XCode throws the following error:
```
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/AppAuth'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GTMAppAuth'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GTMSessionFetcher'
ld: warning: directory not found for option '-F/Users/marekzd/Library/Developer/Xcode/DerivedData/Unity-iPhone-dvncmapbtllnstgjcbjcurdvibwh/Build/Products/Debug-iphonesimulator/GoogleSignIn'
ld: framework not found AppAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```
Here are steps to reproduce this:
1. Create a new Unity Project
2. Install EDM4U
3. Add `Editor/Dependencies.xml` file
```
```
4. Open `Project Settings / Player` and set `iOS Target` to `Simulator SDK`
5. Open `Build Settings...` and switch to `iOS` platform
6. Set `Run in XCode as` to `Debug`
7. Click on `Build and Run`
8. Unity export succeeds, but XCode compilation fails with error: `framework not found AppAuth`
9. It works fine after switching to `Release` mode
#### Please answer the following, if applicable:
What's the issue repro rate? (eg 100%, 1/5 etc)
100%
What happened? How can we make the problem occur?
Unity enforces `x86_64` architecture for `Unity-iPhone` and `UnityFramework` targets (`ARCHS=x86_64`).
It seems that XCode is not able to build pods in `x86_64` architecture in Debug mode.
Although it can do that in Release mode.
I'm not sure why that happens.
It might be related to `Build Active Architecture Only` being set for Debug builds.
It also might be related to Apple M1.
Here you can find a sample project:
[EDM4UiOSSimulatorDebugBug.zip](https://github.com/googlesamples/unity-jar-resolver/files/8531489/EDM4UiOSSimulatorDebugBug.zip)
Contributor guide
Assessment
This issue has not been assessed yet.