Giter VIP home page Giter VIP logo

Comments (20)

paulb777 avatar paulb777 commented on July 28, 2024 1

Thanks for the clarification @JosephDuffy. This one might be more relevant https://stackoverflow.com/a/71486415/556617

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024 1

Thank you for your patience Paul, I'm glad we came to some sort of resolution.

Sorry that the root of this was a consequence of this was something I had done, unrelated to the project!

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

@JosephDuffy Thanks for the report.

Would you provide some additional context about the requirement? I believe we intentionally don't include bitcode for simulator slices since it has no use for apps and only would add size to the distribution. I'm not sure about the macOS slices.

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

@paulb777 By default iOS projects created with Xcode will include bitcode for all configurations, including debug. The description of the ENABLE_BITCODE setting says:

For Archive builds, bitcode will be generated in the linked binary for submission to the App Store. For other builds, the compiler and linker will check whether the code complies with the requirements for bitcode generation, but will not generate actual bitcode

So it seems to serve some utility, although in this case it's generating a warning that doesn't exist in archive (release) builds.

macOS is similar in that it supports bitcode, but I think it's optional and not included for builds outside the App Store.

For watchOS and tvOS it's required, so I'm not sure if tvos-arm64_x86_64-simulator binary not including bitcode will prevent testing on a simulator or just produce the warning.

I'm not sure how much larger the produced binaries would be if they included bitcode, but I would guess it's fairly minor and personally I think it's beneficial to include it.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Thanks. I'm still not getting the value of including bitcode with simulator slices. Is there another tool that has a problem than the script in the OP? If it's just that script, can it be changed to exclude simulator slices?

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

That script is just to check which binaries include bitcode, it's not something we use.

The issue that caused me to raise this is that if an iOS app relies on GoogleAppMeasurement then it will produce a warning during build:

ld: warning: all bitcode will be dropped because '/path/to/DerivedData/AppName/Build/Products/Debug-iphonesimulator/GoogleAppMeasurement.framework/GoogleAppMeasurement(APMAudienceFilterEvaluator.o)' was built without 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.

It produces a warning for every .o in the binary, then another for every target that depends on this (directly or indirectly), so we have over 300 warnings from this.

Since producing bitcode is the default and can help ensure the app will support bitcode when distributed I am hesitant to permanently disable it for debug builds.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Would you share a sample project that shows the warning. I'm not able to reproduce in the Analytics Quickstart.

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

It seems that this is related to setting ENABLE_BITCODE to YES project-wide. Despite this being the default, by setting it it is causing this warning. You can recreate this using the Analytics Quickstart by setting ENABLE_BITCODE to YES project-wide.

Maybe this is an Xcode bug, so I'm not totally sure what the best solution is.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Hmm, even after setting ENABLE_BITCODE, I don't see the problem. Would you share Xcode project?

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

Here's the analytics example, modified to show the warning:

analytics.zip

You'll need to run pod install because I had to run pod deintegrate to have the zip be small enough.

To get this I:

  • git clone [email protected]:firebase/quickstart-ios.git
  • cd quickstart-ios/analytics/
  • pod install
  • open AnalyticsExample.xcworkspace/
  • Set ENABLE_BITCODE on the project-level

Prior to running pod install, the patch is:

diff --git a/analytics/AnalyticsExample.xcodeproj/project.pbxproj b/analytics/AnalyticsExample.xcodeproj/project.pbxproj
index 49bb7e8d..8678cb39 100644
--- a/analytics/AnalyticsExample.xcodeproj/project.pbxproj
+++ b/analytics/AnalyticsExample.xcodeproj/project.pbxproj
@@ -580,6 +580,7 @@
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
                                COPY_PHASE_STRIP = NO;
                                DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_BITCODE = YES;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                ENABLE_TESTABILITY = YES;
                                GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -641,6 +642,7 @@
                                CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
                                COPY_PHASE_STRIP = NO;
                                DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_BITCODE = YES;
                                ENABLE_NS_ASSERTIONS = NO;
                                ENABLE_STRICT_OBJC_MSGSEND = YES;
                                GCC_C_LANGUAGE_STANDARD = gnu11;

Building for the simulator in Xcode 13.2.1 and 13.3.1 produced 314 bitcode-related warnings.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Still not able to reproduce in Xcode 13.3.1

Screen Shot 2022-05-10 at 2 24 53 PM

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

It looks like that's being set on the target level. Try settings it on the project (the option above that one) or choose "Levels". I think if it's not highlighted in green then it's using the inferred option rather than being explicitly set.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Screen Shot 2022-05-10 at 4 01 52 PM

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

After speaking with some other people I'm thinking this might only occur on Apple Silicon Macs. Are you using an Intel Mac?

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Interesting. I wasn't, but will check with one of my teammates who has one.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Perhaps related to https://stackoverflow.com/questions/72279468/enable-bitcode-with-xcode-13-3-13-4-when-project-uses-async-await-and-targets-i

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

Perhaps related to stackoverflow.com/questions/72279468/enable-bitcode-with-xcode-13-3-13-4-when-project-uses-async-await-and-targets-i

I don't think so. The app I'm building targets iOS 12 so doesn't have any use of structured concurrency and none of the dependencies do either. I'm also building it with Xcode 13.2.1 and this post is referring to Xcode 13.3. I've also tried using Xcode 13.3.1 and still get all the warnings.

from googleappmeasurement.

ryanwilson avatar ryanwilson commented on July 28, 2024

It looks like Bitcode was deprecated in Xcode 14, we'll need to see what the implications are for this.

from googleappmeasurement.

JosephDuffy avatar JosephDuffy commented on July 28, 2024

It does seem like this warning is a bug in Xcode, and not something that requires a change with this project.

Specifically this issue occurs when using the simulator and the ENABLE_BITCODE is explicitly set to YES. It's possible this only occurs on simulators running on Apple Silicon.

As mentioned above, Apple have deprecated bitcode with Xcode 14. I was even told on Twitter that bitcode has been unused outside of watchOS, despite being encouraged for iOS and required for tvOS.

We can close this issue if you'd like.

from googleappmeasurement.

paulb777 avatar paulb777 commented on July 28, 2024

Sounds good. We'll likely remove bitcode from our binary distributions in an upcoming release.

from googleappmeasurement.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.