React-native-fcm: Android build failed with AATP Error in RN 0.57.4

Created on 6 Nov 2018  路  9Comments  路  Source: evollu/react-native-fcm

Procedure are:

  1. Create new react-native project with react-native init
  2. Add latest react-native-fcm (16.2.4) and gradle settings according to README
  3. Run debug build (cd android and ./gradlew assembleDebug)

Version of RN and react-native-fcm are:

  • react-native 0.57.4
  • react-native-fcm 16.2.4

and reproduced in my repository.
https://github.com/ohnishiakira/RNFcmSample

$ ./gradlew assembleDebug 

> Configure project :app 
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :react-native-fcm 
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Task :app:processDebugGoogleServices 
Parsing json file: /Users/akira/Documents/sketch/ReactNative/FcmSample/android/app/google-services.json

/Users/akira/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/c216c91b596b7491492b09306fa38d6f/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

/Users/akira/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/c216c91b596b7491492b09306fa38d6f/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to process resources, see aapt output above for details.

* 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 1s
22 actionable tasks: 2 executed, 20 up-to-date

Most helpful comment

In my case was resolved by removing react-native-fcm (npm uninstall react-native-fcm) and downgrading to an older version (npm i [email protected])

EDIT:
In my case, seems like the issue was associated with the following commit #1057
Specifically, changing:
- compile "com.android.support:support-core-utils:27.1.1"
+ compile "com.android.support:support-core-utils:28.0.0"

All 9 comments

In my case was resolved by removing react-native-fcm (npm uninstall react-native-fcm) and downgrading to an older version (npm i [email protected])

EDIT:
In my case, seems like the issue was associated with the following commit #1057
Specifically, changing:
- compile "com.android.support:support-core-utils:27.1.1"
+ compile "com.android.support:support-core-utils:28.0.0"

@ohnishiakira make sure you added notification icon to assets

@phithu I added notification icon and tried again, but same error occurred.

@ohnishiakira downgrading FCM @16.2.0 and React Native @0.57.1 is working

@paalex Thanks man your solution is working I was stuck like for 2 days and night

@paalex Thanks a lot.

@paalex thanks a lot :)

Thanks @paalex you saved my day!

thanks, @paalex and @phithu
in my case both version and image name were the issue
its working now

Was this page helpful?
0 / 5 - 0 ratings