fluttercommunity/flutter_google_places

Example Build Failed on Android

samueladekunle opened this issue · 1 comments

I tried to compile the app in the example/ directory.

This is what I got in the console:

Launching lib\main.dart on Infinix X572 in debug mode...
[!] Your app isn't using AndroidX.
    To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:83: error: resource android:attr/fontStyle not found.
  C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:84: error: resource android:attr/font not found.
  C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:85: error: resource android:attr/fontWeight not found.
  C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:86: error: resource android:attr/fontVariationSettings not found.
  C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:87: error: resource android:attr/ttcIndex not found.
  error: failed linking references.
  Command: C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\845586be07365f07db830e1e0ccdc821\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Samuel\AppData\Local\Android\sdk\platforms\android-25\android.jar\
          --manifest\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.yourcompany.example\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\core-1.1.0.aar\93f84ab4c91409297a5272d2630b30c8\res\values\values.xml:174:5-210:25: AAPT: error: resource android:attr/fontStyle not found.

  C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\core-1.1.0.aar\93f84ab4c91409297a5272d2630b30c8\res\values\values.xml:174:5-210:25: AAPT: error: resource android:attr/font not found.

  C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\core-1.1.0.aar\93f84ab4c91409297a5272d2630b30c8\res\values\values.xml:174:5-210:25: AAPT: error: resource android:attr/fontWeight not found.

  C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\core-1.1.0.aar\93f84ab4c91409297a5272d2630b30c8\res\values\values.xml:174:5-210:25: AAPT: error: resource android:attr/fontVariationSettings not found.
  C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\core-1.1.0.aar\93f84ab4c91409297a5272d2630b30c8\res\values\values.xml:174:5-210:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: C:\Users\Samuel\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\845586be07365f07db830e1e0ccdc821\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Samuel\AppData\Local\Android\sdk\platforms\android-25\android.jar\
          --manifest\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.yourcompany.example\
          -0\
          apk\
          --output-text-symbols\
          C:\Users\Samuel\AndroidStudioProjects\samples\templates\flutter_google_places\example\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
BUILD FAILED in 32s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

This is the output of Flutter doctor -v

[√] Flutter (Channel stable, v1.17.1, on Microsoft Windows [Version 10.0.18363.836], locale en-NG)     
    • Flutter version 1.17.1 at C:\Development\flutter
    • Framework revision f7a6a7906b (2 weeks ago), 2020-05-12 18:39:00 -0700
    • Engine revision 6bc433c6b6
    • Dart version 2.8.2

 
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at C:\Users\Samuel\AppData\Local\Android\sdk
    • Platform android-29, build-tools 29.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.45.1)
    • VS Code at C:\Users\Samuel\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.10.2

[√] Connected device (1 available)
    • Infinix X572 • 10.6.116.146:5555 • android-arm64 • Android 8.1.0 (API 27)

I solved the issue, by increasing the compileSdkVerion to 28.

Inside example/android/app/build.gradle, change

android {
  compileSdkVersion 25

to

android {
  compileSdkVersion 28