evollu / react-native-fcm

react native module for firebase cloud messaging and local notification
MIT License
1.73k stars 681 forks source link

Android build failed with AATP Error in RN 0.57.4 #1062

Open ohnishiakira opened 5 years ago

ohnishiakira commented 5 years ago

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:

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
paalex commented 5 years ago

In my case was resolved by removing react-native-fcm (npm uninstall react-native-fcm) and downgrading to an older version (npm i react-native-fcm@16.2.0)

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"

phithu commented 5 years ago

@ohnishiakira make sure you added notification icon to assets

ohnishiakira commented 5 years ago

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

phithu commented 5 years ago

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

14bscsskazmi commented 5 years ago

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

HashanCalcey commented 5 years ago

@paalex Thanks a lot.

biztta commented 5 years ago

@paalex thanks a lot :)

phanbien9x commented 5 years ago

Thanks @paalex you saved my day!

yusuf987 commented 5 years ago

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