Skip to content
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

[Android] cannot access ViewTreeObserver #100

Open
zp1ke opened this issue Jan 5, 2022 · 4 comments
Open

[Android] cannot access ViewTreeObserver #100

zp1ke opened this issue Jan 5, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@zp1ke
Copy link

zp1ke commented Jan 5, 2022

Describe the bug
Having this error compiling the project on Android:

android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java:39: error: cannot access ViewTreeObserver
      flutterEngine.getPlugins().add(new com.jrai.flutter_keyboard_visibility.FlutterKeyboardVisibilityPlugin());
                                ^
  class file for android.view.ViewTreeObserver not found
1 error

FAILURE: Build failed with an exception.

To Reproduce
Running project with Flutter 2.8 on Android.

Expected behavior
App compiles on Android.

Info (please complete the following information):
flutter_keyboard_visibility version: 5.1.0
Reproducible on platforms (Android, iOS, etc): Android
flutter doctor output:

[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [Version 10.0.22000.376], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.7)
[√] Android Studio (version 2020.3)
[√] IntelliJ IDEA Community Edition (version 2021.3)
[√] VS Code (version 1.63.2)
[√] Connected device (4 available)

• No issues found!

@zp1ke zp1ke added the bug Something isn't working label Jan 5, 2022
@MisterJimson
Copy link
Owner

Hmm unfortunately this looks like its coming from the GeneratedPluginRegistrant which Flutter is in charge of creating and maintaining. I would try deleting that file, flutter clean, flutter pub get.

If that doesn't work I would open another issue on the Flutter repo.

@zp1ke
Copy link
Author

zp1ke commented Jan 7, 2022

flutter clean, flutter pub get doesn't help. I'll try reporting on the flutter repo

@bxxasn
Copy link

bxxasn commented Oct 25, 2022

Hi, have you found a good way to deal with it. If you find it, please share it. Thank you.

中文最好

@StarOfLife
Copy link

我在build.gradle中使用 classpath 'com.android.tools.build:gradle:7.0.0' 解决

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

No branches or pull requests

4 participants