Giter Club home page Giter Club logo

Comments (24)

sek avatar sek commented on May 31, 2024 9

@erisu looks like your PR was merged 👍

I've confirmed this fixes the problem for me as well. It's merged to master, but not 4.5.x branch. Do we know what the release schedule is for the next ios platform version?
If 4.5.6 - I think this should be merged to that branch also.
If 4.6 with a new branch from master, then it will be included without additional merging.

In the meantime:

  • I've downloaded the raw file as ios-updated-build.js in root of my project
  • verified it's the only diff from the current default 4.5.5 ios version
  • added a resource-file line to my config.xml under ios platform and that's got my local project building again
<platform name="ios">
     <resource-file src="ios-updated-build.js" target="../../cordova/lib/build.js" />
     ...

from cordova-ios.

shazron avatar shazron commented on May 31, 2024 2

Confirmed it with plugin cordova-plugin-firebase-messaging:

/Users/shaz/Desktop/foo/platforms/ios/Pods/FirebaseCore/Firebase/Core/FIRLogger.m:18:9: fatal error:
      'GoogleUtilities/GULAppEnvironmentUtil.h' file not found
#import <GoogleUtilities/GULAppEnvironmentUtil.h>

Doesn't build with cordova build but builds properly with the workspace.

from cordova-ios.

erisu avatar erisu commented on May 31, 2024 2

@jpgilchrist I just submitted a PR but will finalize tomorrow.

What I mean by removing, as I said previously, I only commented out the xcconfig option that is declared in the build.js

You can see the changes here: #398

from cordova-ios.

erisu avatar erisu commented on May 31, 2024 2

#398 has been released in [email protected].

from cordova-ios.

jpgilchrist avatar jpgilchrist commented on May 31, 2024 1

@shazron sorry I was on vacation. So what is the recommended course of action? Is it safe to build w/o the xcconfig defined in Cordova? Or will there be issues with that? I really can't afford to build/export this thing manually from xcode each time.

from cordova-ios.

leonidovadaria avatar leonidovadaria commented on May 31, 2024 1

Hello
I am using cordova-plugin-firebase-dynamiclinks. During the build process, I ran into the problem described in this issue. After fix build.js build was success.
But If I run application via dynamic link I get error. Please see image below

2018-11-14 21 25 08

Perhaps error is related to this issue

from cordova-ios.

jpgilchrist avatar jpgilchrist commented on May 31, 2024

Also weird side note, I had to add a run_pods.sh script to get things to work as well...

        <hook src="run_pods.sh" type="after_platform_add" />
#!/usr/bin/env bash
pod install --project-directory='./platforms/ios'
touch run_pods_exec

from cordova-ios.

shazron avatar shazron commented on May 31, 2024

hi @jpgilchrist, thanks for the report. Is there a plugin that we can use to repro the issue and investigate? So that we will be on the same page. Thanks!

from cordova-ios.

shazron avatar shazron commented on May 31, 2024

In the command line build:

    FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/FirebaseAnalytics/Frameworks" "${PODS_ROOT}/FirebaseInstanceID/Frameworks" "${PODS_ROOT}/GoogleAppMeasurement/Frameworks"

I manually checked the paths referenced, and I couldn't find GoogleUtilities.framework in there, so that is partially the root of the problem.

from cordova-ios.

shazron avatar shazron commented on May 31, 2024
HEADER_SEARCH_PATHS = $(inherited) ${PODS_ROOT}/Firebase/CoreOnly/Sources "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/GoogleUtilities" "${PODS_ROOT}/Headers/Public/Protobuf" "${PODS_ROOT}/Headers/Public/nanopb"

Note that the search paths are all for Public headers, when <GoogleUtilities/GULAppEnvironmentUtil.h> is a Private header.

from cordova-ios.

shazron avatar shazron commented on May 31, 2024

The right Headers folder is sent, even the Private one, when the file is compiled. However, the path is wrong(!), it duplicates Pods. i.e. -I/Users/shaz/Desktop/foo/platforms/ios/Pods/Pods/Headers/Private

from cordova-ios.

shazron avatar shazron commented on May 31, 2024

The duplicate Pods is the only difference I can see, when viewing the log for compiling the same file (where the error occurs) on the command line vs Xcode.

Found another bug: when I switched command line tools to Xcode 10 beta 4, it seemed to build (no errors) but I don't think it actually built anything (no build artifacts) and may have failed silently because of a config issue.

from cordova-ios.

shazron avatar shazron commented on May 31, 2024

Found this duplicate issue: https://issues.apache.org/jira/browse/CB-14057

from cordova-ios.

jonathanrevell avatar jonathanrevell commented on May 31, 2024

I'm also seeing these same issues with Cordova 8.0.0, XCode 9.4.1, Pod version 1.5.3. Works fine from inside the XCode UI. Fails no matter what I do when trying to run it via cordova build, etc.

Been stuck on this issue for several days now. Is there any known workaround?

Also has to do with GoogleUtilities/GULAppEnvironmentUtil.h not being found.

from cordova-ios.

jonathanrevell avatar jonathanrevell commented on May 31, 2024

I was able to find a workaround which involves bypassing cordova for now:
Reconstruct the command being passed to xcodebuild from cordova, you can see the list of arguments passed in at the bottom of the stack trace, but remove the -xcconfig argument altogether. (Based on this comment)

Your command should look something like this:
EDIT: See next comment for full details

Replace YourProjectName with your project name, and note that the ... paths should be your actual paths

from cordova-ios.

jonathanrevell avatar jonathanrevell commented on May 31, 2024

I did quite a bit more exploring and was able to successfully get an IPA exported with the following process:

Step 1: Build the app and archive using the following command
xcodebuild clean build -workspace YourApp.xcworkspace -scheme YourApp -configuration Debug -destination generic/platform=iOS -archivePath .../YourApp.xcarchive archive CONFIGURATION_BUILD_DIR=.../cordova/platforms/ios/build/device SHARED_PRECOMPS_DIR=.../cordova/platforms/ios/build/sharedpch EMBEDDED_CONTENT_CONTAINS_SWIFT=YES ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO LD_RUNPATH_SEARCH_PATHS="@executable_path/Frameworks"

Step 2: Create a ExportOptions.plist file with the following information:
<?xml version="1.0" encoding="UTF-8"?>
<!--
https://www.matrixprojects.net/p/xcodebuild-export-options-plist/
-->
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>teamID</key>
<string>YOUR_TEAM_ID</string>
<key>provisioningProfiles</key>
<dict>
<key>YOUR.BUNDLE.ID</key>
<string>PROVISIONING_PROFILE_UUID OR XCODE NAME</string>
</dict>
<key>method</key>
<string>ad-hoc OR app-store OR enterprise OR development</string>
<key>uploadSymbols</key>
<true/>
</dict>
</plist>

Step 3: Export the archive to build the IPA
xcodebuild -exportArchive -archivePath .../SmartPiggy.xcarchive -exportPath $(EXPORT_PATH) -exportOptionsPlist .../ExportOptions.plist

from cordova-ios.

janpio avatar janpio commented on May 31, 2024

(Use ``` to format XML)

from cordova-ios.

dpogue avatar dpogue commented on May 31, 2024

I believe @erisu had run into a similar build issue where removing -xcconfig fixed the problem, but I thought he was testing against Xcode beta and I don't know if his attempt involved CocoaPods. He was trying to make a minimal reproducible test case to investigate further, so CC'ing him in case this issue provides some additional details.

from cordova-ios.

jpgilchrist avatar jpgilchrist commented on May 31, 2024

@jonathanrevell yes I have deduced the same thing and @dpogue is correct it's something to do with the -xcconfig but no one really knows what. The trouble I'm finding is that no one seems to know if it's a crodova issue or an xcodebuild issue, but it seems people are learning towards an xcodebuild issue.

I too am still waiting on a decent solution. I really don't want to change all of my automated build scripts because of this issue.

from cordova-ios.

jonathanrevell avatar jonathanrevell commented on May 31, 2024

Lucky me I'm in the process of writing my build scripts for the first time and was tearing my hair out wondering what I did wrong with them only to find out there's some sort of cordova-xcodebuild bug right now. So I'm just going to be using xcodebuild straight up for the time being until the root cause is diagnosed and fixed.

I'm happy to at least have found a workaround so I can automate things in the meantime because I do not want to manually build these things all the time. 🤷🏼‍♂️

from cordova-ios.

erisu avatar erisu commented on May 31, 2024

@dpogue The beta issue was something different.

In one of my environments that builds for iOS with CocoaPods, I had also seen the CocoaPods issue. In that environment, I had also completely removed the the xcconfig flag. Apps continued to build successfully for iOS with CocoaPods after this change.

Since the xcconfig is applied for entire project's workspace, during code signing step, it tries to signing the libraries that were imported by CocoaPods. This caused the build to error.

from cordova-ios.

jpgilchrist avatar jpgilchrist commented on May 31, 2024

@erisu WRT your comment "I had also completely removed the xcconfig flag"... how did you do this? I, too, would like to get my scripts back in working order. I would guess you just bypassed cordova build ios and ran xcodebuild directly?

from cordova-ios.

jpgilchrist avatar jpgilchrist commented on May 31, 2024

@erisu looks like your PR was merged 👍

from cordova-ios.

mohamedsharaf avatar mohamedsharaf commented on May 31, 2024

@erisu looks like your PR was merged 👍

I've confirmed this fixes the problem for me as well. It's merged to master, but not 4.5.x branch. Do we know what the release schedule is for the next ios platform version?
If 4.5.6 - I think this should be merged to that branch also.
If 4.6 with a new branch from master, then it will be included without additional merging.

In the meantime:

  • I've downloaded the raw file as ios-updated-build.js in root of my project
  • verified it's the only diff from the current default 4.5.5 ios version
  • added a resource-file line to my config.xml under ios platform and that's got my local project building again
<platform name="ios">
     <resource-file src="ios-updated-build.js" target="../../cordova/lib/build.js" />
     ...

this may help other this is the file to download
/bin/templates/scripts/cordova/lib/build.js

https://raw.githubusercontent.com/erisu/cordova-ios/4dd0586ebdf1650ae9079c98cae4d68b96bc08fe/bin/templates/scripts/cordova/lib/build.js

from cordova-ios.

Related Issues (20)

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.