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

System.err: TypeError: Cannot read property 'CameraPosition' of undefined #243

Closed
westlakem opened this issue Jan 15, 2018 · 8 comments
Closed

Comments

@westlakem
Copy link

westlakem commented Jan 15, 2018

System.err: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.ProfessionalTraveler/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
System.err: Calling js method onCreateView failed
System.err:
System.err: TypeError: Cannot read property 'CameraPosition' of undefined
System.err: File: "file:///data/data/org.nativescript.ProfessionalTraveler/files/app/tns_modules/nativescript-google-maps-sdk/map-view.js, line: 217, column: 61

Running on emulated pixel 2, API version 26

EDIT 1:
It appears com.google.android.gms.maps.model is the null party.
Also that the package being used is com.google.android.gms:play-services-maps:11.8.0

@westlakem
Copy link
Author

@dapriett Can we get some feedback on the status of this?

@dapriett
Copy link
Owner

Are you saying the java class com.google.android.gms.maps.model.CameraPosition.Builder is unavailable for you? It's still there, hasn't changed (https://developers.google.com/android/reference/com/google/android/gms/maps/model/CameraPosition.Builder) - so that makes me believe you have an issue with your Android Google Play SDK locally.

@westlakem
Copy link
Author

@dapriett 2 other people have "thumbs up" the post. I agree with you that it appears the API is still there, so it might be an issue with our setup, but since more than I am experiencing this (and this is my first time in mobile development) is it possible anyone else can help look into this?

@westlakem
Copy link
Author

westlakem commented Jan 21, 2018

Ok... so I'm going to close this and mark the issue resolved from my end, but their of the other 2 that still have the issue after following how I fixed it, please feel free to reopen....

STEPS I USED TO SOLVE:
1 - When using the android emulator from Android Studio, It is NOT enough to have the play services sdk from $ANDROID_HOME$/tools/android. You also need it setup through android studio (File / Settings / Android SDK / SDK Tools / Google Play Services (check and apply).

2 - Delete any existing android emulators and re-create them.

3 - Remove the nativescript plugin (tns plugin remove nativescript-google-maps-sdk)

4 - Delete the $WORKSPACE$/platforms and $WORKSPACE$/node_modules folders

5 - re-add the nativescript plugin (tns plugin add nativescript-google-maps-sdk)

6 - Launch the emulator and tns run android

@raymall
Copy link

raymall commented Jan 26, 2018

Lovely!

@3rror404
Copy link

I just came across this error when running on a device rather than an emulator. Simply trashing the android platform was enough to fix it for.

$ tns platform remove android
$ tns run android

@westlakem
Copy link
Author

@3rror404 You mean you didn't have to throw the physical device away :-P

@RioBautista
Copy link

I just came across this error when running on a device rather than an emulator. Simply trashing the android platform was enough to fix it for.

$ tns platform remove android
$ tns run android

Same worked for me even using an emulator.

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

No branches or pull requests

5 participants