6

I updated dependencies by dart pub upgrade, but here i thought due to some cache already there causing this error. i have tried dart clean cache but problem is still there. kindly take this issue underconsideration problem statement is mentioned below. It seems like my uuid class can't extend umodifiableuint8listview but class is not even present in the code

**../../flutter/.pub-cache/hosted/pub.dartlang.org/uuid_enhanced-3.0.2/lib/uuid.dart:9:7: Error: 'UnmodifiableUint8ListView' is restricted and can't be extended or implemented.
class Uuid extends UnmodifiableUint8ListView {
      ^**
2

FAILURE: Build failed with an exception.

* Where:
Script 'C:\Users\hp\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1005

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\hp\Documents\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 54s
Exception: Gradle task assembleDebug failed with exit code 1
James Z
  • 12,209
  • 10
  • 24
  • 44
Usama Yousaf
  • 83
  • 1
  • 4
  • Try this out! https://stackoverflow.com/questions/61930007/how-to-solve-execution-failed-for-task-appcompileflutterbuilddebug – Trần Trung Hiếu Oct 01 '21 at 14:09
  • According to the repo, v3 had some breaking changes https://github.com/truongsinh/dart-uuid Do you use uuid directly? – tim_yates Oct 01 '21 at 14:18
  • try `flutter pub cache repair` – intraector Oct 01 '21 at 15:17
  • Hey thanks all for suggestion but i have tried all the methods above its look like flutter is pointing to the cache folder which didn't even exist in folders path – Usama Yousaf Oct 04 '21 at 07:04
  • Ok so here I did some research on my own and in Pub\Cache\hosted\pub.dartlang.org\uuid_enhanced-3.0.2\lib\uuid.dart. The code is `class Uuid extends UnmodifiableUint8ListView` and the error shown there is `Classes can't extend 'UnmodifiableUint8ListView`'. So I tried to remove this version of uuid as I have another version in the cache folder, but it can't be deleted and my code shows the error above with `Execution failed for task 'app:compileFlutterBuildDebug'`. Can someone kindly tell me what dart version exactly allows `uint8lv` as extended class? Thanks! – Usama Yousaf Oct 04 '21 at 10:07
  • Same error here. Trying to build the project for iOS 15. Have you still figured it out yet? – Leon Schwanitz Oct 07 '21 at 20:05
  • Do you use graphql_flutter? – Leon Schwanitz Oct 08 '21 at 20:30
  • @LeonSchwanitz Yes! i know its not a actual solution but flutter was using uuid enhanced because of its upgraded version in cache i downgraded it ,and its works just fine by using lower version of uuid in which we don't have restriction to extend uuid with uint8listview – Usama Yousaf Oct 09 '21 at 19:08
  • @UsamaYousaf Can you please explain what you did to solve this issue? everytime I removed uuid from cache it downloads the same version. Also, Which flutter version and you using? Spent hours to solve this but this error is not going. – CodeGeek Mar 10 '22 at 13:10
  • Hey @CodeGeek actually this issues occurs to me was 5 months ago ,first try to delete and repair the dart cache instead of Flutter clean https://dart.dev/tools/pub/cmd/pub-cache if you have already tried this issue ....if possible you can downgrade to previous version of flutter in which issues was not existed (or you can use flutter fvm for this purpose) i don't remember exactly which version of flutter i was using that time. – Usama Yousaf Mar 11 '22 at 05:36
  • I tried downgrading to 2.5.2 also but still that issue is not going. I tried to delete ./pub_cache file but then again uuid_enhanced get downloaded. I tried to remove it from pubspec.lock file too. Can you check and let me know your pubspec.lock file also how you actually downgraded just uuid library and if you can check your flutter version will be very helpful – CodeGeek Mar 11 '22 at 08:22

0 Answers0