m0dch3n / vue-cli-plugin-cordova

Vue Cli 3 Cordova Plugin
MIT License
417 stars 63 forks source link

serve-ios and build-ios encountering build error #42

Closed thang2162 closed 5 years ago

thang2162 commented 5 years ago

I am getting error code 65 with the following commands with the system being unable to locate the xcarchive.

npm run cordova-serve-ios # Development IOS npm run cordova-build-ios # Build IOS

This is a known issue with cordova being incompatible with xcode's new build method and can be solved by build the cordova ios directly using: cordova run ios --buildFlag='UseModernBuildSystem=0' as a workaround.

A workaround to getting serve working on ios is to do the following:

  1. In index.js change:

From: const getPlatformPathWWW = platform => { return api.resolve(${cordovaPath}/platforms/${platform}/platform_www) }

To: const getPlatformPathWWW = platform => { return api.resolve(${cordovaPath}/www) }

  1. Run: npm run cordova-serve-android

  2. From cordova project root run: cordova build ios --buildFlag='UseModernBuildSystem=0'

  3. Open ios project in xcode and run from scode.

  4. Hot-Reload should be working on both ios and android

m0dch3n commented 5 years ago

for buildflag you can use build.json from cordova like some issues already mentioned here

https://github.com/m0dch3n/vue-cli-plugin-cordova/issues?utf8=✓&q=is%3Aissue+build.+json

m0dch3n commented 5 years ago

PS changing this line to www isn't correct, because then cordova.js etc will be missing I think

thang2162 commented 5 years ago

It won't. The solution I posted works, I tested it out with on my MacBook Pro.

On Sun, Dec 23, 2018 at 11:45 AM m0dch3n notifications@github.com wrote:

PS changing this line to www isn't correct, because then cordova.js etc will be missing I think

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/m0dch3n/vue-cli-plugin-cordova/issues/42#issuecomment-449652904, or mute the thread https://github.com/notifications/unsubscribe-auth/ADkzx3Hl_5hrsowoQRT8FAW9nLJV3nrLks5u78EsgaJpZM4ZfKur .

m0dch3n commented 5 years ago

ok, I'll give it try when I've some time

m0dch3n commented 5 years ago

From: const getPlatformPathWWW = platform => { return api.resolve(${cordovaPath}/platforms/${platform}/platform_www) }

To: const getPlatformPathWWW = platform => { return api.resolve(${cordovaPath}/www) }

I had time, to try this, this is not working, because under http://localhost:8080/cordova.js the cordova.js is no longer served then...

I close now this ticket, because the rest are cordova specific problems, and not plugin related problems

Once cordova solves these Xcode 10 Build Problems, the plugin should work again without build.json etc...