la-haus / flutter-segment

Segment.io library for flutter
MIT License
22 stars 139 forks source link

[Android] Remove deprecated APIs and fix for a few found issues #33

Closed vbuberen closed 2 years ago

vbuberen commented 2 years ago

This PR mainly addresses and closes #32

Changes:

danielgomezrico commented 2 years ago

@vbuberen I tried and on compilation it fails with:

/Users/daniel/.pub-cache/git/flutter-segment-95ad9e4b3158442f3dd78f6d0dade7b03b8a2875/android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java:90: error: lambda expressions are not supported in -source 7
              chain -> {
                    ^
  (use -source 8 or higher to enable lambda expressions)
vbuberen commented 2 years ago

@vbuberen I tried and on compilation it fails with:

/Users/daniel/.pub-cache/git/flutter-segment-95ad9e4b3158442f3dd78f6d0dade7b03b8a2875/android/src/main/java/com/example/flutter_segment/FlutterSegmentPlugin.java:90: error: lambda expressions are not supported in -source 7
              chain -> {
                    ^
  (use -source 8 or higher to enable lambda expressions)

Looks like I needed to explicitly specify in build.gradle the following block:

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

In latest Android Studio versions it is not an issue as project builds fine even without that part I mentioned above.