Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Issue after updating with the flutter_image_compress dependency #18

Closed
xJon opened this issue Jul 28, 2020 · 5 comments
Closed

Issue after updating with the flutter_image_compress dependency #18

xJon opened this issue Jul 28, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@xJon
Copy link

xJon commented Jul 28, 2020

After updating from 0.1.13 to 0.1.14, the flutter_image_compress dependency also seemed to update from 0.6.8 to 0.7.0.
Trying to compile, I get this error message:

e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.6.8\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (15, 7): Redeclaration: FlutterImageCompressPlugin
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.6.8\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (18, 7): Redeclaration: CompressFileHandler
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.6.8\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (14, 7): Redeclaration: CompressListHandler
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.6.8\android\src\main\kotlin\com\example\flutterimagecompress\core\ResultHandler.kt: (7, 16): Redeclaration: ResultHandler
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (17, 7): Redeclaration: FlutterImageCompressPlugin
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (25, 47): No value passed for parameter 'registrar'
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (26, 14): Unresolved reference: channel
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (27, 14): Unresolved reference: context
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (28, 14): Unresolved reference: channel
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (44, 70): Type mismatch: inferred type is Context but PluginRegistry.Registrar was expected
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (45, 70): Type mismatch: inferred type is Context but PluginRegistry.Registrar was expected
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\FlutterImageCompressPlugin.kt: (46, 87): Type mismatch: inferred type is Context but PluginRegistry.Registrar was expected
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (14, 7): Redeclaration: CompressFileHandler
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (17, 5): Unresolved reference: threadPool
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (65, 5): Unresolved reference: threadPool
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (13, 7): Redeclaration: CompressListHandler
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (16, 5): Unresolved reference: threadPool
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\ResultHandler.kt: (9, 16): Redeclaration: ResultHandler

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_image_compress:compileDebugKotlin'.
> Compilation error. See log for more details

After trying to manually delete the old package versions from .pub-cache, I get this:

e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (7, 48): Unresolved reference: log
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (32, 9): Unresolved reference: log
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressFileHandler.kt: (91, 9): Unresolved reference: log
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (8, 48): Unresolved reference: log
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (39, 9): Unresolved reference: log
e: C:\Flutter\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_image_compress-0.7.0\android\src\main\kotlin\com\example\flutterimagecompress\core\CompressListHandler.kt: (51, 9): Unresolved reference: log

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_image_compress:compileDebugKotlin'.
> Compilation error. See log for more details

Any idea what's going wrong? For now I've reverted the versions and it launches fine.
My flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.19041.388], locale en-AU)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0-rc4)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.45.1)
[√] Connected device (1 available)

• No issues found!
@humblerookie
Copy link
Owner

humblerookie commented Jul 28, 2020

Seems to be this issue fluttercandies/flutter_image_compress#69. Can you check if any of those solutions work for you?

If you look closely in your log it seems like the default cache has both versions 0.6.8 and 0.7.0 included. so clearing the entire cache must work.

Nvm my bad I skipped your other message, can you try deleting the newer one as well and just downloading it again. I feel like this most likely is a cache issue so flutter clean might help. Let me know if it doesn't work.

@hikmawanaz
Copy link

i have same issue, any idea to fix this?
i have tried flutter clean and delete pub-spec cache but still get same error

@xJon
Copy link
Author

xJon commented Aug 4, 2020

Hi @humblerookie, deleting both from the cache didn't work.

@hikmawanaz
Copy link

I think this is issue from package flutter_image_compress 0.7.0, i have tried that package sparetly than the same error occured.
Maybe someone wanna create issue about this in flutter_image_compress repository

@humblerookie humblerookie self-assigned this Aug 7, 2020
@humblerookie humblerookie added the bug Something isn't working label Aug 7, 2020
@humblerookie
Copy link
Owner

Closing this due to inactivity and not able to reproduce this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants