Closed vbuberen closed 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 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.
This PR mainly addresses and closes #32
Changes:
middleware()
from Segment Android with suggesteduseSourceMiddleware()
registerWith()
as it is also deprecated and was needed only when Flutter Embedding V1 was used, while the plugin already switched to V2, so register will happen automatically.userSourceMiddleware()
, etc.methodChannel
inonDetachFromEngine
as it should be done.7.2.1
as it was a hotfix for7.2.0
jcenter
.