Skip to content

Commit

Permalink
Fix crash android dispose nullpointerdereference (maplibre#203)
Browse files Browse the repository at this point in the history
Fix issue maplibre#182

---------

Co-authored-by: m0nac0 <58807793+m0nac0@users.noreply.github.com>
  • Loading branch information
2 people authored and JanikoNaber committed Aug 23, 2023
1 parent 0e29641 commit 8eec27b
Show file tree
Hide file tree
Showing 18 changed files with 605 additions and 158 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/flutter_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request, workflow_dispatch]

env:
FLUTTER_CHANNEL: 'stable'
FLUTTER_VERSION: '2.10.5'
FLUTTER_VERSION: '3.7.7'

jobs:
format:
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ buildTypes {
}
```

## Flutter 3.x.x issues
Since Flutter 3.x.x was introduced, it exposed some race conditions resulting in occasional crashes upon map disposal. The parameter `useDelayedDisposal` was introduced as a workaround for this issue until Flutter and/or Maplibre fix this issue properly. Use with caution.



### iOS app crashes on startup

Please include the `NSLocationWhenInUseUsageDescription` as described [here](#location-features)
Expand Down
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 31
ndkVersion "20.1.5948944"
ndkVersion "21.1.6352462"

lintOptions {
disable 'InvalidPackage'
Expand All @@ -35,7 +35,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.mapbox.mapboxglexample"
minSdkVersion 20
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
1 change: 0 additions & 1 deletion example/lib/line.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
1 change: 0 additions & 1 deletion example/lib/place_fill.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
1 change: 0 additions & 1 deletion example/lib/place_source.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// found in the LICENSE file.

import 'dart:async';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down
4 changes: 2 additions & 2 deletions example/lib/place_symbol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import 'dart:async'; // ignore: unnecessary_import
import 'dart:core';
import 'dart:math';
import 'dart:typed_data';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -113,7 +112,8 @@ class PlaceSymbolBodyState extends State<PlaceSymbolBody> {
return iconImage == 'customFont'
? SymbolOptions(
geometry: geometry,
iconImage: 'custom-marker', //'airport-15',
iconImage: 'custom-marker',
//'airport-15',
fontNames: ['DIN Offc Pro Bold', 'Arial Unicode MS Regular'],
textField: 'Airport',
textSize: 12.5,
Expand Down
2 changes: 0 additions & 2 deletions example/lib/util.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:typed_data';

import 'package:flutter/services.dart';
import 'package:maplibre_gl/mapbox_gl.dart';

Expand Down
Loading

0 comments on commit 8eec27b

Please sign in to comment.