apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

[ANNOUNCEMENT] Status of Xcode 10 support #407

Closed dpogue closed 5 years ago

dpogue commented 5 years ago

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:

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 commented 5 years ago

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

SuperStar518 commented 5 years ago

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

neofuture commented 5 years ago

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 commented 5 years ago

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

janpio commented 5 years ago

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

DRneilC commented 5 years ago

@dpogue Thanks! The answer solved my problem.

Birowsky commented 5 years ago

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.

tanvishah-syn commented 5 years ago

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

jeffreyramia commented 5 years ago

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

tanvishah-syn commented 5 years ago

@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 commented 5 years ago

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

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

tanvishah-syn commented 5 years ago

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

PeterStegnar commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

Is there any plan to support the modern build system?

dpogue commented 5 years ago

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.

tanvishah-syn commented 5 years ago

@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 commented 5 years ago

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

janpio commented 5 years ago

--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 commented 5 years ago

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

BorntraegerMarc commented 5 years ago

Created this ionic forum question: https://forum.ionicframework.com/t/exception-with-livereload-when-using-flag-usemodernbuildsystem/142728

499978920 commented 5 years ago

when:ionic cordova run ios --emulator --buildFlag="-UseModernBuildSystem=0"

BUILD SUCCEEDED

No target specified for emulator. Deploying to iPhone-XS-Max, 12.0 simulator

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. logPath: /Users/Mango/desktop/app4/platforms/ios/cordova/console.log

[OK] Your app has been deployed. Did you know you can live-reload changes from your app with --livereload?

but console.log not exist. app not deployed.

when:ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0" app deployed to iPhone 7 Plus, and work fine

when: use Xcode 10 simulator ok iPhone 7 Plus ok

janpio commented 5 years ago

@499978920 Your first command is missing an --. You need two of those before buildflag so it gets routed to cordova and not ionic.

jrmihalick commented 5 years ago

@dpogue I added the "-UseModernBuildSystem=0" flag to my build.json and that does address the problem we were having as mentioned on issue https://github.com/apache/cordova-cli/issues/329 . Should we expect the UserModernBuildSystem=0 setting to also persist into the generated workspace, or is it always necessary to manually make that setting change in the Workspace Settings dialog as you have shown above?

dpogue commented 5 years ago

Should we expect the UserModernBuildSystem=0 setting to also persist into the generated workspace, or is it always necessary to manually make that setting change in the Workspace Settings dialog as you have shown above?

If you open the project in Xcode, you must change the Workspace Settings. The command-line flags only affect the command-line builds.

juamperuiz commented 5 years ago

@dpogue Thanks for your comment, you save my time!

499978920 commented 5 years ago

@499978920 Your first command is missing an --. You need two of those before buildflag so it gets routed to cordova and not ionic.

ionic cordova build ios --emulator -- --buildFlag="-UseModernBuildSystem=0" ok but ionic cordova run ios --emulator --target="iPhone-XS" -- --buildFlag="-UseModernBuildSystem=0" app not deployed but ionic cordova run ios --emulator --target="iPhone-7, 11.4" -- --buildFlag="-UseModernBuildSystem=0" app deployed

some simulator ok eg: iPhone-XR some simulator can't deployed eg: iPhone-XS iPhone-XS-Max

janpio commented 5 years ago

You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.

499978920 commented 5 years ago

You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.

simulators it's working fine. now. I have not changed anything. very strange. Thanks.

v-ken commented 5 years ago

Thanks for the workaround. I manage to build using the recommended build flag. However, I only get a blank white screen after the splash screen disappears. The app was working fine when running on Xcode 9. Was wondering if anyone else is having this issue?

I'm running on ionic.

jamesparkes commented 5 years ago

i'm having a similar issue @v-ken. i was able to build by passing --buildConfig, however, my app just stays stuck on the splash screen. it is possible some other plugins are now breaking, but don't know for sure

dpogue commented 5 years ago

