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

[ANNOUNCEMENT] Status of Xcode 10 support #407

Open
dpogue opened this Issue Sep 14, 2018 · 89 comments

Comments

Projects
None yet
@dpogue
Member

dpogue commented Sep 14, 2018

A few issues have started to come in regarding the state of Cordova projects on Xcode 10. This is a rough summary of the situation:

Xcode 10 uses a new build system by default (previously available on an opt-in basis in Xcode 9). The cordova-ios project structure is not compatible with this new build system and results in failures.
Officially, we do not claim to support Xcode 10.

Currently the best workaround is to opt-out of the new build system:

  • If you're building on the command-line, you can specify --buildFlag="-UseModernBuildSystem=0":

    # Cordova CLI
    cordova run ios --buildFlag='-UseModernBuildSystem=0'
    cordova build ios --buildFlag='-UseModernBuildSystem=0'
    
    # Ionic CLI
    ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"
    ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"
    
  • If you're building with a build.json config file, you can add the following under the iOS release or debug config:

    "buildFlag": [
      "-UseModernBuildSystem=0"
    ]
  • If you are opening the project in the Xcode IDE, you need to change the build system in Workspace Settings to "Legacy Build System"

    Xcode example Workspace Settings is under the File menu Change the Build System option to Legacy Build System

    Thanks kitolog for the screenshots!

We're going to investigate what's required to make cordova-ios compatible with the new build system, and hope to include that in the next major version (cordova-ios@5.0.0).

@sambegin

This comment has been minimized.

sambegin commented Sep 17, 2018

Just note here that the build.json file should look like this :

  "ios": {
    "release": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
  }

not

  "iOS": {
    "release": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
  }

like "mentioned" in the previous comment ;p

@robjs827

This comment has been minimized.

robjs827 commented Sep 18, 2018

Thanks, @dpogue
I was really wondering about the workaround. Hope to fix it soon!
Cheers

@neofuture

This comment has been minimized.

neofuture commented Sep 18, 2018

is this why im getting this issue

ERROR ITMS-90174: "Missing Provisioning Profile - Apps must contain a provisioning profile in a file named embedded.mobileprovision."

is there a workaround ?

@aceoliver

This comment has been minimized.

aceoliver commented Sep 18, 2018

@neofuture I am also encountering this after upgrading to XCode 10

@janpio

This comment has been minimized.

Contributor

janpio commented Sep 18, 2018

Then open an issue please that has all available information on these failures @neofuture and @aceoliver. Thanks.

@DRneilC

This comment has been minimized.

DRneilC commented Sep 19, 2018

@dpogue Thanks! The answer solved my problem.

@Birowsky

This comment was marked as outdated.

Birowsky commented Sep 19, 2018

Is this ALL you guys needed to do? Nobody kept getting these errors?

[09:22:43]: [Transporter Error Output]: ERROR ITMS-90087: "Unsupported Architectures. The executable for TheApp.app/Frameworks/Sentry.framework contains unsupported architectures '[x86_64, i386]'."

[09:22:43]: [Transporter Error Output]: ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'TheApp.app/Frameworks/Sentry.framework/Sentry' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."

[09:22:43]: [Transporter Error Output]: ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."

Edit: Sorry, I just realized these are Sentry's issues.

@tanuShah

This comment has been minimized.

tanuShah commented Sep 19, 2018

@sambegin Thanks for the workaround. Where is this build.json file is present in the app directory structure?

@jeffreyramia

This comment has been minimized.

jeffreyramia commented Sep 19, 2018

Btw this worked for me:
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

@tanuShah

This comment has been minimized.

tanuShah commented Sep 19, 2018

@jeffreyramia with the help of your answer I am able to build an app but whenever I am trying to emulate it gives me an error as "platforms/ios/build/emulator/demo APP.app/Info.plist file not found.
[ERROR] An error occurred while running subprocess cordova."

@PeterStegnar

This comment has been minimized.

PeterStegnar commented Sep 19, 2018

If you use pure cordova ios, you can run like:

cordova run --target='iPad-Air-2' --buildFlag='-UseModernBuildSystem=0'

@tanuShah

This comment has been minimized.

tanuShah commented Sep 19, 2018

@PeterStegnar I won't be run because info.plist not present in the /build directory.

@PeterStegnar

