[sensors_plus][android] Compilation fails - Redeclaration: StreamHandlerImpl
e: ~/.pub-cache/hosted/pub.dartlang.org/sensors_plus-1.3.2/android/src/main/kotlin/dev/fluttercommunity/plus/sensors/StreamHandlerImpl.kt: (10, 16): Redeclaration: StreamHandlerImpl
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sensors_plus:compileDebugKotlin'.
> Compilation error. See log for more details
1.3.1 works.
1.3.2 does not.
Please use the Bug template to fill a bug report and include all the information in it
@lahdekorpi please run flutter clean and then it will be OK now.
Actually from my one-day research, this may be a bug of Kotlin incremental compilation. Because I find this will never happen if you turn-off the Kotlin incremental compilation function .
But turning-off the incremental compilation is not a good solution. So just do flutter clean when it occurs.
@androidyue flutter clean didn't work for me, but defining a dependency override for sensors_plus to 1.3.1 did. And i even have no sensors_plus in my deps, it's a transitive dependency
dependency_overrides:
sensors_plus: 1.3.1
In my case, using flutter clean fixes the issue, while using overriden version of 1.3.2 for sensors_plus. Hope it helps @lavinov-mercury
dependency_overrides:
sensors_plus: 1.3.2
In my case, using flutter clean fixes the issue, while using overriden version of 1.3.2 for sensors_plus. Hope it helps @lavinov-mercury
dependency_overrides: sensors_plus: 1.3.2
This fixed my issue. Thanks!
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days