react-native-contacts icon indicating copy to clipboard operation
react-native-contacts copied to clipboard

πŸ› Bug Report: Android build fails with `react-native-contacts` on React Native 0.79 when `newArchEnabled=true`

Open ajouve opened this issue 8 months ago β€’ 21 comments

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)

ajouve avatar May 07 '25 08:05 ajouve

I can confirm that this is happening in my project as well.

React Native: 0.79.2
react-native-contacts: 8.0.5
Platform: Android

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 {

This has something to do with new bridgeless architecture

mare95 avatar May 07 '25 12:05 mare95

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

linoleum00 avatar May 07 '25 20:05 linoleum00

Same! 8.0.4 built, but Contacts was resolving to null for me.

Error requesting contacts permission: TypeError: Cannot read property 'requestPermission' of null

Fixed with this - import Contacts from 'react-native-contacts/src/NativeContacts';

Taken from here - https://stackoverflow.com/questions/79591867/why-is-contacts-module-null-in-react-native-cli-when-using-react-native-contacts

allisonadam81 avatar May 09 '25 17:05 allisonadam81

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..

djangoamidala avatar May 10 '25 20:05 djangoamidala

FWIW - my solution is to leave new arch enabled to true, and then in a separate file do a platform dependent export for the correct contacts module.

import TurboContacts from 'react-native-contacts' import NativeContacts from 'react-native-contacts/src/NativeContacts'

const Contacts = Platform.OS === 'android' ? NativeContacts : TurboContacts

export Contacts

Seems to work just fine for now.

allisonadam81 avatar May 10 '25 21:05 allisonadam81

getting this error too.


this patch gets it building for me

diff --git a/android/src/newarch/com/rt2zz/reactnativecontacts/ContactsManager.java b/android/src/newarch/com/rt2zz/reactnativecontacts/ContactsManager.java
index 78f5e0ea84e86307e0ca7e8926ef3792751514ee..834b49125efd08a12bc6dbbf2f6bc372938fcb77 100644
--- a/android/src/newarch/com/rt2zz/reactnativecontacts/ContactsManager.java
+++ b/android/src/newarch/com/rt2zz/reactnativecontacts/ContactsManager.java
@@ -10,6 +10,7 @@ import android.graphics.BitmapFactory;
 import com.facebook.react.bridge.ActivityEventListener;
 import com.facebook.react.bridge.Promise;
 import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReadableArray;
 import com.facebook.react.bridge.ReadableMap;
 import com.rt2zz.reactnativecontacts.impl.ContactsManagerImpl;
 
@@ -222,6 +223,46 @@ public class ContactsManager extends NativeContactsSpec implements ActivityEvent
         // this method is only needed for iOS
     }
 
+    @Override
+    public void getGroups(Promise promise) {
+        
+    }
+
+    @Override
+    public void getGroup(String identifier, Promise promise) {
+
+    }
+
+    @Override
+    public void deleteGroup(String identifier, Promise promise) {
+
+    }
+
+    @Override
+    public void updateGroup(String identifier, ReadableMap groupData, Promise promise) {
+
+    }
+
+    @Override
+    public void addGroup(ReadableMap group, Promise promise) {
+
+    }
+
+    @Override
+    public void contactsInGroup(String identifier, Promise promise) {
+
+    }
+
+    @Override
+    public void addContactsToGroup(String groupIdentifier, ReadableArray contactIdentifiers, Promise promise) {
+
+    }
+
+    @Override
+    public void removeContactsFromGroup(String groupIdentifier, ReadableArray contactIdentifiers, Promise promise) {
+
+    }
+
 
     /*
     protected static void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,

dannyhw avatar May 11 '25 17:05 dannyhw

Temporary fix for folks who don't need group features

Tested on:

  • "react-native": "0.78.2"
  • "react-native-contacts": "^8.0.5"
  • newArchEnabled=true in gradle.properties

Just tested this on Android (haven't tried on iOS yet tho πŸ™ˆ).

πŸ”§ Permissions added in ./android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.WRITE_CONTACTS" />

🧼 Also commented out the group-related stuff in:

./node_modules/react-native-contacts/src/NativeContacts.ts

import type { TurboModule } from "react-native/Libraries/TurboModule/RCTExport";
import { TurboModuleRegistry } from "react-native";
import { Contact, Group, PermissionType } from "../type";

export interface Spec extends TurboModule {
  getAll: () => Promise<any>;
  getAllWithoutPhotos: () => Promise<Contact[]>;
  getContactById: (contactId: string) => Promise<Contact>;
  getCount: () => Promise<number>;
  getPhotoForId: (contactId: string) => Promise<string>;
  addContact: (contact: Object) => Promise<any>;
  openContactForm: (contact: Object) => Promise<Contact>;
  openExistingContact: (contact: Object) => Promise<Contact>;
  viewExistingContact: (contact: { recordID: string }) => Promise<Contact>;
  editExistingContact: (contact: Object) => Promise<Contact>;
  updateContact: (contact: Object) => Promise<void>;
  deleteContact: (contact: Object) => Promise<void>;
  getContactsMatchingString: (str: string) => Promise<Contact[]>;
  getContactsByPhoneNumber: (phoneNumber: string) => Promise<Contact[]>;
  getContactsByEmailAddress: (emailAddress: string) => Promise<Contact[]>;
  checkPermission: () => Promise<PermissionType>;
  requestPermission: () => Promise<PermissionType>;
  writePhotoToPath: (contactId: string, file: string) => Promise<boolean>;
  iosEnableNotesUsage: (enabled: boolean) => void;
  // getGroups(): Promise<Group[]>;
  // getGroup: (identifier: string) => Promise<Group | null>;
  // deleteGroup(identifier: string): Promise<boolean>;
  // updateGroup(identifier: string, groupData: Object): Promise<Group>;
  // addGroup(group: Object): Promise<Group>;
  // contactsInGroup(identifier: string): Promise<Contact[]>;
  // addContactsToGroup(
  //   groupIdentifier: string,
  //   contactIdentifiers: string[]
  // ): Promise<boolean>;
  // removeContactsFromGroup(
  //   groupIdentifier: string,
  //   contactIdentifiers: string[]
  // ): Promise<boolean>;
}

export default TurboModuleRegistry.get<Spec>("RCTContacts");

βœ… 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! πŸ’–

vioku avatar May 12 '25 13:05 vioku

Created pull request https://github.com/morenoh149/react-native-contacts/pull/786

Bardiamist avatar May 14 '25 05:05 Bardiamist

can you please fix this i am getting my app crashed again and again

shekhawatvivek avatar May 17 '25 12:05 shekhawatvivek

Please update this bug facing a lot please

shekhawatvivek avatar May 21 '25 13:05 shekhawatvivek

some one not even resolving the issue

Vivek1592002 avatar May 24 '25 12:05 Vivek1592002

@morenoh149 Please fix this issue as android build fails and if we do not update it to latest then ios build fails

indresh149 avatar May 31 '25 13:05 indresh149

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

package com.rt2zz.reactnativecontacts;

import android.Manifest;
import android.app.Activity;
import android.content.Intent;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.facebook.react.bridge.ActivityEventListener;
import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.ReadableMap;
import com.rt2zz.reactnativecontacts.impl.ContactsManagerImpl;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;

public class ContactsManager extends NativeContactsSpec implements ActivityEventListener {

    private final ContactsManagerImpl contactsManagerImpl;

    public ContactsManager(ReactApplicationContext reactContext) {
        super(reactContext);
        this.contactsManagerImpl = new ContactsManagerImpl(reactContext, true);
        reactContext.addActivityEventListener(this);
    }

    @Override
    public void removeContactsFromGroup(String groupId, ReadableArray contactIds, Promise promise) {
        // TODO: implement or handle as needed
    }

    @Override
    public void getGroups(Promise promise) {
        // TODO: implement or handle as needed
    }

    @Override
    public void getGroup(String groupId, Promise promise) {
        // TODO: implement or handle as needed
    }

    @Override
    public void deleteGroup(String identifier, Promise promise) {

    }

    @Override
    public void updateGroup(String identifier, ReadableMap groupData, Promise promise) {

    }

    @Override
    public void addGroup(ReadableMap group, Promise promise) {

    }

    @Override
    public void contactsInGroup(String identifier, Promise promise) {

    }

    @Override
    public void addContactsToGroup(String groupIdentifier, ReadableArray contactIdentifiers, Promise promise) {

    }

    /*
     * Returns all contactable records on phone
     * queries CommonDataKinds.Contactables to get phones and emails
     */
    @Override
    public void getAll(Promise promise) {
        contactsManagerImpl.getAll(promise);
    }

    /**
     * Introduced for iOS compatibility. Same as getAll
     *
     * @param promise promise
     */
    @Override
    public void getAllWithoutPhotos(Promise promise) {
        contactsManagerImpl.getAllWithoutPhotos(promise);
    }



    @Override
    public void getCount(final Promise promise) {
        contactsManagerImpl.getCount(promise);
    }

    /**
     * Retrieves contacts matching String.
     * Uses raw URI when <code>rawUri</code> is <code>true</code>, makes assets copy
     * otherwise.
     *
     * @param searchString String to match
     */
    @Override
    public void getContactsMatchingString(final String searchString, final Promise promise) {
        contactsManagerImpl.getContactsMatchingString(searchString, promise);
    }

    /**
     * Retrieves contacts matching a phone number.
     * Uses raw URI when <code>rawUri</code> is <code>true</code>, makes assets copy
     * otherwise.
     *
     * @param phoneNumber phone number to match
     */
    @Override
    public void getContactsByPhoneNumber(final String phoneNumber, final Promise promise) {
        contactsManagerImpl.getContactsByPhoneNumber(phoneNumber, promise);
    }

    /**
     * Retrieves contacts matching an email address.
     * Uses raw URI when <code>rawUri</code> is <code>true</code>, makes assets copy
     * otherwise.
     *
     * @param emailAddress email address to match
     */
    @Override
    public void getContactsByEmailAddress(final String emailAddress, final Promise promise) {
        contactsManagerImpl.getContactsByEmailAddress(emailAddress, promise);
    }

    /**
     * Retrieves <code>thumbnailPath</code> for contact, or <code>null</code> if not
     * available.
     *
     * @param contactId contact identifier, <code>recordID</code>
     */
    @Override
    public void getPhotoForId(final String contactId, final Promise promise) {
        contactsManagerImpl.getPhotoForId(contactId, promise);
    }

    /**
     * Retrieves <code>contact</code> for contact, or <code>null</code> if not
     * available.
     *
     * @param contactId contact identifier, <code>recordID</code>
     */
    @Override
    public void getContactById(final String contactId, final Promise promise) {
        contactsManagerImpl.getContactById(contactId, promise);
    }

    @Override
    public void writePhotoToPath(final String contactId, final String file, final Promise promise) {
        contactsManagerImpl.writePhotoToPath(contactId, file, promise);
    }

    private Bitmap getThumbnailBitmap(String thumbnailPath) {
        // Thumbnail from absolute path
        Bitmap photo = BitmapFactory.decodeFile(thumbnailPath);

        if (photo == null) {
            // Try to find the thumbnail from assets
            AssetManager assetManager = getReactApplicationContext().getAssets();
            InputStream inputStream = null;
            try {
                inputStream = assetManager.open(thumbnailPath);
                photo = BitmapFactory.decodeStream(inputStream);
                inputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

        return photo;
    }

    /*
     * Start open contact form
     */
    @Override
    public void openContactForm(ReadableMap contact, Promise promise) {
        contactsManagerImpl.openContactForm(contact, promise);
    }

    /*
     * Open contact in native app
     */
    @Override
    public void openExistingContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.openExistingContact(contact, promise);
    }

    /*
     * View contact in native app
     */
    @Override
    public void viewExistingContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.viewExistingContact(contact, promise);
    }

    /*
     * Edit contact in native app
     */
    @Override
    public void editExistingContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.editExistingContact(contact, promise);
    }

    /*
     * Adds contact to phone's addressbook
     */
    @Override
    public void addContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.addContact(contact, promise);
    }

    public byte[] toByteArray(Bitmap bitmap) {
        ByteArrayOutputStream stream = new ByteArrayOutputStream();
        bitmap.compress(Bitmap.CompressFormat.JPEG, 80, stream);
        return stream.toByteArray();
    }

    /*
     * Update contact to phone's addressbook
     */
    @Override
    public void updateContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.updateContact(contact, promise);
    }

    /*
     * Update contact to phone's addressbook
     */
    @Override
    public void deleteContact(ReadableMap contact, Promise promise) {
        contactsManagerImpl.deleteContact(contact, promise);
    }

    /*
     * Check permission
     */
    @Override
    public void checkPermission(Promise promise) {
        contactsManagerImpl.checkPermission(promise);
    }

    /*
     * Request permission
     */
    @Override
    public void requestPermission(Promise promise) {
        contactsManagerImpl.requestPermission(promise);
    }

    /*
     * Enable note usage
     */
    @Override
    public void iosEnableNotesUsage(boolean enabled) {
        // this method is only needed for iOS
    }


    /*
    protected static void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions,
            @NonNull int[] grantResults) {
        if (requestPromise == null) {
            return;
        }

        if (requestCode != PERMISSION_REQUEST_CODE) {
            requestPromise.resolve(PERMISSION_DENIED);
            return;
        }

        Hashtable<String, Boolean> results = new Hashtable<>();
        for (int i = 0; i < permissions.length; i++) {
            results.put(permissions[i], grantResults[i] == PackageManager.PERMISSION_GRANTED);
        }

        if (results.containsKey(PERMISSION_READ_CONTACTS) && results.get(PERMISSION_READ_CONTACTS)) {
            requestPromise.resolve(PERMISSION_AUTHORIZED);
        } else {
            requestPromise.resolve(PERMISSION_DENIED);
        }

        requestPromise = null;
    }*/

    @Override
    public String getName() {
        return ContactsProvider.NAME;
    }

    /*
     * Required for ActivityEventListener
     */
    @Override
    public void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data) {
        contactsManagerImpl.onActivityResult(activity, requestCode, resultCode, data);

    }

    /*
     * Required for ActivityEventListener
     */
    @Override
    public void onNewIntent(Intent intent) {
        contactsManagerImpl.onNewIntent(intent);
    }

}


Kaizodo avatar Jun 02 '25 10:06 Kaizodo

@Kaizodo - works for me. Plus npx patch-package react-native-contacts to keep this fix.

LarryKiniu avatar Jun 10 '25 07:06 LarryKiniu

here is patch based on this PR https://github.com/morenoh149/react-native-contacts/pull/786

react-native-contacts+8.0.5.patch

theol93 avatar Jun 29 '25 02:06 theol93

Please consider fixing this issue in any upcoming release

Edit: Updating to 8.0.7 fixed this. Thanks folks :)

HyzamAli avatar Sep 19 '25 17:09 HyzamAli

Weirdly, the tag or release for 8.0.7 is not visible, but the version exists and has the issue fixed πŸŽ‰ Thanks!

dprevost-LMI avatar Sep 26 '25 00:09 dprevost-LMI

"react": "19.1.0",
"react-native": "0.80.1",
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip

i have using "react-native-contacts": "^8.0.7", when i do newArchEnabled=true then i have getting error is

macmini@MACMINIs-Mac-mini app_sonar % npm run android

[email protected] android react-native run-android

info Installing the app... Starting a Gradle Daemon (subsequent builds will be faster)

Configure project :payu-non-seam-less-react WARNING: Using flatDir should be avoided because it doesn't support any meta-data formats. WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'. It will be removed in version 9.0 of the Android Gradle plugin. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

Configure project :react-native-firebase_app :react-native-firebase_app package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/app/package.json :react-native-firebase_app:firebase.bom using default value: 33.14.0 :react-native-firebase_app:play.play-services-auth using default value: 21.3.0 :react-native-firebase_app package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/app/package.json :react-native-firebase_app:version set from package.json: 22.2.1 (22,2,1 - 22002001) :react-native-firebase_app:android.compileSdk using custom value: 35 :react-native-firebase_app:android.targetSdk using custom value: 35 :react-native-firebase_app:android.minSdk using custom value: 27 :react-native-firebase_app:reactNativeAndroidDir /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native

Configure project :react-native-firebase_crashlytics :react-native-firebase_crashlytics package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/crashlytics/package.json :react-native-firebase_app package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/app/package.json :react-native-firebase_crashlytics:firebase.bom using default value: 33.14.0 :react-native-firebase_crashlytics package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/crashlytics/package.json :react-native-firebase_crashlytics:version set from package.json: 22.2.1 (22,2,1 - 22002001) :react-native-firebase_crashlytics:android.compileSdk using custom value: 35 :react-native-firebase_crashlytics:android.targetSdk using custom value: 35 :react-native-firebase_crashlytics:android.minSdk using custom value: 27 :react-native-firebase_crashlytics:reactNativeAndroidDir /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native

Configure project :react-native-firebase_messaging :react-native-firebase_messaging package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/messaging/package.json :react-native-firebase_app package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/app/package.json :react-native-firebase_messaging:firebase.bom using default value: 33.14.0 :react-native-firebase_messaging package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/messaging/package.json :react-native-firebase_messaging:version set from package.json: 22.2.1 (22,2,1 - 22002001) :react-native-firebase_messaging:android.compileSdk using custom value: 35 :react-native-firebase_messaging:android.targetSdk using custom value: 35 :react-native-firebase_messaging:android.minSdk using custom value: 27 :react-native-firebase_messaging:reactNativeAndroidDir /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native

Configure project :react-native-firebase_remote-config :react-native-firebase_remote-config package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/remote-config/package.json :react-native-firebase_app package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/app/package.json :react-native-firebase_remote-config:firebase.bom using default value: 33.14.0 :react-native-firebase_remote-config package.json found at /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-firebase/remote-config/package.json :react-native-firebase_remote-config:version set from package.json: 22.2.1 (22,2,1 - 22002001) :react-native-firebase_remote-config:android.compileSdk using custom value: 35 :react-native-firebase_remote-config:android.targetSdk using custom value: 35 :react-native-firebase_remote-config:android.minSdk using custom value: 27 :react-native-firebase_remote-config:reactNativeAndroidDir /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native

Configure project :react-native-reanimated Android gradle plugin: 8.9.2 Gradle: 8.14.1

Task :react-native-keychain:generateCodegenSchemaFromJavaScript

Task :react-native-async-storage_async-storage:compileDebugJavaWithJavac

Task :react-native-contacts:compileDebugJavaWithJavac

Task :react-native-date-picker:compileDebugJavaWithJavac

Task :react-native-exit-app:compileDebugJavaWithJavac

Task :react-native-reanimated:compileDebugJavaWithJavac FAILED

Task :react-native-community_datetimepicker:compileDebugKotlin w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/MaterialDatePickerModule.kt:21:20 'val currentActivity: Activity?' is deprecated. Deprecated in Java. w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/MaterialDatePickerModule.kt:26:20 'val currentActivity: Activity?' is deprecated. Deprecated in Java. w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/MaterialTimePickerModule.kt:22:20 'val currentActivity: Activity?' is deprecated. Deprecated in Java. w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-community/datetimepicker/android/src/main/java/com/reactcommunity/rndatetimepicker/MaterialTimePickerModule.kt:27:20 'val currentActivity: Activity?' is deprecated. Deprecated in Java.

Task :react-native-documents_picker:compileDebugKotlin w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-documents/picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt:86:27 'val currentActivity: Activity?' is deprecated. Deprecated in Java. w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-documents/picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt:109:27 'val currentActivity: Activity?' is deprecated. Deprecated in Java. w: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-documents/picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.kt:148:27 'val currentActivity: Activity?' is deprecated. Deprecated in Java.

