-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android Api 34 error Android 14 #505
Comments
Same here, is there some solution? |
Same problem here, a patch would be highly appreciated ;) |
Hi, after fiddling around I found a simple solution that worked for me: I removed all lines which are API 34 incompatible in the java code. Actually all the lines with these deprecated functions: void disableForegroundNdefPush(Activity) | void enableForegroundNdefPush(Activity, NdefMessage) | boolean invokeBeam(Activity) | boolean isNdefPushEnabled() | void setBeamPushUris(Uri[], Activity) | void setBeamPushUrisCallback(CreateBeamUrisCallback, Activity) | void setNdefPushMessage(NdefMessage, Activity) | void setNdefPushMessageCallback(CreateNdefMessageCallback, Activity) | void setOnNdefPushCompleteCallback(OnNdefPushCompleteCallback, Activity) | Since I had in mind a very very simple reader in my app, this worked. I have no idea what these lines were actually doing. Also if you wonder how to register functions on Android, the doku was kind of incomplete on that: this.nfc.addMimeTypeListener("text/demo", this.onNfc).subscribe( (event: any)=> |
All these functions are related to Android Beam wich has been deprecated in API 29 and removed in API 34 : https://developer.android.com/about/versions/10/behavior-changes-all#beam-deprecation It should indeed be removed from this plugin. |
Removed Methods
void disableForegroundNdefPush(Activity) | void enableForegroundNdefPush(Activity, NdefMessage) | boolean invokeBeam(Activity) | boolean isNdefPushEnabled() | void setBeamPushUris(Uri[], Activity) | void setBeamPushUrisCallback(CreateBeamUrisCallback, Activity) | void setNdefPushMessage(NdefMessage, Activity) | void setNdefPushMessageCallback(CreateNdefMessageCallback, Activity) | void setOnNdefPushCompleteCallback(OnNdefPushCompleteCallback, Activity) |
Added Methods NfcAntennaInfo getNfcAntennaInfo()
Error build android devices sdk 34
[cordova] nfcAdapter.setNdefPushMessage(p2pMessage, getActivity());
[cordova] symbol: method setNdefPushMessage(NdefMessage,Activity)
[cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:585: error: cannot find symbol [cordova] } else if (!nfcAdapter.isNdefPushEnabled()) { [cordova] ^
[cordova] symbol: method isNdefPushEnabled() [cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:588: error: cannot find symbol
[cordova] nfcAdapter.setOnNdefPushCompleteCallback(NfcPlugin.this, getActivity()); [cordova] ^ [cordova] symbol: method setOnNdefPushCompleteCallback(NfcPlugin,Activity) [cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:590: error: cannot find symbol
[cordova] nfcAdapter.setBeamPushUris(uris, getActivity());
[cordova] ^ [cordova] symbol: method setBeamPushUris(Uri[],Activity) [cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] /platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:611: error: cannot find symbol
[cordova] } else if (!nfcAdapter.isNdefPushEnabled()) {
[cordova] ^ [cordova] symbol: method isNdefPushEnabled() [cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:614: error: cannot find symbol [cordova] nfcAdapter.setNdefPushMessage(p2pMessage, getActivity());
[cordova] symbol: method setNdefPushMessage(NdefMessage,Activity)
[cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:615: error: cannot find symbol
[cordova] nfcAdapter.setOnNdefPushCompleteCallback(NfcPlugin.this, getActivity()); [cordova] ^
[cordova] symbol: method setOnNdefPushCompleteCallback(NfcPlugin,Activity)
[cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:631: error: cannot find symbol
[cordova] nfcAdapter.setNdefPushMessage(null, getActivity()); [cordova] ^
[cordova] symbol: method setNdefPushMessage(,Activity) [cordova] location: variable nfcAdapter of type NfcAdapter
[cordova] platforms/android/app/src/main/java/com/chariotsolutions/nfc/plugin/NfcPlugin.java:643: error: cannot find symbol
[cordova] nfcAdapter.setBeamPushUris(null, getActivity()); [cordova] ^ [cordova] symbol: method setBeamPushUris(,Activity)
[cordova] location: variable nfcAdapter of type NfcAdapter [cordova] Note: Some input files use or override a deprecated API.
[cordova] Note: Recompile with -Xlint:deprecation for details.
The text was updated successfully, but these errors were encountered: