Skip to content

Gradle build failed to produce an .apk file #45346

@ThomasValois

Description

@ThomasValois

Error Message

Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\...\build, but the tool couldn't find it.

Issue

I've tried moving my Flutter app to AndroidX after it kept prompting me but after doing so the above error message keeps appearing and now I can't even run my app. Any assistance on what can be done for this?

Tried

  • Flutter clean
  • New emulator
  • Disabling AndroidX (doesn't work)

Flutter Doctor --verbose

[√] Flutter (Channel master, v1.12.6-pre.15, on Microsoft Windows [Version 10.0.18363.476], locale en-GB)
    • Flutter version 1.12.6-pre.15 at C:\Android\flutter
    • Framework revision 43a8a1902e (5 hours ago), 2019-11-21 12:09:43 +0100
    • Engine revision 7a77e3625d
    • Dart version 2.7.0
 


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Android\
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = C:\Android
    • ANDROID_SDK_ROOT = C:\Android\sdk
    • Java binary at: C:\Android\openjdk\bin\java
    • Java version OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_202-b08)
    • All Android licenses accepted.

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[√] VS Code (version 1.40.1)
    • VS Code at C:\Users\tvalois\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.6.0

[√] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

Full Issue

The plugin "cloud_firestore" is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an existing app as a module.
The plugin can be updated to the v2 Android Plugin APIs by following 
https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on Android SDK built for x86 in debug mode...

Note: C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.10+2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-0.12.10+2\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_analytics-5.0.6\android\src\main\java\io\flutter\plugins\firebaseanalytics\FirebaseAnalyticsPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.4.1+5\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses or overrides a deprecated API.

Gradle build failed to produce an .apk file. It's likely that this file was generated under C:\Users\...\build, but the tool couldn't find it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions