react-native-contacts: 🐛 Bug Report: Android build fails with `react-native-contacts` on React Native 0.79 when `newArchEnabled=true`
Summary:
After upgrading the app to React Native 0.79, the Android build fails when newArchEnabled=true, due to an incompatibility in react-native-contacts with the new architecture (TurboModules + Codegen). The ContactsManager class does not implement a required method from NativeContactsSpec.
💥 Error output:
ContactsManager is not abstract and does not override abstract method removeContactsFromGroup(String, ReadableArray, Promise) in NativeContactsSpec
public class ContactsManager extends NativeContactsSpec implements ActivityEventListener {
^
✅ Temporary Workaround:
Set the following in android/gradle.properties to disable the new architecture:
newArchEnabled=false
ℹ️ Environment:
- React Native: 0.79.2
- react-native-contacts: 8.0.5
- Platform: Android
- Architecture: New architecture enabled (Fabric / TurboModules)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 16
- Comments: 15
if your android build is failing and you don’t need contacts group then find the file ContactsManager.java in react-native-contacts (under node_modules or android studio error) and add replace code with this
Temporary fix for folks who don’t need group features
Tested on:
"react-native": "0.78.2""react-native-contacts": "^8.0.5"newArchEnabled=trueingradle.propertiesJust tested this on Android (haven’t tried on iOS yet tho 🙈).
🔧 Permissions added in
./android/app/src/main/AndroidManifest.xml:🧼 Also commented out the group-related stuff in:
./node_modules/react-native-contacts/src/NativeContacts.ts✅ Result
No more crashes for me (at least on Android 😅). If you’re not using contact groups, this might be a quick workaround while waiting for the proper fix.
Hope this helps! 💖
I have personally created my own native module. I just need to get a list of contacts with their names, addresses, and images, so there’s not much left to do. I wrote the Android and iOS code in just 35 minutes. Damn npm, there are always so many issues after updates. Never any problems with all my native modules, even after years…
Please update this bug facing a lot please
I can also confirm that this is happening in my project.
React Native: 0.79.2 react-native-contacts: 8.0.5 Platform: Android
Downgarded to 8.0.4 to build in android