@jamesparkes Just to get a bit more info, are you using Cordova or Ionic? There has been a report of icons/splashscreens not working in Xcode 10, but other people have said it's working fine 😕

jamesparkes commented 5 years ago

hey @dpogue i'm using ionic

jamesparkes commented 5 years ago

screen shot 2018-09-27 at 12 14 18 pm ^ output from console 🍑💨

screen shot 2018-09-27 at 12 15 49 pm ^ DOM

it appears like everything is there looking at the DOM, but without anything to go by on the console output, i'm stuck in the mud.

i'm gonna try ripping out plugins one by one to see if something is possibly happening there

dpogue commented 5 years ago

I don't think the missing splashscreens are a plugin issue. It's probably related to how/where the assets are getting copied in Xcode.

jamesparkes commented 5 years ago

hhhrrrmmm. the splashscreen itself isn't missing, it opens on the splashscreen and the splashscreen never goes away

hitigon commented 5 years ago

You should probably create a new issue for that so this can be properly debugged @499978920 . Link to it here after you created the issue. Thanks.

simulators it's working fine. now. I have not changed anything. very strange. Thanks.

I saw the same issue, but mine didn't magically fix itself. (still trying)

fuentes73 commented 5 years ago

@jamesparkes I'm using Ionic too. And my app works perfectly with --buildConfig. Maybe you can try to remove ios platform and add it again.

ionic cordova platform rm ios
ionic cordova platform add ios
jamesparkes commented 5 years ago

i'm good to go now, the buildConfig also worked for me. my issue was another plugin. sorry for the mishap!

ghost commented 5 years ago

ionic cordova emulate ios -- --buildFlag="-UseModernBuildSystem=0"

worked for me, thanks!

prvinuch commented 5 years ago

--buildFlag="-UseModernBuildSystem=0" Worked for me too additionaly i need to change the build system in Workspace Settings to "Legacy Build System"

paulincai commented 5 years ago

I am just wondering why I don't have this issue. I am on a "self upgrade" of Cordova versions in MeteorJS. I use cordova-lib@8.1.0 and cordova-ios@4.5.5 and I haven't had any problems from my first xcode build with xCode 10. Actually I came into this page because there is an announcement on Cordova blog not because I had any issues.

I believe Meteor is not using cordova-cli and the project is built by this file: https://github.com/meteor/meteor/blob/devel/tools/cordova/project.js

sgruhier commented 5 years ago

when I run ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0" I have

Unknown option: '--buildFlag'

I'm using ng cli 6.2.3 Any idea? Thanks

499978920 commented 5 years ago

when I run ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0" I have

Unknown option: '--buildFlag'

I'm using ng cli 6.2.3 Any idea? Thanks

-- --buildFlag="-UseModernBuildSystem=0"

dominikse commented 5 years ago

when I run ng run app:ionic-cordova-build --platform=ios --buildFlag="-UseModernBuildSystem=0" I have

Unknown option: '--buildFlag'

I'm using ng cli 6.2.3 Any idea? Thanks

You need to change the build system in Xcode to legacy build system (see screenshots at pullet point 3 in first post).

sgruhier commented 5 years ago

thanks I did it, I can run a build in xcode but I'm curious how I can use command line like others with --buildFlag :)

CesarBalzer commented 5 years ago

Changing the configuration in xcode to legacy did not work, setting the flag cordova build ios --buildFlag = '- UseModernBuildSystem = 0' did not work and creating the build.json file with the flags also did not work.

I downgrade the Cordova version to 7 and it works normal. thank you Quentin Valmori

ecert commented 5 years ago

Hi there, Cordova project on Xcode10 is failure for FCM because of XCode's new build system.

If you want to use Google FCM Push Notification with iOS device (Coding with Cordova / Ionic 3) try this;

Opening your cordova/ionic project in the Xcode IDE and change the build system in Workspace Settings to "Legacy Build System" (Under the File Menu)..