Yermo / nativescript-mapbox

:statue_of_liberty: :tokyo_tower: :mount_fuji: Native OpenGL powered Maps, by Mapbox
MIT License
194 stars 94 forks source link

Error while loading the map #220

Open islam56naser opened 6 years ago

islam56naser commented 6 years ago

Hi, I'm getting this error while trying to load the map

System.err: TypeError: Cannot read property 'getInstance' of undefined
System.err: File: "file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js, line: 142, column: 24
System.err:
System.err: StackTrace:
System.err:     Frame: function:'MapboxView.initMap', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-mapbox/mapbox.js', line: 39, column: 40
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-mapbox/mapbox.js', line: 30, column: 19
System.err:     Frame: function:'ZoneDelegate.invokeTask', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 398, column: 31
System.err:     Frame: function:'Zone.runTask', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 165, column: 47
System.err:     Frame: function:'ZoneTask.invoke', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 460, column: 38
System.err:     Frame: function:'timer', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 1636, column: 29
System.err:     Frame: function:'invoke', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 19, column: 48
System.err:     Frame: function:'ZoneDelegate.invoke', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 365, column: 26
System.err:     Frame: function:'Zone.runGuarded', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 138, column: 47
System.err:     Frame: function:'', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js', line: 116, column: 29
System.err:     Frame: function:'run', file:'file:///data/data/org.nativescript.complaints/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 23, column: 13
System.err:
System.err:     at com.tns.Runtime.callJSMethodNative(Native Method)
System.err:     at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
System.err:     at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:957)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:941)
System.err:     at com.tns.Runtime.callJSMethod(Runtime.java:933)
System.err:     at com.tns.gen.java.lang.Runnable.run(Runnable.java:10)
System.err:     at android.os.Handler.handleCallback(Handler.java:754)
System.err:     at android.os.Handler.dispatchMessage(Handler.java:95)
System.err:     at android.os.Looper.loop(Looper.java:163)
System.err:     at android.app.ActivityThread.main(ActivityThread.java:6221)
System.err:     at java.lang.reflect.Method.invoke(Native Method)
System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
ActivityManager: report kill process: killerPid is:31676, killedPid is:31676
ActivityManager: Process org.nativescript.complaints (pid 31676) has died: fore T
ActivityManager: cleanUpApplicationRecord -- 31676

I'm using Nativescript with Angular. Thanks in advance

EddyVerbruggen commented 6 years ago

That's this line, which means you've added the plugin without doing a full build afterwards, I think.

Can you remove the platforms folder and build again?

islam56naser commented 6 years ago

It worked thanks a lot.

klever34 commented 6 years ago

@EddyVerbruggen did platform removal but the error still persist.. how can I fix this?

hcgustavo commented 6 years ago

I'm also getting the same issue. I'm using vue-cli template. Already run npm run clean to clean the project and remove platform but it's not working. The strange thing is that it has stopped working out of nowhere.

boldham31 commented 6 years ago

That's this line, which means you've added the plugin without doing a full build afterwards, I think.

Can you remove the platforms folder and build again?

I had the same issue as @islam56naser and this solution fixed it for me as well.

klever34 commented 6 years ago

@hcgustavo were you able to find a solution to this?

hcgustavo commented 6 years ago

@klever34 Not really. I had to downgrade the version to 4.0.0 (if I'm not wrong) to make it work. But I'm not using this plugin anymore. I changed to the google maps plugin.

klever34 commented 6 years ago

Thanks for your reply @hcgustavo. I had to change to google maps as well, but then I had to switch to a new laptop and the plugin stopped working, giving this error => FAILURE: Build failed with an exception.

What went wrong: Could not resolve all files for configuration ':releaseCompileClasspath'. Could not find support-v4.aar (com.android.support:support-v4:26.1.0). Searched in the following locations: https://jcenter.bintray.com/com/android/support/support-v4/26.1.0/support-v4-26.1.0.aar

Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Get more help at https://help.gradle.org

BUILD FAILED in 1s

I'm still on tns version 4.0.1