This comment has been minimized.

PeterStegnar commented Sep 19, 2018

@PeterStegnar I won't be run because info.plist not present in the /build directory.

Yes this happen if you are using new build system. If you say to compiler to build legacy build then it is OK. All you need to do it so use:

--buildFlag='-UseModernBuildSystem=0'

@newuser44

This comment has been minimized.

newuser44 commented Sep 19, 2018

Just do document what I'm seeing
Build with no command seems to just stop in the middle of it. It seems like its trying to build for some large of phonesxs default.

Build with the new command
ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0"

Seems to build just fine and was able to push a version to the phone.

For ionic I see a build.json file. I add the following to it.

{  
"ios": {
    "debug": {
      "developmentTeam": "898989",
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    },
    "release": {
      "developmentTeam": "89989898",
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
  }
}

It seems to look at the build.json, either I don't have it setup right or something because its not using the command.

Code Signing Error: Automatic signing is unable to resolve an issue with the "APP NAME" target's entitlements. Automatic signing can't add the aps-environment entitlement to your provisioning profile. Switch to manual signing and resolve the issue by downloading a matching provisioning profile from the developer website. Alternatively, to continue using automatic signing, remove this entitlement from your entitlements file and its associated functionality from your code.
Code Signing Error: Provisioning profile "iOS Team Provisioning Profile: com.app.dev.app" doesn't include the aps-environment entitlement.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 12.0'

I don't think that error surprise us. But not sure why adding the command to build.json file doesn't seem to work.

@dpogue

This comment has been minimized.

Member

dpogue commented Sep 19, 2018

I don't think that error surprise us. But not sure why adding the command to build.json file doesn't seem to work.

That error about code signing is unrelated to the new build system.
In your build.json you are not including the flags to use automatic provisioning, but you are also not specifying which provisioning profile to use. This probably wouldn't work in Xcode 9 either.

@newuser44

This comment has been minimized.

newuser44 commented Sep 19, 2018

Okay, so I don't have the build.json file really setup to be used. Other values would need to be in there. For now just have to use the command line.

@btate

This comment has been minimized.

btate commented Sep 19, 2018

Is there any plan to support the modern build system?

@dpogue

This comment has been minimized.

Member

dpogue commented Sep 19, 2018

Is there any plan to support the modern build system?

Yes, in the next major version, which we're currently working on. But we don't have a timeline for release beyond something before the end of the year.

@tanuShah

This comment has been minimized.

tanuShah commented Sep 24, 2018

@PeterStegnar Thanks I am able to build and emulate app on ios with the help of --buildFlag='-UseModernBuildSystem=0' this flag. Does anyone have documentation link for this flag?
I have to explore it more.

@andrewmcewen

This comment has been minimized.

andrewmcewen commented Sep 24, 2018

Is anyone having trouble using the --livereload flag with --buildFlag='-UseModernBuildSystem=0'? If so any ideas how to enable livereload

@janpio

This comment has been minimized.

Contributor

janpio commented Sep 24, 2018

--livereload is not part of Cordova. You will probably want to ask this question over at http://forum.ionicframework.com/ or one of their repositories, possibly Ionic CLI.

@BorntraegerMarc

This comment has been minimized.

BorntraegerMarc commented Sep 24, 2018

@andrewmcewen Yes: I get a lot of starting messages without the build actually starting.

@jasonwist

This comment has been minimized.

jasonwist commented Oct 31, 2018

I've noticed that when setting keychain entitlements in Xcode it only copies to the debug.plist and not the release.plist.

Is there a build flag or setting with Cordova CLI where I can force one .plist or create a APP_NAME.entitlements file?

@nagthgr8

This comment has been minimized.

nagthgr8 commented Nov 1, 2018

@nagthgr8 you should use:

ionic cordova build ios --prod --release -- --buildFlag="-UseModernBuildSystem=0"

@gabriellacerda yes I am using the same it fails with below compiler error
ionic cordova build ios --release --prod – --buildFlag="-UseModernBuildSystem=0"
Below compiler error I am getting while executing above command in MAC with xCode 10
74-80-250-211:ios user913708$ [ERROR] An error occurred while running subprocess ionic-app-scripts.
-bash: [ERROR]: command not found
74-80-250-211:ios user913708$
74-80-250-211:ios user913708$ ionic-app-scripts build --prod --target cordova --platform ios exited

with exit code 1.



Re-running this command with the --verbose flag may provide more 

information.[12:36:57]  ionic-app-scripts 3.2.0 

[12:36:57] build prod started …
[12:36:57] ionic-app-script task: “build”
[12:36:57] Error: tsconfig: Cannot read file ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’:

    ENOENT: no such file or directory, open 

    '/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json'. 

Error: tsconfig: Cannot read file ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’: ENOENT: no such file or directory, open ‘/Users/user913708/vedichoroo/vedichoroo/platforms/ios/tsconfig.json’.
at new BuildError (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
at getTsConfig (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:313:15)
at Object. (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:298:46)
at step (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:32:23)
at Object.next (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:13:53)
at /Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:7:71
at new Promise ()
at __awaiter (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:3:12)
at Object.getTsConfigAsync (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/transpile.js:295:12)
at Object.validateRequiredFilesExist (/Users/user913708/vedichoroo/vedichoroo/node_modules/@ionic/app-scripts/dist/build/util.js:89:21)
74-80-250-211:ios user913708$ with exit code 1

Ok, it seems the compiler is not finding your tsconfig.json config file, try removing the platform and adding it again:

ionic cordova platform remove ios; ionic cordova platform add ios

Then try building again...

@gabriellacerda I followed your instructions while add command is executed I get below response

ionic cordova platform add ios
ENDENT: no such file or directory, uv_cwd

I removed the platform without ionic prefix is that the consequene, how can I fix this now

@dpogue

This comment has been minimized.

Member

dpogue commented Nov 1, 2018

@nagthgr8 @gabriellacerda Please direct Ionic-related issues to the Ionic discussion forums.

The issues and steps that affect Ionic are similar, but not the same as the ones affecting Cordova, and it's confusing to have Ionic-specific workarounds mentioned in a help issue for Cordova.

@nagthgr8

This comment has been minimized.

nagthgr8 commented Nov 1, 2018

Ionic discussion forum seems not so active in responding I already posted there I am clueless right now if this is something I am struggling alone or is a known ionic issue.

@nagthgr8

This comment has been minimized.

nagthgr8 commented Nov 1, 2018

got response from Ionic team as below, please somebody from cordova team help, I had to stop production release due to this issue, app is loading very slow(takes about 2 mins), hoping if I could compile with --prod flag this should resolve to some extent.

Unfortunately this issue goes beyond the scope of our own support due to the issue ultimately lying with Cordova 4.X and not Ionic. Hope that provides you with some direction!

@sumantasam1990

This comment has been minimized.

sumantasam1990 commented Nov 1, 2018

Is anyone having trouble using the --livereload flag with --buildFlag='-UseModernBuildSystem=0'? If so any ideas how to enable livereload

You should use ionic cordova run ios --l -- --buildFlag="-UseModernBuildSystem=0"

@kevin-openc

This comment has been minimized.

kevin-openc commented Nov 7, 2018

After changing to Legacy Build System i still get this error after running:
ionic cordova run ios
error: module importing failed: ('invalid syntax', ('temp.py', 1, 27, 'import fruitstrap_00008020-000914CA3E78002E\n'))
backtrace unavailable

Hi, @rujinxero . I've got the same error on iPhone XS. I think it's bug with Cordova build system, and they should update platform somehow... Or, do you get any solution for that ?

I have exactly same issue to build on my iPhone XS. does someone have any idea?

@theMartux

This comment has been minimized.

theMartux commented Nov 9, 2018

Hello, yesterday I uploaded my build to the App Store via Xcode.
I used the Legacy Build System and the automatic signature. Everything worked correctly.
My app has been accepted.

@ceeespinosa19

This comment has been minimized.

ceeespinosa19 commented Nov 14, 2018

@theMartux Hi! to upload your app, did you use this command? ionic cordova run ios --l -- --buildFlag="-UseModernBuildSystem=0" or can you tell me de steps did you follow? because i can't still upload a single app

@theMartux

This comment has been minimized.

theMartux commented Nov 14, 2018

@ceeespinosa19 ciao.
No. I did not use Ionic. The --buildFlag = "-UseModernBuildSystem = 0" command that you use in Cordova is not required if you use the Xcode build settings. If you setting Legacy Build System in Xcode you can use the default command run in Cordova. In any case, I uploaded my app simply using the Xcode settings on the old build and the automatic signature. Xcode did the rest.

@barnesdc

This comment has been minimized.

barnesdc commented Nov 15, 2018

@theMartux
I am fairly new to building Apps (like just started this past two months). Could you further explain the steps you took to build your app in Xcode using the Legacy Build System?

@theMartux

This comment has been minimized.

theMartux commented Nov 15, 2018

@theMartux
I am fairly new to building Apps (like just started this past two months). Could you further explain the steps you took to build your app in Xcode using the Legacy Build System?

Ciao
It’s very simple! You should create app with the Cordova CLI command.
Next step you adding the platform iOS and follow the dpogue's steps in her first post.

benjamn added a commit to meteor/meteor that referenced this issue Nov 15, 2018

@benjamn benjamn referenced this issue Nov 15, 2018

Open

[WIP] Cordova improvements for Meteor 1.8.1 #10339

1 of 3 tasks complete
@barnesdc

This comment has been minimized.

barnesdc commented Nov 15, 2018

I ended up getting my app running on my iPhone X.
Steps that I took:

  • opened the ionic-ios build folder on Xcode
  • attempted build, failed.
  • resolved any cautions, literally just had to click and let Xcode do its thing.
  • Xcode -> preferences -> accounts: then log in to your developer account and "manage certificates" and add your signing cert.
  • then select views -> navigators -> show project navigator
    -- should be on a screen that shows info & build settings. on that same like, the first thing should be the name of your app, click that and then select your app in the "targets" area. this will bring up the "general" tab
  • inside the general tab, change the "bundle identifier" to the name of your developer profile and make sure your team is selected as the signing profile.
  • lastly, file -> workspace setting -> change the build setting to legacy.

After these steps the build of my app failed. On my iPhone I had to navigate to Settings -> general - device management -> and trust the signing certificate (I think that is what is was)
Rebuilt the app and everything ran successfully.

Hopefully you all can follow my steps.

@SanjanaTailor

This comment has been minimized.

SanjanaTailor commented Nov 16, 2018

Thank you for me using CLI command where I used below command which worked for me well

xcodebuild clean -project /Users/xxx.xcodeproj -configuration Release -alltargets -UseModernBuildSystem = NO

@IonicOnCouch

This comment has been minimized.

IonicOnCouch commented Nov 16, 2018

@nagthgr8 Did you find a solution for the problem? I have the same Error...

@prasanna-tapzo

This comment has been minimized.

prasanna-tapzo commented Nov 28, 2018

When i try to upload build to App Store I am getting following error:

Invalid Bundle. The asset catalog at Assets.car' can't be processed. Rebuild your app, and all included extensions and frameworks, with the latest GM version of Xcode and resubmit." I am using Xcode 10.1.

@steptek

This comment has been minimized.

steptek commented Nov 28, 2018

I do have same pb, <..latest GM version of Xcode and resubmit."> . and then I am forced to use the new build system, but unfortunately the notifications didn't work.
It's a known pb, and it's probably linked to how the new build system bundles the provision file inside the app....
if any one succeed making notifs works with the new build, please share...

@dpogue

This comment has been minimized.

Member

dpogue commented Nov 29, 2018

@steptek Even if you're using the newest version of Xcode, you're not forced to use the new build system. There are instructions in the first post about how to enable the old build system within Xcode.

@steptek

This comment has been minimized.

steptek commented Nov 29, 2018

@dpogue agreed, but you wont be able to push it on apple store for review, same like they are only accepting the new build for v12.1, and I absolutely understand that they are giving backward compatibility either by command line or Xcode menu, but the end is the same, Just we will be enjoying the apps only on device and play with it or say good-bay for notification for Cordova on v12.1.
In fact the embedded.mobileprovision is missing on each build done by new build option, and that's no good for notifications, neither for moving forward and stepping to apple store review (with the legacy option)..
that's not gooooooood.....

@viking2917

This comment has been minimized.

viking2917 commented Dec 6, 2018

@steptek @prasanna-tapzo I built using the old build system and had no problem getting my app approved last night. I suspect something else is causing an issue? I doubt that simply using the legacy build system will stop an app from getting approved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment