ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/plugins/cordova-plugin-googlemaps/www/promise-7.0.4.min.js.map #116

Closed b-ozcan closed 5 years ago

b-ozcan commented 5 years ago

I'm submitting a ... (check one with "x")

If you choose 'problem or bug report', please select OS: (check one with "x")

ionic information: (run $> ionic info)

✔ Gathering environment info - done!
Ionic:

   ionic (Ionic CLI)  : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 5 other plugins)

System:

   ios-deploy : 1.9.2
   NodeJS     : v6.10.2 (/usr/local/bin/node)
   npm        : 6.3.0
   OS         : macOS High Sierra
   Xcode      : Xcode 10.1 Build version 10B61

snippet from config.xml

    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^2.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />
    <plugin name="cordova-plugin-googlemaps" spec="^2.4.6">
        <variable name="API_KEY_FOR_ANDROID" value="myKey" />
        <variable name="API_KEY_FOR_IOS" value="myKey" />
    </plugin>
    <engine name="ios" spec="4.5.5" />

snippet from package.json

    "@ionic-native/core": "^4.15.0",
    "@ionic-native/google-maps": "^4.15.1",
    "cordova-ios": "4.5.5",
    "cordova-plugin-device": "^2.0.2",

Current behavior: The Google Maps isn't working/loading

screen shot 2018-10-31 at 12 57 46

Expected behavior: To make Google Maps working/loading Performing the EXACT same steps on a windows machine does work for Android.

Steps to reproduce:

  1. ionic start testApp blank (v3 and yes for cordova)

  2. executed npm and plugin commands like on this page: https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/README.md

  3. updated the content of home.ts exactly from example on same page. (changed Env keys)

  4. I have installed xCode 10.x so I'm using a buildflag to prevent building errors. I've added a build.json to my ionic project root

    {
    "ios": {
    "debug": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    },
    "release": {
      "buildFlag": [
        "-UseModernBuildSystem=0"
      ]
    }
    }
    }
  5. ionic cordova build ios

  6. I have cocoapods installed and google maps is getting installed from there to. So i have GoogleMaps in /platforms/ios/Pods and cordova-plugin-googlemaps in /platforms/ios/testApp/Plugins

  7. App has been signed in xCode (always working before)

  8. The app runs but the maps section is empty, when I inspect with the editor I get the following error: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/plugins/cordova-plugin-googlemaps/www/promise-7.0.4.min.js.map

wf9a5m75 commented 5 years ago
$> ionic cordova plugin rm cordova-plugin-googlemaps

$> ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps
b-ozcan commented 5 years ago

I should re-add the plugin with the ios/android variables I assume? (returns error when not)

$> ionic cordova platform rm ios
$> ionic cordova plugin rm cordova-plugin-googlemaps
$> ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID="myApiKey" --variable API_KEY_FOR_IOS="myApiKey"
$> ionic cordova run ios

result: screen shot 2018-10-31 at 16 36 10

wf9a5m75 commented 5 years ago

Type cordova in console.log

b-ozcan commented 5 years ago
Object = $1
InAppBrowser: {open: function}
addConstructor: function(func)
addDocumentEventHandler: function(event)
addStickyDocumentEventHandler: function(event)
addWindowEventHandler: function(event)
callbackError: function(callbackId, args)
callbackFromNative: function(callbackId, isSuccess, status, args, keepCallback)
callbackId: 60935195
callbackStatus: {NO_RESULT: 0, OK: 1, CLASS_NOT_FOUND_EXCEPTION: 2, ILLEGAL_ACCESS_EXCEPTION: 3, INSTANTIATION_EXCEPTION: 4, …}
callbackSuccess: function(callbackId, args)
callbacks: {NetworkStatus60935192: Object, StatusBar60935193: Object}
define: function(id, factory)
exec: function()
file: {applicationDirectory: "file:///var/containers/Bundle/Application/XXX-MYAPP/myApp.app/", applicationStorageDirectory: "file:///var/mobile/Containers/Data/Application/XXX-MYAPP/", dataDirectory: "file:///var/mobile/Containers/Data/Application/XXX-MYAPP/Library/NoCloud/", cacheDirectory: "file:///var/mobile/Containers/Data/Application/XXX-MYAPP/Library/Caches/", externalApplicationStorageDirectory: null, …}
fireDocumentEvent: function(type, data, bNoDetach)
fireWindowEvent: function(type, data)
getOriginalHandlers: function()
platformId: "ios"
platformVersion: "4.5.5"
plugins: {fileOpener2: FileOpener2, IsDebug: Object, diagnostic: Object}
removeDocumentEventHandler: function(event)
removeWindowEventHandler: function(event)
require: function(id)
version: "4.5.5"
Object Prototype
wf9a5m75 commented 5 years ago

Please share your project files on GitHub.

wf9a5m75 commented 5 years ago

If you get the error with ionic cordova run browser -l, try upgrade with npm -g install ionic@4.3.0 https://forum.ionicframework.com/t/cordova-js-not-loaded-in-livereload/146115

wf9a5m75 commented 5 years ago

ping

wf9a5m75 commented 5 years ago

ping

b-ozcan commented 5 years ago

(Sorry I was out for the weekend)

If you get the error with ionic cordova run browser -l, try upgrade with npm -g install ionic@4.3.0 https://forum.ionicframework.com/t/cordova-js-not-loaded-in-livereload/146115

I didn't get any errors when using ionic cordova run browser -l. What I did see was the 'For development purposes only' in the map. But that's because of my api key is for ios only (probably).

b-ozcan commented 5 years ago

Updated Ionic to 4.3.1 -> Problem still standing

wf9a5m75 commented 5 years ago

I said "Please share your project files on GitHub"

b-ozcan commented 5 years ago

I decided to start all over and create a blank project. So.. As you'd suggested I've updated my Ionic to the latest. Installed the cordova plugin as you've said above with the #multiple_maps and now it's working. I haven't done anything else/different, so I think it was something with the Ionic version I was using (not sure)?? Sorry for wasting your time but thank you again for having a look at it.