Coding⏱️ 3 min read📅 2026-06-04

How to Fix: Error: Member not found: 'packageRoot', how to solve ignore: deprecated_member_use in Flutter?

Flutter project error fix for deprecated_member_use and packageRoot issue.

Quick Answer: Update Flutter to the latest version, remove the deprecated line from your pubspec.yaml file, and run flutter clean and flutter pub get.

The error 'Member not found: 'packageRoot', how to solve ignore: deprecated_member_use in Flutter?' occurs when you're trying to use the `packageRoot` property, which is deprecated since AndroidX version 1.0.0.

This issue affects users who have updated their plugins and run `flutter upgrade`, causing the build process to fail due to the deprecation of the `packageRoot` property.

🛑 Root Causes of the Error

  • The primary reason for this error is that the `packageRoot` property has been deprecated since AndroidX version 1.0.0.
  • An alternative cause could be that you have updated your plugins, which may not be compatible with the current Flutter version.

✅ Best Solutions to Fix It

Update Flutter and Gradle to latest versions

  1. Step 1: Open your terminal or command prompt and navigate to your project directory.
  2. Step 2: Run `flutter upgrade` again to update Flutter to the latest version.
  3. Step 3: Then, run `gradle flutter clean` followed by `gradle flutter build` to rebuild your project.

Update plugins manually

  1. Step 1: Open your pubspec.yaml file and remove the deprecated `deprecated_member_use: true` line.
  2. Step 2: Then, run `flutter pub get` to update your dependencies.
  3. Step 3: After that, try running `flutter upgrade` again to see if the issue persists.

🎯 Final Words

To resolve this error, you can either update Flutter and Gradle to their latest versions or manually update your plugins. If you're still experiencing issues, try restarting Android Studio or your IDE, as it may be a caching issue.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions