Android : Unable to build app
See original GitHub issueEDIT by @kelset:
TL;DR:
- Google released a new Major version of their Google Play services and Firebase
- this new version has BREAKING CHANGES (release notes)
- some third-party libraries used in react-native projects have loose dependencies on said services, most likely in the
:+
form in their gradle configuration - this is causing Gradle buils to fail because of those BC mentioned above
- to fix, you need to set the dependency to a precise version instead of the
:+
- you can find out which libraries are “pulling in” this new version by running
gradlew app:dependencies
and searching the output forandroidx
(more details here)
Please refer to this comment (and the follow ups) for more details on how to fix - in particular, for debugging, read this comment.
React Native version: 0.58.0 Platform : android
Here are android version: buildToolsVersion = “27.0.3” minSdkVersion = 19 compileSdkVersion = 26 targetSdkVersion = 26 supportLibVersion = “26.1.0”
Building app on android before today is working fine. and suddenly got this issue in android manifest file …\android\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:46: AAPT: No resource identifier found for attribute ‘appComponentFactory’ in package ‘android’
Steps To Reproduce
Describe what you expected to happen:
Snack, code example, or link to a repository:
Issue Analytics
- State:
- Created 4 years ago
- Reactions:31
- Comments:65 (2 by maintainers)
Top Results From Across the Web
Unable to build project in Android Studio - Stack Overflow
I have already installed google support repository as mentioned in other places. This is my build.gradle: apply plugin: 'com.android.application ...
Read more >Known issues with Android Studio and Android Gradle Plugin
When you navigate to Build > Generate Signed Bundle / APK and attempt to configure app signing for an app bundle or an...
Read more >Can't build app for android - Other - Solar2D Game Engine
google.android.gms:play-services-location:[10.2.1, 16.0.99]. ... Failed to list versions for com.google.android.gms:play-services-location. Unable ...
Read more >Unable to build app(android/ios) - Bug - AppGyver
Unable to build app (android/ios) ... +1 - we are stuck at queued as well for several hours now… ... Same here. I...
Read more >Android Studio unable to build any projects in SDK...
Android Studio unable to build any projects in SDK/Build instructions incorrect ... After spending probably 8 hours trying to install and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
hey @nodece thanks for the investigation, that seems to be the root cause!
It seems that google released a new version of their Play Services, and in particular
com.google.android.gms:play-services-gcm
- so if you are depending on latest (via something likecom.google.android.gms:play-services-gcm:+
) then you need to change it to instead rely on the previous version, in the example16.0.0
.So you may have to do something like
I’m going to close this, as it seems to be caused by third-party libraries and not react native per-se - if something else pops up please comment ahead!
EDIT: if you are still experiencing the issue, it’s likely one of these two reasons:
./gradlew cleanBuildCache
&./gradlew clean
from the /android folderIf it’s neither because of these, please provide a repro so that it can be investigated.
update: The root cause is related to androidx, google play service… try upgrade project to androidx
This problem seems to be triggered by the version of react-native-device-info? 2.1.2 constrain play services dependency to pre-AndroidX 16.1.0 react-native-device-info
It working for me.