firebase_admob error The built failed likely due to AndroidX incompatibilities in a plugin

464 views Asked by At

Error appears when performing

flutter build apk --release
and
flutter build apk

There is no error when I build the APK without having the firebase_admob

The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility. Building plugin firebase_admob... The plugin firebase_admob could not be built due to the issue above.

enter image description here

I have performed

flutter doctor --android-licenses

flutter clean

The error still appears.

Below is the flutter doctor -v result

    [√] Flutter (Channel stable, 1.20.4, on Microsoft Windows [Version 10.0.18362.1082], locale en-US)
    • Flutter version 1.20.4 at D:\work\flutter
    • Framework revision fba99f6cf9 (2 weeks ago), 2020-09-14 15:32:52 -0700
    • Engine revision d1bc06f032
    • Dart version 2.9.2

 
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at D:\work\AndroidSDK
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = D:\work\AndroidSDK
    • ANDROID_SDK_ROOT = D:\work\AndroidSDK
    • Java binary at: D:\aplikasi\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[√] Android Studio (version 4.0)
    • Android Studio at D:\aplikasi\Android Studio
    • Flutter plugin version 49.0.2
    • Dart plugin version 193.7547
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (1 available)
    • AOSP on IA Emulator (mobile) • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!

Pubspec.yaml version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  intl: ^0.16.0
  sqflite:  "^0.11.0+1"
  flutter_launcher_icons: "^0.8.0"
  image_picker: "0.6.1"
  path_provider: ^1.6.16
  path: ^1.7.0
  provider: ^4.0.1  
  date_util: ^0.1.4
  auto_size_text: ^2.1.0
  flutter_masked_text: ^0.7.0
  font_awesome_flutter: ^8.8.1
  firebase_admob: ^0.9.0+9

flutter_icons:
  android: "launcher_icon" 
  ios: true
  image_path: "assets/icon/penqu.png"

  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter


module:
  androidX: true
1

There are 1 answers

0
Agustinus Biotamalo Lumbantoru On

I managed to fix the issue using different package version and add firebase_core.

  firebase_admob: ^0.9.0+9

Then I made change to the gradle.properties file as follow The change was gradle-4.10.2-all.zip to gradle-5.1.1-all.zip

why?

cuz it appears in the error message.

#Thu Nov 01 21:03:34 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip