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

Could not generate bitcode #368

Closed
matthiasnagel opened this issue Mar 1, 2019 · 13 comments
Closed

Could not generate bitcode #368

matthiasnagel opened this issue Mar 1, 2019 · 13 comments

Comments

@matthiasnagel
Copy link

If we use pod 'Adjust' at the same time with pod 'Leanplum-iOS-SDK' we get the following:

ld: bitcode bundle could not be generated because .../Build/Products/Debug-iphoneos/Adjust/Adjust.framework/Adjust' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '.../Build/Products/Debug-iphoneos/Adjust/Adjust.framework/Adjust' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

On simulator it's completely fine but for our arm64 device bitcode could not be generated.

@uerceg
Copy link
Contributor

uerceg commented Mar 1, 2019

Hi @matthiasnagel

Which Xcode / Cocoapods version are you using? Which device are you testing with?

@uerceg uerceg added the support label Mar 1, 2019
@matthiasnagel
Copy link
Author

@uerceg I'm using Xcode 10.1 (10B61) and an iPhone XS Max. The pod versions are:
Adjust (4.17.1)
Leanplum-iOS-SDK (2.3.1)

Let me know if you need more information.

@uerceg
Copy link
Contributor

uerceg commented Mar 1, 2019

Thanks for the info.

🤔 iPhone XS Max should have arm64e architecture (all latest iPhones these days with A12 chipset should have it). Is there any chance just to give older device a try (iPhone X for example) just to see if error happens when non arm64e device is attached as well?

@matthiasnagel
Copy link
Author

@uerceg we get the same error

@manuellohner2018
Copy link

manuellohner2018 commented Mar 5, 2019

@uerceg, we also have the same Error. Tested on older Devices as well. Any Update so far?

@nzagorchev
Copy link

nzagorchev commented Mar 8, 2019

Is Adjust using bitcode generation?

Until this is resolved from either side, there is a workaround for it:

  1. Install the pods
  2. Go to Your project Target -> Pods. Edit the following files:
    Pods-.debug.xcconfig
    Pods-.release.xcconfig

Change the first line regarding the BITCODE_GENERATION_MODE from:
BITCODE_GENERATION_MODE = bitcode
to:
BITCODE_GENERATION_MODE = marker

  1. Do this for both files and now run the project.
  2. You will need to do this again if you do pod update or pod install since it will remove the changes to those files.

@matthiasnagel
Copy link
Author

@nzagorchev thanks for the workaround. This works and we can use Adjust and Leanplum together.
Nevertheless are you planning to fix the original problem?

@uerceg
Copy link
Contributor

uerceg commented Mar 11, 2019

Hey guys, thanks for the useful discussion on this issue and sorry about the delay, these days our iOS crew is OOO. We will check this out next week and hopefully provide an update which addresses this issue. Will keep you posted and ping in case we need any additional info from you.

@uerceg
Copy link
Contributor

uerceg commented Mar 18, 2019

@nzagorchev @matthiasnagel

I tried to reproduce the issue, but no luck. Do you guys maybe have an idea what should be changed in Adjust SDK so that this actually solves your issue? I was trying to check bitcode settings in our SDK and seems like we have it enabled in project settings:

  • BITCODE_GENERATION_MODE = bitcode;
  • OTHER_CFLAGS = "-fembed-bitcode";
  • ENABLE_BITCODE = YES;

Is there anything else you see that we did not properly enable?

@matthiasnagel
Copy link
Author

matthiasnagel commented Mar 19, 2019

@uerceg pretty simple one.

  1. Create a new Xcode project, call it test. Let it empty.
  2. Create a Podfile with the following content:
platform :ios, '11.0'
use_frameworks!

target 'test' do
    pod 'Leanplum-iOS-SDK'
    pod 'Adjust'
end
  1. Run pod install
  2. Open test.xcworkspace
  3. Build and run on an iPhone. Due to the fact thats an architectural problem it doesn't happen on simulator.

Please let me know if you need more information here.

@uerceg
Copy link
Contributor

uerceg commented Mar 19, 2019

Great, thanks for this one, will give it a try today and keep you posted.

@uerceg
Copy link
Contributor

uerceg commented Mar 19, 2019

Hm, still not sure why is this happening with our pod. Here's the update from my side after checking out this issue:

  • I managed to reproduce the issue with your advices - thanks for that!
  • Reason for this error is the fact that once Adjust pod is added, BITCODE_GENERATION_MODE=bitcode doesn't seem to be available in Adjust target Build Settings in Pods solution. You can check this if you select Pods solution and then check Adjust and Leanplum-iOS-SDK target. Search for BITCODE_GENERATION_MODE setting and you'll see that Leanplum-iOS-SDK has it, but Adjust somehow doesn't.
  • If you add this option on your own to our framework target, error is gone, but this is definitely not the way to do it, I agree.
  • Until now, I did not find the reason why is out framework target not having this user defined build setting enabled in its target once added as pod. We have those settings set for our entire Adjust project and each of the targets.
  • What I did as a potential fix and which works when adding our SDK via Cocoapods in this scenario of yours is to add s.pod_target_xcconfig = { 'BITCODE_GENERATION_MODE' => 'bitcode' } into Adjust.podspec file. After this, everything works just fine. But seems a bit hacky and Leanplum.podspec doesn't seem to have it.

I will continue to investigate what's causing BITCODE_GENERATION_MODE which is defined in our project not to be present in our target within Pods solution. In case you maybe know what might solve this, any advice is more than welcome.

@uerceg
Copy link
Contributor

uerceg commented Mar 21, 2019

Okay, should be solved with latest release. In case this issue still persists with it as well, please feel free to reopen it.

@uerceg uerceg closed this as completed Mar 21, 2019
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

4 participants