Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It was working fine but suddenly errors started showing and the app cant build #196

Closed
1 task done
momoDragon opened this issue Feb 19, 2019 · 8 comments
Closed
1 task done

Comments

@momoDragon
Copy link

🔙 Regression

Old (and correct) behavior

It use to work

Current behavior

now it has errors causing app not to build

Reproduction steps

use geolocator 2.1.1 to reproduce
geolocator: 2.1.1

Error given

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugResources'.

Android resource linking failed
Output: C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:37: error: resource android:attr/fontVariationSettings not found.
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:37: error: resource android:attr/ttcIndex not found.
error: failed linking references.

Command: C:\Users\xinyo.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\2a2ea7ba6c975c3f1479534f6a6ff44d\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
C:\Users\xinyo\AppData\Local\Android\sdk\platforms\android-27\android.jar
--manifest
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
-o
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
-R
@C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
--auto-add-overlay
--java
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
--proguard-main-dex
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt
--custom-package
mycompany.com.foodpluslifevendor
-0
apk
--output-text-symbols
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\symbols\debug\R.txt
--no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
Output: C:\Users\xinyo.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\cd1c893af6eacddadb6fccbcbd5362d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\xinyo.gradle\caches\transforms-1\files-1.1\core-1.0.1.aar\cd1c893af6eacddadb6fccbcbd5362d3\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.
Command: C:\Users\xinyo.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\2a2ea7ba6c975c3f1479534f6a6ff44d\aapt2-3.2.1-4818971-windows\aapt2.exe link -I
C:\Users\xinyo\AppData\Local\Android\sdk\platforms\android-27\android.jar
--manifest
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml
-o
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_
-R
@C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt
--auto-add-overlay
--java
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r
--proguard-main-dex
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\build\app\intermediates\legacy_multidex_aapt_derived_proguard_rules\debug\processDebugResources\manifest_keep.txt
--custom-package
mycompany.com.foodpluslifevendor
-0
apk
--output-text-symbols
C:\Users\xinyo\Documents\GitLab\food-plus-life-vendor\food_plus_life_vendor\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 7s
Finished with error: Gradle task assembleDebug failed with exit code 1

Configuration

Version: 1.x
2.1.1

Platform:

  • [?] 📱 iOS
  • 🤖 Android
@ariG23498
Copy link

i have the same error, any updates on that?

@momoDragon
Copy link
Author

no idea fam. Hope this gets fixed asap.

@mvanbeusekom
Copy link
Member

@momoDragon, @ariG23498, have you already tried the latest version (3.0.0)?

It looks like you have (partly) updated your project to support AndroidX (compileSdkVersion 28). Version 2.1.1 of the plugin does not support AndroidX which has been resolved in version 3.0.0.

@althex2015
Copy link

althex2015 commented Feb 20, 2019

Same problem here.

Is there anyway use back version 2.1.1 or non support AndroidX version?
I using flutter_facebook_login plugin not support AndroidX yet, i can't move project to AndroidX
The other Plugin able to downgrade, but only geolocator got issue.

Please help me~ Thanks

@momoDragon
Copy link
Author

i think migrating to androidX and using the latest plugin worked for me. if u guys have issue migrating u can follow this very straight to the point guide https://medium.com/@swhussain110/how-to-migrate-your-flutter-app-to-androidx-9a78eaaa924b

@mvanbeusekom
Copy link
Member

@althex2015, yes you can. To do so you need to add the following libraries to your pubspec.yaml with the specific version numbers (these are the versions just before the AndroidX migration):

  google_api_availability 1.0.4
  permission_handler: 2.1.2
  geolocator 2.1.1

@mvanbeusekom
Copy link
Member

@momoDragon good to hear it worked for you, I will close this issue now (thank you for providing the link).

For other people the TL;DR version is:

  1. Add the following to your "gradle.properties" file:
android.useAndroidX=true
android.enableJetifier=true
  1. Make sure you set the compileSdkVersion in your "android/app/build.gradle" file to 28:
android {
  compileSdkVersion 28

  ...
}
  1. Make sure you replace all the android. dependencies to their AndroidX counterparts (a full list can be found here: https://developer.android.com/jetpack/androidx/migrate).

@althex2015
Copy link

@althex2015, yes you can. To do so you need to add the following libraries to your pubspec.yaml with the specific version numbers (these are the versions just before the AndroidX migration):

  google_api_availability 1.0.4
  permission_handler: 2.1.2
  geolocator 2.1.1

It's work, thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants