Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telemetry Issue #78

Closed
nunogrocha opened this issue Feb 9, 2017 · 11 comments
Closed

Telemetry Issue #78

nunogrocha opened this issue Feb 9, 2017 · 11 comments

Comments

@nunogrocha
Copy link

nunogrocha commented Feb 9, 2017

Been having a telemetry error show up, starting this afternoon, even without changing anything in the manifest, running nativescript-mapbox 2.5.1

I had the following Telemetry:
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService" />

The error only stopped after I changed it to:
<service android:name="com.mapbox.services.android.telemetry.service.TelemetryService" />

Hope it helps in case anyone gets the same error.

@alexmtmorgan
Copy link

Got the same error on my project and this solved the issue. Thanks!

@EddyVerbruggen
Copy link
Collaborator

Anyone up for a PR to fix it in the plugin? 2 locations to update..

@j99ht
Copy link

j99ht commented Feb 16, 2017

Still having the same issue. Installed NativeScript 2.5.0 and mapbox plugin 2.5.1
It was working but when android platform was removed and added again, it stopped working.
I have added the service Telemetry but does not help. Any idea?

@nunogrocha
Copy link
Author

What's the error output? I found out the possible solution described above because the "new telemetry link" was included in the error message.

@j99ht
Copy link

j99ht commented Feb 16, 2017

This is the error output
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException:
Calling js method run failed

Error: com.mapbox.services.android.telemetry.TelemetryException: Please, make sure you add the Telemetry service (com.mapbox.services.android.telemetry.service.TelemetryService) to your AndroidManifest.xml file. For more information, please visit https://www.mapbox.com/android-sdk.
com.mapbox.services.android.telemetry.MapboxTelemetry.validateTelemetryServiceConfigured(MapboxTelemetry.java:154)
com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:121)
com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:98)
com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:40)
com.tns.Runtime.callJSMethodNative(Native Method)
com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
com.tns.Runtime.callJSMethod(Runtime.java:1047)
com.tns.Runtime.callJSMethod(Runtime.java:1028)
com.tns.Runtime.callJSMethod(Runtime.java:1018)
com.tns.gen.java.lang.Runnable.run(java.lang.Runnable.java)
android.os.Handler.handleCallback(Handler.java:739)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:148)
android.app.ActivityThread.main(ActivityThread.java:5551)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
File: "file:///data/data/org.nativescript.ctdemo/files/app/tns_modules/nativescript-mapbox/mapbox.js, line: 41, column: 34

StackTrace:
Frame: function:'createUI', file:'file:///data/data/org.nativescript.ctdemo/files/app/tns_modules/nativescript-mapbox/mapbox.js', line: 41, column: 35
Frame: function:'run', file:'file:///data/data/org.nativescript.ctdemo/files/app/tns_modules/tns-core-modules/timer/timer.js', line: 17, column: 13

at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1197)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:1061)
at com.tns.Runtime.callJSMethod(Runtime.java:1047)
at com.tns.Runtime.callJSMethod(Runtime.java:1028)
at com.tns.Runtime.callJSMethod(Runtime.java:1018)
at com.tns.gen.java.lang.Runnable.run(java.lang.Runnable.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: com.mapbox.services.android.telemetry.TelemetryException: Please, make sure you add the Telemetry service (com.mapbox.services.android.telemetry.service.TelemetryService) to your AndroidManifest.xml file. For more information, please visit https://www.mapbox.com/android-sdk.
at com.mapbox.services.android.telemetry.MapboxTelemetry.validateTelemetryServiceConfigured(MapboxTelemetry.java:154)
at com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:121)
at com.mapbox.services.android.telemetry.MapboxTelemetry.initialize(MapboxTelemetry.java:98)
at com.mapbox.mapboxsdk.Mapbox.getInstance(Mapbox.java:40)
... 14 more

@shivapersad
Copy link

shivapersad commented Feb 16, 2017

I used the AndroidManifest.xml entry at the start of this thread and had to remove and add back the android platform to get the map to display. I have markers on my map and when the map loads I get the following console output:

JS: Unhandled Promise rejection: iconFactory.fromDrawable is not a function ; Zone: ; Task: Promise.then ; Value: TypeError: iconFactory.fromDrawable is not a function TypeError: iconFactory.fromDrawable is not a function
JS: at file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-mapbox/mapbox.js:510:47
JS: at ZoneDelegate.invoke (file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:190:28)
JS: at Zone.run (file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:83:43)
JS: at file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:449:57
JS: at ZoneDelegate.invokeTask (file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:223:37)
JS: at Zone.runTask (file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:123:47)
JS: at drainMicroTaskQueue (file:///data/data/org.ngccng.cngApp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:355:35)
JS: Error: Uncaught (in promise): TypeError: iconFactory.fromDrawable is not a function

Any thoughts on how to fix this?

@Equisetum
Copy link
Contributor

Took me some time to find out, but you have to add the line:
<service android:name="com.mapbox.services.android.telemetry.service.TelemetryService"/>`
in two AndroidManifest.xml files within the application node.

  • appfolder\platforms\android\src\main\AndroidManifest.xml
  • appfolder\app\App_Resources\Android\AndroidManifest.xml
    then force a rebuild of your app

@EddyVerbruggen
Copy link
Collaborator

@Equisetum see my previous comment. Let's help each other out by creating a pull request to change those paths 🤝

@Equisetum
Copy link
Contributor

I'd love to, but I am inexperienced. Would not even know how to start.

@EddyVerbruggen
Copy link
Collaborator

Nice!

  1. Fork this repo by pressing that 'Fork' button at the top.
  2. Change the files (2) in your fork. You can do this by doing a git clone <repo url> or use GitHub's edit function.
  3. Select the 'Pull Requests' tab (next to the 'Issues' tab).
  4. Submit the PR.

@EddyVerbruggen
Copy link
Collaborator

Closed via #82

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants