Closed adeelcheeema closed 12 months ago
I think I'm having the same issue on my app when upgrading gradle
the log I have from the build:
> Task :react-native-nfc-manager:compileDebugJavaWithJavac FAILED
/Users/n/Code/galoy-mobile/node_modules/react-native-nfc-manager/android/src/main/java/community/revteltech/nfc/NfcManager.java:967: error: cannot find symbol
nfcAdapter.setNdefPushMessage(msgToPush, currentActivity);
^
symbol: method setNdefPushMessage(NdefMessage,Activity)
location: variable nfcAdapter of type NfcAdapter
Note: /Users/n/Code/galoy-mobile/node_modules/react-native-nfc-manager/android/src/main/java/community/revteltech/nfc/NfcManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
yes, this error is coming with react native version
"react-native": "0.72.4",
"react-native-nfc-manager": "^3.14.6",
Hi @nicolasburtey @adeelcheeema @kirandchavan you're right! I have removed the deprecated api and released v3.14.7
, please give it a try & thanks for the information!
NfcManager.java -> setNdefPushMessage -> nfcAdapter.setNdefPushMessage(msgToPush, currentActivity);
Issue Description:
When trying to build the Android project, I encountered an issue related to NfcManager.java and the setNdefPushMessage function. Specifically, the build fails if I comment out the line nfcAdapter.setNdefPushMessage(msgToPush, currentActivity);. However, the build succeeds when this line is included.
Expected Behavior: The build should complete successfully even when the line nfcAdapter.setNdefPushMessage(msgToPush, currentActivity); is commented out.
Actual Behavior: The build fails when the line nfcAdapter.setNdefPushMessage(msgToPush, currentActivity); is commented out.
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(context); nfcAdapter.setNdefPushMessage(msgToPush, currentActivity); callback.invoke();
This function has been removed in the Nfc Adapter Documentation. You can find more information about this change at the following link:
Changes in android.nfc.NfcAdapter