zyzdev / flutter_street_view

10 stars 29 forks source link

[Android] java.lang.NullPointerException: Parameter specified as non-null is null: method zyz.flutter.plugin.flutter_google_street_view.FlutterGoogleStreetView.onStreetViewPanoramaChange, parameter location #31

Open hukusuke1007 opened 11 months ago

hukusuke1007 commented 11 months ago

The app crashes when setting a location where Street View does not exist.

flutter_google_street_view: ^3.1.4
D/AndroidRuntime(24825): Shutting down VM
E/AndroidRuntime(24825): FATAL EXCEPTION: main
E/AndroidRuntime(24825): Process: app.product.sekaiisanwalking.development, PID: 24825
E/AndroidRuntime(24825): com.google.maps.api.android.lib6.common.apiexception.f: java.lang.NullPointerException: Parameter specified as non-null is null: method zyz.flutter.plugin.flutter_google_street_view.FlutterGoogleStreetView.onStreetViewPanoramaChange, parameter location
E/AndroidRuntime(24825):    at com.google.maps.api.android.lib6.streetview.camera.i.g(:com.google.android.gms.dynamite_mapsdynamite@233013044@23.30.13 (190400-0):323)
E/AndroidRuntime(24825):    at com.google.maps.api.android.lib6.streetview.camera.e.run(:com.google.android.gms.dynamite_mapsdynamite@233013044@23.30.13 (190400-0):3)
E/AndroidRuntime(24825):    at android.os.Handler.handleCallback(Handler.java:942)
E/AndroidRuntime(24825):    at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(24825):    at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(24825):    at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(24825):    at android.app.ActivityThread.main(ActivityThread.java:7918)
E/AndroidRuntime(24825):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(24825):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(24825):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(24825): Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method zyz.flutter.plugin.flutter_google_street_view.FlutterGoogleStreetView.onStreetViewPanoramaChange, parameter location
E/AndroidRuntime(24825):    at zyz.flutter.plugin.flutter_google_street_view.FlutterGoogleStreetView.onStreetViewPanoramaChange(Unknown Source:2)
E/AndroidRuntime(24825):    at com.google.android.gms.maps.zzai.zzb(com.google.android.gms:play-services-maps@@18.1.0:1)
E/AndroidRuntime(24825):    at com.google.android.gms.maps.internal.zzbl.zza(com.google.android.gms:play-services-maps@@18.1.0:3)
E/AndroidRuntime(24825):    at com.google.android.gms.internal.maps.zzb.onTransact(com.google.android.gms:play-services-maps@@18.1.0:3)
E/AndroidRuntime(24825):    at android.os.Binder.transact(Binder.java:1164)
E/AndroidRuntime(24825):    at m.fh.c(:com.google.android.gms.dynamite_mapsdynamite@233013044@23.30.13 (190400-0):8)
E/AndroidRuntime(24825):    at com.google.maps.api.android.lib6.streetview.camera.i.g(:com.google.android.gms.dynamite_mapsdynamite@233013044@23.30.13 (190400-0):316)
E/AndroidRuntime(24825):    ... 9 more
W/ing.development(24825): Accessing hidden field Landroid/os/Message;->next:Landroid/os/Message; (unsupported, reflection, allowed)
BalaSundar009 commented 11 months ago

same here..

foxide123 commented 10 months ago

Same. Tried to run the example application but get this error. Overriding onStreetViewPanoramaChange and catching the exception doesn't help.

liorboyango commented 10 months ago

That's an sdk issue, see here: https://issuetracker.google.com/issues/222232904

And BTW, if you set initPanoId instead of initPos it won't crash - not very useful but perhaps it might help someone

liorboyango commented 10 months ago

I made a fork with a fix, hope it helps:

  flutter_google_street_view:
    git:
      url: https://github.com/liorboyango/flutter_street_view.git
      path: flutter_google_street_view
      ref: master
yishaiSilver commented 6 months ago

I am also having this issue. Adding the above to my pubspec.yaml gives the following issue. Any help would be appreciated:


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_google_street_view:compileDebugJavaWithJavac'.
> error: invalid source release: 17

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

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

BUILD FAILED in 8s```
Nicoeevee commented 6 months ago

I am also having this issue. Adding the above to my pubspec.yaml gives the following issue. Any help would be appreciated:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_google_street_view:compileDebugJavaWithJavac'.
> error: invalid source release: 17

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

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

BUILD FAILED in 8s```

Same issue here when build with Codemagic

lazytesting commented 3 months ago

@liorboyango would it be possible to merge your fork and publish a new release to pub.dev?

liorboyango commented 1 month ago

I am also having this issue. Adding the above to my pubspec.yaml gives the following issue. Any help would be appreciated:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_google_street_view:compileDebugJavaWithJavac'.
> error: invalid source release: 17

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

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

BUILD FAILED in 8s```

Set your Android env to use Java17