osmandapp / osmand-api-demo

Example of usage OsmAnd API
89 stars 43 forks source link

map-sample crashes #67

Closed moiatto closed 1 year ago

moiatto commented 1 year ago

With master-snapshot dependences the Map Sample crashes when you touch on the map (Simple Map, Navigate Map).

implementation "net.osmand:OsmAnd-java:master-snapshot:android@jar"
debugImplementation "net.osmand:OsmAnd:master-snapshot:debug@aar"
releaseImplementation "net.osmand:OsmAnd:master-snapshot:release@aar"
implementation "net.osmand:OsmAndCore_androidNativeRelease:master-snapshot@aar"
implementation "net.osmand:OsmAndCore_android:master-snapshot@aar"

If I use 4.4 dependences it works correctly.

implementation "net.osmand:OsmAnd-java:4.4:android@jar"
debugImplementation "net.osmand:OsmAnd:4.4:debug@aar"
releaseImplementation "net.osmand:OsmAnd:4,4:release@aar"
implementation "net.osmand:OsmAndCore_androidNativeRelease:4.4@aar"
implementation "net.osmand:OsmAndCore_android:4.4@aar"

FATAL EXCEPTION: main Process: net.osmand.library.sample, PID: 29484 java.lang.NullPointerException: Attempt to invoke virtual method 'net.osmand.plus.views.MapLayers net.osmand.plus.activities.MapActivity.getMapLayers()' on a null object reference at net.osmand.plus.views.OsmandMapTileView.onTouchEvent(OsmandMapTileView.java:1674) at net.osmand.plus.views.OsmAndMapLayersView.onTouchEvent(OsmAndMapLayersView.java:74) at android.view.View.dispatchTouchEvent(View.java:15199) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3920) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:3535) at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:913) at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1957) at android.app.Activity.dispatchTouchEvent(Activity.java:4182) at androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:70) at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:871) at android.view.View.dispatchPointerEvent(View.java:15458) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7457) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7233) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6595) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6652) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6618) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6786) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6626) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6843) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6599) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6652) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6618) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6626) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6599) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9880) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9718) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9671) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:10014) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:220) at android.os.MessageQueue.nativePollOnce(Native Method) at android.os.MessageQueue.next(MessageQueue.java:335) at android.os.Looper.loop(Looper.java:206) at android.app.ActivityThread.main(ActivityThread.java:8645) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

vshcherb commented 1 year ago

Same as https://github.com/osmandapp/osmand-api-demo/issues/60