Skip to content

Error at Build Stage #487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IyiKuyoro opened this issue Jan 11, 2021 · 10 comments
Closed

Error at Build Stage #487

IyiKuyoro opened this issue Jan 11, 2021 · 10 comments

Comments

@IyiKuyoro
Copy link

IyiKuyoro commented Jan 11, 2021

Error Running

Hi, I just installed the latest version of this package 1.1.1, and the build step fails with the following error below when I try to run flutter.

Error

../../flutter/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.1.1/lib/src/chewie_player.dart:99:17: Error: The method
'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) as _ChewieAudioControllerProvider;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Use Case

Scaffold(
          body: Column(
            children: <Widget>[
              ...,
              Expanded(
                child: ListView(
                  children: [
                    Container(
                      ...,
                      child: Html(
                        data: event.description,
                      ),
                    ),
                    ...,
                  ],
                ),
              ),
            ],
          ),
        );

I tried out some of the older versions and found out that 0.11.1 works. Perhaps there are some configuration steps I am missing? Any help will be appreciated.

Other Info

Last Working Version: 0.11.1
Flutter Channel: master
Flutter version: 1.26.0-2.0.pre.283
Dart Version: 2.12.0

@IyiKuyoro IyiKuyoro changed the title Error at Build Stage ` Error at Build Stage Jan 11, 2021
@abdalmonem
Copy link

same error , any solve ?

@IyiKuyoro
Copy link
Author

Hi @abdalmonem

If you need to use it urgently, you can try version 0.11.1

@erickok
Copy link
Contributor

erickok commented Jan 13, 2021

Which Flutter version are you on? And do you include a custom chewie version? flutter_html depends on a recent chewie version which depends on a somewhat recent Flutter version.

@HelloWorldImW
Copy link

same error!
My Flutter version is 1.26.0-2.0.pre.275
The error appears as follows:

../../../.pub-cache/hosted/pub.flutter-io.cn/chewie_audio-1.1.1/lib/src/chewie_player.dart:99:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) as _ChewieAudioControllerProvider;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

../../../.pub-cache/hosted/pub.flutter-io.cn/chewie_audio-1.1.1/lib/src/chewie_player.dart:99:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.
        context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) as _ChewieAudioControllerProvider;

                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.flutter-io.cn/chewie_audio-1.1.1/lib/src/chewie_player.dart:99:17: Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../../../flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.

        context.inheritFromWidgetOfExactType(_ChewieAudioControllerProvider) as _ChewieAudioControllerProvider;
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I used version 0.11.1 and no error was reported

@IyiKuyoro
Copy link
Author

IyiKuyoro commented Jan 13, 2021

Thanks for the reply @erickok

I use:

Flutter version: 1.26.0-2.0.pre.283
Dart Version: 2.12.0

I did not install a custom version of chewie but I can see that it was installed in pubspec.lock. Here is the version that was installed.

chewie:
    dependency: transitive
    description:
      name: chewie
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.12.1+1"
chewie_audio:
  dependency: transitive
  description:
    name: chewie_audio
    url: "https://pub.dartlang.org"
  source: hosted
  version: "1.1.1"

@erickok
Copy link
Contributor

erickok commented Jan 13, 2021

I think chewie is incompatible with flutter 1.26. I'll see if I can check that. But it'll be tomorrow at the earliest.

@erickok
Copy link
Contributor

erickok commented Jan 15, 2021

Hmm 1.26 is not released yet, is it? I am a bit hesitant to upgrade my local Flutter to 1.26 just to test this. I will try to do so in due time (or try to set up a separate Flutter install).

@spydx
Copy link

spydx commented Jan 15, 2021

@erickok Chewie_audio is incompatible with 1.26. (I'm using it 1.26)

~/.pub-cache/hosted/pub.dartlang.org/chewie_audio-1.1.1 ⮀ flutter --version 
Flutter 1.26.0-2.0.pre.343 • channel master • https://github.com/flutter/flutter.git

There is a pull request fixing the issue on chewie_audio so it will be working on flutter 1.26.

Sub6Resources/chewie_audio#10
I applied this fix manually and chewie_audio didn't kill my build.

Would be nice if this fix is applied to chewie_audio so my builds on 1.26 dosen't fail anymore :)

@jlubeck
Copy link

jlubeck commented Jan 29, 2021

Looks like Sub6Resources/chewie_audio#10 has already been merged but they haven't created a new release yet. Will we need a new release of flutter_html as well once they have theirs? Thank you!

@erickok
Copy link
Contributor

erickok commented Feb 8, 2021

chewie_audio 1.1.2 was released, so I'll close this, but see #528 for a discussion on other work required to be compatible with Flutter 1.26.

@erickok erickok closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants