Comments (4)
@paulVulog thank you for reporting, I will transfer this ticket to the appropriate repo.
from mapbox-gl-native-android.
@ZiZasaurus any status on this ? It is really impacting. Where did you transfer this issue to ?
from mapbox-gl-native-android.
Hi, similiar backtrace here appxmod/diodict-decompiled@7199009
If I filter out ACTION_POINTER_DOWN
,the native crash will become the “pointerIndex out of range” Exception:
if (actionMasked!=MotionEvent.ACTION_POINTER_DOWN) {
try {
boolean flingEvent = this.flingDetector.onTouchEvent(event);
if (flingEvent) {
// this.flingDetector = new GestureDetector(getContext(), this);
return flingEvent;
}
} catch (Exception e) {
e.printStackTrace();
}
}
from mapbox-gl-native-android.
I resolved this issue by create new Flutter Engine with custom MyPlatformViewController extend PlatformViewController
flutter/engine@991471b
MyPlatformViewController:
class MyPlatformViewsController : PlatformViewsController() {
override fun toMotionEvent(
density: Float,
touch: PlatformViewsChannel.PlatformViewTouch?,
usingVirtualDiplays: Boolean
): MotionEvent {
val motionEventId = MotionEventId.from(touch!!.motionEventId)
val trackedEvent = MotionEventTracker.getInstance().pop(motionEventId)
// Pointer coordinates in the tracked events are global to FlutterView
// framework converts them to be local to a widget, given that
// motion events operate on local coords, we need to replace these in the tracked
// event with their local counterparts.
// Pointer coordinates in the tracked events are global to FlutterView
// framework converts them to be local to a widget, given that
// motion events operate on local coords, we need to replace these in the tracked
// event with their local counterparts.
val pointerProperties = parsePointerPropertiesList(
touch!!.rawPointerPropertiesList
).toTypedArray()
val pointerCoords = parsePointerCoordsList(
touch!!.rawPointerCoords, density
)
.toTypedArray()
return if (!usingVirtualDiplays && trackedEvent != null) {
MotionEvent.obtain(
trackedEvent.downTime,
trackedEvent.eventTime,
touch!!.action,
touch!!.pointerCount,
pointerProperties,
pointerCoords,
trackedEvent.metaState,
trackedEvent.buttonState,
trackedEvent.xPrecision,
trackedEvent.yPrecision,
trackedEvent.deviceId,
trackedEvent.edgeFlags,
trackedEvent.source,
trackedEvent.flags
)
} else MotionEvent.obtain(
touch!!.downTime.toLong(),
touch!!.eventTime.toLong(),
touch!!.action,
touch!!.pointerCount,
pointerProperties,
pointerCoords,
touch!!.metaState,
touch!!.buttonState,
touch!!.xPrecision,
touch!!.yPrecision,
touch!!.deviceId,
touch!!.edgeFlags,
touch!!.source,
touch!!.flags
)
}
private fun parsePointerPropertiesList(rawPropertiesList: Any): List<PointerProperties> {
val rawProperties = rawPropertiesList as List<Any>
val pointerProperties: MutableList<PointerProperties> = java.util.ArrayList()
for (o in rawProperties) {
pointerProperties.add(parsePointerProperties(o))
}
return pointerProperties
}
private fun parsePointerProperties(rawProperties: Any): PointerProperties {
val propertiesList = rawProperties as List<Any>
val properties = PointerProperties()
properties.id = propertiesList[0] as Int
properties.toolType = propertiesList[1] as Int
return properties
}
private fun parsePointerCoordsList(rawCoordsList: Any, density: Float): List<PointerCoords> {
val rawCoords = rawCoordsList as List<Any>
val pointerCoords: MutableList<PointerCoords> = ArrayList()
for (o in rawCoords) {
pointerCoords.add(parsePointerCoords(o, density))
}
return pointerCoords
}
private fun parsePointerCoords(rawCoords: Any, density: Float): PointerCoords {
val coordsList = rawCoords as List<Any>
val coords = PointerCoords()
coords.orientation = (coordsList[0] as Double).toFloat()
coords.pressure = (coordsList[1] as Double).toFloat()
coords.size = (coordsList[2] as Double).toFloat()
coords.toolMajor = (coordsList[3] as Double * density).toFloat()
coords.toolMinor = (coordsList[4] as Double * density).toFloat()
coords.touchMajor = (coordsList[5] as Double * density).toFloat()
coords.touchMinor = (coordsList[6] as Double * density).toFloat()
coords.x = (coordsList[7] as Double * density).toFloat()
coords.y = (coordsList[8] as Double * density).toFloat()
return coords
}
}
In MainActivity (your main flutter activity):
override fun provideFlutterEngine(context: Context): FlutterEngine? {
return FlutterEngine(
context,
null,
FlutterJNI(),
MyCustomFlutterEngine(),
Companion.flutterShellArgs.toArray(),
false
)
}
from mapbox-gl-native-android.
Related Issues (20)
- Change MAPBOX_ACCESS_TOKEN on runtime HOT 1
- jcenter sunset - release code to maven HOT 3
- Incorrect TalkBack accessibility feedback when gesture interaction is disabled
- MapView sometime doesn't load the map `(failed to connect to api.mapbox.com/64:ff9b::6c9d:ba (port 443))` HOT 1
- Error when trying to display map
- Location tracking issues Android 12 HOT 1
- android 12, APP keep crashing
- Intergrate Android Auto
- Source code for mapbox-android-sdk-gl-core
- Mapbox sometimes crash, android 9
- The animation of the location component has lags when the RenderMode.COMPASS and mapbox_elevation=0dp are set
- Mapbox gets app rejected HOT 1
- Crash when using android.uid.system
- Center to user location
- PropertyFactory.lineColor not working HOT 1
- E2E Tests implementation
- SoLoader load 'mapbox-gl' with FileLockInterruptionException
- Unable to generate DOCS using javadoc in android studio
- LocationComponent crashing on Android 13 and 12 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mapbox-gl-native-android.