skip to Main Content

I recently experienced a driver issue and while troubleshooting it I wiped my computer and reset my development environment, however I now get the following errors after trying to build my app on android.

C:UserscianrAppDataLocalPubCachehostedpub.devfirebase_messaging-14.7.10androidsrcmainjavaioflutterpluginsfirebasemessagingFlutterFirebaseMessagingPlugin.java:389: error: cannot find symbol
            .checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS)
                                                    ^
  symbol:   variable POST_NOTIFICATIONS
  location: class permission
C:UserscianrAppDataLocalPubCachehostedpub.devfirebase_messaging-14.7.10androidsrcmainjavaioflutterpluginsfirebasemessagingFlutterFirebasePermissionManager.java:63: error: cannot find symbol
    permissions.add(Manifest.permission.POST_NOTIFICATIONS);
                                       ^
  symbol:   variable POST_NOTIFICATIONS
  location: class permission

After seeing this error I reverted back to a previous working branch via git and still got the same error, then i removed the firebase messaging plugin from my pubspec.yaml file and all the code that goes along with it, there after I got the following error message leading me to think its an issue with my environment.

I re-setup my environment in the following manner (windows)

  1. setup git
  2. downloaded android studio and the cli tools
  3. downloaded vscode and enabled flutter and dart plugins
  4. downloaded the flutter zip file and extracted it to C:src
  5. added flutter to environment variables
  6. downloaded jdk 17
  7. added JAVA_HOME to both system and user variables

My flutter doctor:

PS C:Userscianr> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.5, on Microsoft Windows [Version 10.0.22631.2861], locale en-ZA)
[✓] Windows Version (Installed version of Windows is version 10 or higher)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[!] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.3)
    ✗ Visual Studio is missing necessary components. Please re-run the Visual Studio installer for the "Desktop
      development with C++" workload, and include these components:
        MSVC v142 - VS 2019 C++ x64/x86 build tools
         - If there are multiple build tool versions available, install the latest
        C++ CMake tools for Windows
        Windows 10 SDK
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (3 available)
[✓] Network resources

! Doctor found issues in 1 category.
PS C:Userscianr>

Any help with this issue would be greatly appreciated!

Note: Recompile with -Xlint:deprecation for details.
C:UserscianrAppDataLocalPubCachehostedpub.devpermission_handler_android-12.0.1androidsrcmainjavacombaseflowpermissionhandlerPermissionUtils.java:56: error: cannot find symbol
            case Manifest.permission.BODY_SENSORS_BACKGROUND:
                                    ^
  symbol:   variable BODY_SENSORS_BACKGROUND
  location: class permission
C:UserscianrAppDataLocalPubCachehostedpub.devpermission_handler_android-12.0.1androidsrcmainjavacombaseflowpermissionhandlerPermissionUtils.java:85: error: cannot find symbol
            case Manifest.permission.POST_NOTIFICATIONS:
                                    ^
  symbol:   variable POST_NOTIFICATIONS
  location: class permission

How can i fix this?

2

Answers


  1. Chosen as BEST ANSWER

    Update: Doing a clean install of windows solved the problem, must've had something to do with the old files that were kept on my computer causing problems.


  2. Perhaps when you modified your setup, you also altered the Android version used for compilation, leading to changes in the process of permissions. Take a look at this Stack Overflow question, it might provide some useful insights :
    Can not find Symbol Manifest.permission.WRITE_EXTERNAL_STORAGE on v23

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search