quasarframework / quasar-cli

[DEPRECATED, <= 0.17) Quasar Framework - CLI
https://quasar.dev
MIT License
202 stars 50 forks source link

how to make Quasar use Cordova build.json file #215

Closed mesqueeb closed 5 years ago

mesqueeb commented 5 years ago

Hi, As per the cordova announcement cordova can only be initialised when you add the extra flag --buildFlag='-UseModernBuildSystem=0' to Cordova if you have XCode 10.

I tried to do this with quasar dev:

quasar dev -m cordova -T ios -t ios -e iPhone-8 --buildFlag='-UseModernBuildSystem=0'

But Quasar seems to not succesfully pick up this flag...

Without this flag errors prevent the simulator from being run.

rstoenescu commented 5 years ago

Try adding this to build.json as per cordova's recommendation:

"ios": {
    "release": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
  }
mesqueeb commented 5 years ago

@rstoenescu There is no build.json file in the src-cordova folder and also not in the main quasar folder. I also tried adding it under cordova inside quasar.conf but this also did not work. Any advice?

rstoenescu commented 5 years ago

Yes, by default there isn't such a file. But you create it yourself in /src-cordova

mesqueeb commented 5 years ago

After adding a new file called build.json inside src-cordova with this code:

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

and executing quasar dev -m cordova -T ios -t ios -e iPhone-8 in the root directory of my project, I still get the same error:

/Info.plist file not found.

Edit: further investigation told me to add the --buildConfig flag for cordova to pick up the build.json file. But Quasar also does not support this it seems. I tried with quasar dev -m cordova -T ios -t ios --buildConfig -e iPhone-8 but still the same error.

Is it because the quasar dev command is run in the root dir of the Quasar project, but the build.json file is inside the src-cordova folder perhaps?

mesqueeb commented 5 years ago

On the android area:

In order for my app to be signed each build & during dev I need to add additional params to cordova's build.json file.

Cordova docs on android app signing

So I guess we'll change this thread to "how to make Quasar use Cordova build.json file".

mesqueeb commented 5 years ago

@rstoenescu

Nevermind, on both the android and ios commands it does seem to pick up the build.json file:

2019-01-05 23 20 47

however, the "release": { "buildFlag": [ "-UseModernBuildSystem=0" ] } option is not being applied it seems.

I guess I'll revert this error to the cordova repo instead.

mesqueeb commented 5 years ago

My iOS problem was solved as well:

Just for anyone with a similar problem and want to get it to work with the build.json

At first I tried what I have written in the beginning of this thread, but it didn't work: build.json

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

Then I realised I have to add "debug" as well.

Solution:

build.json

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

Just thought I'd leave it here for future reference.

mesqueeb commented 5 years ago

Also important to note that when you use this method, you need to select the "Legacy Build System" in Xcode before you archive your app, because Cordova is not yet compatible with the new build system.

Go to file > project settings (or workspace settings) and then select "Legacy Build System"