Error while trying to look at the StreamChat example

164 Views Asked by At

This is the flutter error i get when trying to run the stream chat flutter example

All dependencies are fully updated and flutter is fully up to date

Get java version from JAVA_HOME: C:\Program Files\Android\Android Studio1\jbr
The photo_manager java version is 17
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/photo_manager-2.8.1/lib/src/internal/image_provider.dart:71:5: Error: Type 'DecoderCallback' not found.
    DecoderCallback decode, // ignore: deprecated_member_use
    ^^^^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/photo_manager-2.8.1/lib/src/internal/image_provider.dart:96:5: Error: Type 'DecoderCallback' not found.
    DecoderCallback decode, // ignore: deprecated_member_use
    ^^^^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/photo_manager-2.8.1/lib/src/internal/image_provider.dart:71:5: Error: 'DecoderCallback' isn't a type.
    DecoderCallback decode, // ignore: deprecated_member_use
    ^^^^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/photo_manager-2.8.1/lib/src/internal/image_provider.dart:96:5: Error: 'DecoderCallback' isn't a type.
    DecoderCallback decode, // ignore: deprecated_member_use
    ^^^^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/stream_chat_flutter-7.0.2/lib/src/bottom_sheets/stream_channel_info_bottom_sheet.dart:324:1: Error: Expected 0 type arguments.
PersistentBottomSheetController<T> showChannelInfoBottomSheet<T>({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/stream_chat_flutter-7.0.2/lib/src/bottom_sheets/stream_channel_info_bottom_sheet.dart:339:5: Error: Expected 0 type arguments.
    showBottomSheet<T>(
    ^
/C:/TPA%20Mobile%20App/flutter/packages/flutter/lib/src/material/bottom_sheet.dart:1327:33: Context: Found this candidate, but the arguments don't match.
PersistentBottomSheetController showBottomSheet({
                                ^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script 'C:\TPA Mobile App\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1419

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\TPA Mobile App\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 8s
Error: Gradle task assembleDebug failed with exit code 1
2

There are 2 best solutions below

2
Pratik Lakhani On

TRY THIS:

Copy contents of this folder:

C:\Program Files\Android\Android Studio\jbr

into this folder:

C:\Program Files\Android\Android Studio\jre

and you're good.

If it's helpful to you, then accept the answer and don't forget to upvote.

0
Md. Yeasin Sheikh On

Current stream_chat_flutter is incompatible with v3.19. You can check out this issue

You can use his forked, or I have changed locally on >packages/stream_chat_flutter/lib/src/bottom_sheets/stream_channel_info_bottom_sheet.dart

PersistentBottomSheetController  showChannelInfoBottomSheet ({
  required BuildContext context,
  required Channel channel,
  Color? backgroundColor,
  double? elevation,
  BoxConstraints? constraints,
  AnimationController? transitionAnimationController,
  Clip? clipBehavior = Clip.hardEdge,
  ShapeBorder? shape = _kDefaultChannelInfoBottomSheetShape,
  void Function(Member)? onMemberTap,
  VoidCallback? onViewInfoTap,
  VoidCallback? onLeaveChannelTap,
  VoidCallback? onDeleteConversationTap,
  VoidCallback? onCancelTap,
}) =>
    showBottomSheet(