Sarcoss
Sarcoss

Reputation: 91

Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1159

I am trying to compile my app in flutter, but when I do it, I get the following error in the console. I tried running flutter clean and then flutter pub get but it doesn't seem to work

Warning: elemento inesperado (URI:"", local:"base-extension"). Los elementos esperados son <{}codename>,<{}layoutlib>,<{}api-level> /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'. FirebaseAppPlatform.verifyExtends(_delegate); ^^^^^^^^^^^^^

FAILURE: Build failed with an exception.

Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

BUILD FAILED in 4m 16s Running Gradle task 'assembleRelease'... 262.0s Gradle task assembleRelease failed with exit code 1 `` console error

I tried running flutter clean and then flutter pub get but it doesn't seem to work

Upvotes: 4

Views: 12485

Answers (6)

DragonForce Fan
DragonForce Fan

Reputation: 1

Navigate to the dependencies section in your pubspec.yaml file and click on 'pub upgrade'. The terminal will display the latest versions of your dependencies. Update your

Firebase

packages to these new versions. I have tried it, and it works for me.

DragonForce Fan 87

Upvotes: 0

Muhammet
Muhammet

Reputation: 446

Try this:

  1. Close project.

  2. Go to project repository folder.

  3. Delete all generated files, for example:

    • .dart_tool
    • .idea
    • .build
    • .flutter-plugins
    • .flutter-plugins-dependencies
    • .metadata
    • .packages Nothing should changed in your git changes due to .gitignore file
  4. Open Android Studio again

  5. Go to File->Invalidate Caches/Restart, then invalidate caches and restart

if your project structure is corrupted go to: File -> Close Project, close project and reopen it, it should be back to normal.

  1. Run all the necessary scripts starting with:
  • flutter pub get

  • dart pub get

Upvotes: 0

Oskar Gąsior
Oskar Gąsior

Reputation: 11

I had macOS Monterey and upgrade to Ventrua worked for me.

Upvotes: 1

Go to dependencies in pubspec.yaml and click on 'pub upgrade' ... the last versions of dependencies will appear in terminal ... increase your firebase packages to the new versions ... I try it and it works with me

This answer work with me too.

Upvotes: -1

Go to dependencies in pubspec.yaml and click on 'pub upgrade' ... the last versions of dependencies will appear in terminal ... increase your firebase packages to the new versions ... I try it and it works with me.

Upvotes: 3

danPyk
danPyk

Reputation: 671

According to this - https://github.com/firebase/flutterfire/issues/9814 it's a problem with dependencies.

In my case I have first added old firebase_core dependencies and then overridden them to newest ones, but Android Studio did not delete old dependencies. I have deleted the build folder from the main project folder, then I downloaded dependencies again in pubspec.yaml and code started working.

Upvotes: 0

Related Questions