dapriett / nativescript-google-maps-sdk

Cross Platform Google Maps SDK for Nativescript
MIT License
244 stars 164 forks source link

iOS build fail: Undefined symbols for architecture i386 #421

Open alexisconsuegra opened 4 years ago

alexisconsuegra commented 4 years ago

It seems nativescript-google-maps-sdk is causing the issue. Have anyone found a fix for this plugin? Thanks,

Undefined symbols for architecture i386: "___isPlatformVersionAtLeast", referenced from: -[GMSCellularInfo SIMCountryCode] in GoogleMaps -[GMSScreenInfo initWithUIScreen:] in GoogleMaps -[GMSx_QTMCollectionViewController viewDidLoad] in GoogleMaps -[GMSx_QTMCollectionViewController viewDidLayoutSubviews] in GoogleMaps -[GMSx_QTMCollectionViewStyleController contentViewInsetsForCellWithAttribute:] in GoogleMaps -[GMSx_QTMCollectionViewStyleController setInsetsContentViewsToSafeArea:] in GoogleMaps -[GMSx_QTMCollectionViewStyleController insetsAtSectionIndex:] in GoogleMaps ... ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) note: Using new build systemnote: Planning buildnote: Constructing build description BUILD FAILED

Command xcodebuild failed with exit code 65

funder7 commented 4 years ago

Hi @alexisconsuegra, unfortunately I didn't have a mac, so I cannot build or test iOS related stuff. I can help you to find a solution though... this plugin must have worked in the past on iOS, so if you are having problems with it, probably your setup is too recent and something may have broken.

I've found why markers are not showing, a quick hack made them working again, but before pushing the fix I would investigate on why this is happening, and how to refactor the plugin properly.

In the meanwhile, can you share the ouput of tns info plus your package.json dependencies & devDependencies? Maybe @dapriett is busy... if you want I can share with you my updated version, and you can build the iOS part on your mac.. that would be good as the Android version it's ok, except for that marker problem that I will fix in the next days.

alexisconsuegra commented 4 years ago

Hi @funder7, thanks a lot. Here is the tns info output: ✔ Getting NativeScript components versions information... ⚠ Update available for component nativescript. Your current version is 6.2.0 and the latest available version is 6.7.8. ⚠ Update available for component tns-core-modules. Your current version is 6.2.0 and the latest available version is 6.5.12. ⚠ Update available for component tns-android. Your current version is 6.5.0 and the latest available version is 6.5.3. ⚠ Update available for component tns-ios. Your current version is 6.2.0 and the latest available version is 6.5.2. Here is the package.json { "nativescript": { "id": "org.nativescript.ac", "tns-android": { "version": "6.5.0" }, "tns-ios": { "version": "6.2.0" } }, "description": "NativeScript Application", "license": "SEE LICENSE IN ", "repository": "", "dependencies": { "@nativescript/theme": "~2.3.0", "nativescript-background-http": "^4.2.1", "nativescript-camera": "^4.5.0", "nativescript-drop-down": "^5.0.6", "nativescript-geolocation": "^5.1.0", "nativescript-google-maps-sdk": "^2.9.1", "nativescript-imagepicker": "^7.1.0", "nativescript-masked-text-field": "^4.0.3", "nativescript-purchase": "^2.0.13", "nativescript-ui-listview": "^8.2.0", "node-sass": "^4.14.1", "tns-core-modules": "^6.2.0" }, "devDependencies": { "nativescript-dev-webpack": "~1.5.0", "typescript": "^3.9.7" }, "gitHead": "20a65d338ae8f8911087ab6615b89363f864b07b", "readme": "NativeScript Application" }

funder7 commented 4 years ago

Okay.. first I suggest you to share the code here by using the "< >" button or with typing three backticks ` (right alt + question mark key) at code begin & end. It will be formatted and more readable :)

Your project has a lot of plugins installed...that could interfere with this test! If your project worked before installing nativescript-google-maps-sdk then you can be sure that it's the source of the problem.

Anyway, let's move on:

Ok...so if the app works with this setup, we know that the error that you are getting it's related to some new update introduced with nativescript 6. You can use this setup for your project, while the plugin gets fixed. If you do this, it's important to delete this folders first:

in case of errors from nativescript cli nativescript cli must be retro-compatible, but in case that is not, reinstall the 5.x version with npm remove -g nativescript & npm i -g nativescript@5.4.2.

That's all, I hope that will fix your error.

About making the plugin work with Nativescript 6.x If you know the git workflow, then in the next days I can tell you how to build the plugin on your mac, it's simple, just a few commands. Have you got Slack?

See you later ;)

alexisconsuegra commented 4 years ago

Hi @funder7. Thanks again. I will keep in mind the tip about formatting the code. I am not familiar with Angular. I have written the app in plain Javascript. Is there way to try this without Angular?

funder7 commented 4 years ago

Sure I didn't read well... that' why it's better to format code :)

Check the gist, there's the plain version. it's already updated to version 6.2.0, it should work as is.

steps:

alexisconsuegra commented 4 years ago

Thanks @funder7 I did it all but there is something with the webpack config. I have never seen this before. /Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/cli.js:244 throw err; ^

TypeError: nsWebpack.hasRootLevelScopedModules is not a function at module.exports (/Users/alexis/Documents/NsApps/anc/webpack.config.js:61:49) at handleFunction (/Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/prepareOptions.js:23:13) at prepareOptions (/Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/prepareOptions.js:9:5) at requireConfig (/Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/convert-argv.js:136:14) at /Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/convert-argv.js:142:17 at Array.forEach () at module.exports (/Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/convert-argv.js:140:15) at /Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/cli.js:241:39 at Object.parse (/Users/alexis/Documents/NsApps/anc/node_modules/yargs/yargs.js:567:18) at /Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/cli.js:219:8 at Object. (/Users/alexis/Documents/NsApps/anc/node_modules/webpack-cli/bin/cli.js:538:3) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Module.require (internal/modules/cjs/loader.js:1026:19) at require (internal/modules/cjs/helpers.js:72:18) at Object. (/Users/alexis/Documents/NsApps/anc/node_modules/webpack/bin/webpack.js:155:2) at Module._compile (internal/modules/cjs/loader.js:1138:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10) at Module.load (internal/modules/cjs/loader.js:986:32) at Function.Module._load (internal/modules/cjs/loader.js:879:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 Executing webpack failed with exit code 1.

funder7 commented 4 years ago

Probably your webpack.config.js is not compatible with the freshly installed nativescript-dev-webpack version.

Look inside node_modules → nativescript-dev-webpack, there is a webpack.config.js file, copy that in your project root (owerwrite the old one), and try again. good luck again!

ju4nj3 commented 3 years ago

Change this line in node_modules/nativescript-google-maps-sdk/platforms/ios/Podfile to:

pod 'GoogleMaps', '<= 2.7.0'

funder7 commented 3 years ago

hi @ju4nj3, can you give me some info about this change? is the pod up or downgraded? thanks