[Incubating] Problems report is available at: file:///Users/macmini/Documents/indiasheltercustomerapp_sonar/android/build/reports/problems/problems-report.html

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.14.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. 486 actionable tasks: 71 executed, 415 up-to-date

info πŸ’‘ Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-async-storage/async-storage/android/src/javaPackage/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-contacts/android/src/main/java/com/rt2zz/reactnativecontacts/ReactNativeContacts.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-exit-app/android/src/main/java/com/github/wumke/RNExitApp/RNExitAppPackage.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:13: error: cannot find symbol import com.swmansion.reanimated.NativeWorkletsModuleSpec; ^ symbol: class NativeWorkletsModuleSpec location: package com.swmansion.reanimated /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:21: error: cannot find symbol public class WorkletsModule extends NativeWorkletsModuleSpec { ^ symbol: class NativeWorkletsModuleSpec /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:20: error: cannot find symbol @ReactModule(name = WorkletsModule.NAME) ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:35: error: incompatible types: Class<WorkletsModule> cannot be converted to Class<? extends NativeModule> WorkletsModule.class, ^ /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:64: error: cannot find symbol var context = getReactApplicationContext(); ^ symbol: method getReactApplicationContext() location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java:70: error: no suitable method found for getNativeModule(Class<WorkletsModule>) mWorkletsModule = reactContext.getNativeModule(WorkletsModule.class); ^ method ReactContext.<T>getNativeModule(Class<T>) is not applicable (inference variable T has incompatible bounds equality constraints: WorkletsModule lower bounds: NativeModule) method ReactContext.getNativeModule(String) is not applicable (argument mismatch; Class<WorkletsModule> cannot be converted to String) where T is a type-variable: T extends NativeModule declared in method <T>getNativeModule(Class<T>) /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: cannot find symbol case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: incompatible types: bad type in switch expression case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ WorkletsModule cannot be converted to NativeModule Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 8 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.

Compilation failed; see the compiler output below. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java:70: error: no suitable method found for getNativeModule(Class<WorkletsModule>) mWorkletsModule = reactContext.getNativeModule(WorkletsModule.class); ^ method ReactContext.<T>getNativeModule(Class<T>) is not applicable (inference variable T has incompatible bounds equality constraints: WorkletsModule lower bounds: NativeModule) method ReactContext.getNativeModule(String) is not applicable (argument mismatch; Class<WorkletsModule> cannot be converted to String) where T is a type-variable: T extends NativeModule declared in method <T>getNativeModule(Class<T>) Note: Recompile with -Xlint:deprecation for details. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:35: error: incompatible types: Class<WorkletsModule> cannot be converted to Class<? extends NativeModule> WorkletsModule.class, ^ /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: incompatible types: bad type in switch expression case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ WorkletsModule cannot be converted to NativeModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:13: error: cannot find symbol import com.swmansion.reanimated.NativeWorkletsModuleSpec; ^ symbol: class NativeWorkletsModuleSpec location: package com.swmansion.reanimated /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:20: error: cannot find symbol @ReactModule(name = WorkletsModule.NAME) ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: cannot find symbol case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ symbol: variable NAME location: class WorkletsModule Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:21: error: cannot find symbol public class WorkletsModule extends NativeWorkletsModuleSpec { ^ symbol: class NativeWorkletsModuleSpec Note: Some input files use unchecked or unsafe operations. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:64: error: cannot find symbol var context = getReactApplicationContext(); ^ symbol: method getReactApplicationContext() location: class WorkletsModule 8 errors

  • Try:

Check your code and dependencies to fix the compilation error(s) Run with --scan to get full insights.

BUILD FAILED in 27s error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 No modules to process in combine-js-to-schema-cli. If this is unexpected, please check if you set up your NativeComponent correctly. See combine-js-to-schema.js for how codegen finds modules. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/@react-native-async-storage/async-storage/android/src/javaPackage/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-contacts/android/src/main/java/com/rt2zz/reactnativecontacts/ReactNativeContacts.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-exit-app/android/src/main/java/com/github/wumke/RNExitApp/RNExitAppPackage.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:13: error: cannot find symbol import com.swmansion.reanimated.NativeWorkletsModuleSpec; ^ symbol: class NativeWorkletsModuleSpec location: package com.swmansion.reanimated /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:21: error: cannot find symbol public class WorkletsModule extends NativeWorkletsModuleSpec { ^ symbol: class NativeWorkletsModuleSpec /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:20: error: cannot find symbol @ReactModule(name = WorkletsModule.NAME) ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:35: error: incompatible types: Class<WorkletsModule> cannot be converted to Class<? extends NativeModule> WorkletsModule.class, ^ /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:64: error: cannot find symbol var context = getReactApplicationContext(); ^ symbol: method getReactApplicationContext() location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java:70: error: no suitable method found for getNativeModule(Class<WorkletsModule>) mWorkletsModule = reactContext.getNativeModule(WorkletsModule.class); ^ method ReactContext.<T>getNativeModule(Class<T>) is not applicable (inference variable T has incompatible bounds equality constraints: WorkletsModule lower bounds: NativeModule) method ReactContext.getNativeModule(String) is not applicable (argument mismatch; Class<WorkletsModule> cannot be converted to String) where T is a type-variable: T extends NativeModule declared in method <T>getNativeModule(Class<T>) /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: cannot find symbol case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: incompatible types: bad type in switch expression case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ WorkletsModule cannot be converted to NativeModule Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 8 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.

Compilation failed; see the compiler output below. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedModule.java:70: error: no suitable method found for getNativeModule(Class<WorkletsModule>) mWorkletsModule = reactContext.getNativeModule(WorkletsModule.class); ^ method ReactContext.<T>getNativeModule(Class<T>) is not applicable (inference variable T has incompatible bounds equality constraints: WorkletsModule lower bounds: NativeModule) method ReactContext.getNativeModule(String) is not applicable (argument mismatch; Class<WorkletsModule> cannot be converted to String) where T is a type-variable: T extends NativeModule declared in method <T>getNativeModule(Class<T>) Note: Recompile with -Xlint:deprecation for details. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:35: error: incompatible types: Class<WorkletsModule> cannot be converted to Class<? extends NativeModule> WorkletsModule.class, ^ /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: incompatible types: bad type in switch expression case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ WorkletsModule cannot be converted to NativeModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:13: error: cannot find symbol import com.swmansion.reanimated.NativeWorkletsModuleSpec; ^ symbol: class NativeWorkletsModuleSpec location: package com.swmansion.reanimated /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:20: error: cannot find symbol @ReactModule(name = WorkletsModule.NAME) ^ symbol: variable NAME location: class WorkletsModule /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/ReanimatedPackage.java:44: error: cannot find symbol case WorkletsModule.NAME -> new WorkletsModule(reactContext); ^ symbol: variable NAME location: class WorkletsModule Note: Recompile with -Xlint:unchecked for details. Note: Some input files use or override a deprecated API. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:21: error: cannot find symbol public class WorkletsModule extends NativeWorkletsModuleSpec { ^ symbol: class NativeWorkletsModuleSpec Note: Some input files use unchecked or unsafe operations. /Users/macmini/Documents/indiasheltercustomerapp_sonar/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/worklets/WorkletsModule.java:64: error: cannot find symbol var context = getReactApplicationContext(); ^ symbol: method getReactApplicationContext() location: class WorkletsModule 8 errors * Try: Check your code and dependencies to fix the compilation error(s) Run with --scan to get full insights. BUILD FAILED in 27s. info Run CLI with --verbose flag for more details. macmini@MACMINIs-Mac-mini indiasheltercustomerapp_sonar %

and i when i change true value to false newArchEnabled=false then i their is no build issue

vinaykumarIndia avatar Oct 07 '25 04:10 vinaykumarIndia

This line tells you that you are not in the proper project:

Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.

dprevost-LMI avatar Oct 07 '25 11:10 dprevost-LMI