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

Unity iOS xcode 'Amplitude\Amplitude.h' file not found #118

Closed
Brian-McElroy opened this issue Nov 1, 2022 · 6 comments
Closed

Unity iOS xcode 'Amplitude\Amplitude.h' file not found #118

Brian-McElroy opened this issue Nov 1, 2022 · 6 comments

Comments

@Brian-McElroy
Copy link

Brian-McElroy commented Nov 1, 2022

I added Amplitude to an existing Unity project, on Android it was fine, but on iOS when I try to build I get this error ... "'Amplitude\Amplitude.h' file not found"

Project uses Unity 2021.3.9f1 and Ar foundation

I get the same issue with a brand new Unity 2021.3.9f1 project, with nothing in it but the Amplitude SDK. I used the 2.6.0 amplitude-unity.unitypackage file from here https://github.com/amplitude/unity-plugin/releases

image

@qingzhuozhen
Copy link
Contributor

Hi @Brian-McElroy, thanks for choosing Amplitude. Would you mind sharing how you install the SDK? In recent versions, we updated to use the DependencyManager to resolve the iOS dependency. There are tags including the DependencyManager or not.

@Brian-McElroy
Copy link
Author

@qingzhuozhen yeah I updated my original comment saying how I installed the smaller unitypackage on a blank project.. I am now trying the bigger unitypackage with the dependency manager thing, and clicking on install cocoapods option before building.. I am having more errors though.

"
'/Users/bm/Library/Developer/Xcode/DerivedData/Unity-iPhone-ashdibvxumgdwsahvbmbnujwnvks/Build/Products/ReleaseForRunning-iphoneos/Amplitude/Amplitude.framework/Amplitude(AMPDeviceInfo.o)' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/bm/Library/Developer/Xcode/DerivedData/Unity-iPhone-ashdibvxumgdwsahvbmbnujwnvks/Build/Products/ReleaseForRunning-iphoneos/Amplitude/Amplitude.framework/Amplitude' for architecture arm64
"

image

@JonLandmark
Copy link

I am also getting the same bitcode error seen above. Sounds like it requires amplitude to rebuild with ENABLE_BITCODE. Annoyingly without this, I'm having to disable bitcode for my whole project. Can this be looked into?

There is an old issue on the ios SDK which sounds like it shares some similarities - amplitude/Amplitude-iOS#384

@DiegoDePalacio
Copy link

DiegoDePalacio commented Jun 13, 2023

I created an empty Unity 2021.3.17f1 project, added Amplitude SDK, and create an Xcode project by building for iOS in the Unity Editor.

Trying to Archive, using Xcode 14.3, gives me that exact error.

Is there any workaround to create an iOS build with the latest Unity's Amplitude SDK?

@DiegoDePalacio
Copy link

I found the solution.

In Unity is necessary to choose from the menu:
Assets > External Dependency Manager > iOS Resolver > Settings

On the settings is necessary to change the "Cocoapods Integration" from
Xcode Workspace - Add Cocoapods to the Xcode workspace, to be instead
Xcode Project - Add Cocoapods to the Xcode project

In Xcode is necessary to choose the "Project", then "Build Settings" and in the "Build Options" is necessary to set "Enable Bitcode" to "No"

Then "Archive" can be completed successfully, at least in my case 😅

@xk0fe
Copy link

xk0fe commented Nov 13, 2024

I've managed to solve this issue without turning off bitcode in Xcode project

In Unity:

  1. Assets -> External Dependency Manager -> iOS Resolver -> Settings
  2. Set "Cocoapods Integration" to - Xcode Project
  3. Uncheck "Use Shell to Execute Cocoapod Tool"

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

6 participants