-
Notifications
You must be signed in to change notification settings - Fork 574
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. |
So on my App i'm getting forced to upgrade to SDK 34 otherwise i can't upload any updates to the google console by the end of August. Has anyone found a workaround yet to keep phonegap-nfc working in SDK 34? |
same here |
@JoeyTheCoder @jramosg Please see this PR #508, that has been merged in this fork ns0m/cordova-plugin-ns0m-nfc and published to NPM : cordova-plugin-ns0m-nfc. |
This repository works for Android API 34, l have used this. The Reading and Writing to NFC Tags is working. Thanks for the plugin maintenance. |
@bmarsaud thank you very much for your contribution |
@tmwebs @DalterioRaffaele @bmarsaud @bevinGithub @JoeyTheCoder @jramosg this plugin creator did fantastic work, and we highly appreciate him , but he is not answering for years and unfortunately it is not maintained anymore. **the plugin support SDK 34 you can install it as an npm package: I dedicate a considerable amount of my free time to developing and maintaining many cordova plugins for the community (See the list with all my maintained plugins). |
Hello @EYALIN, thanks for your response. Unfortunately, it's (currently) not possible to use your fork together with the Awesome Cordova Plugin wrapper, as you have changed the name and id of the package. Additionally your fork is also missing some important fixes, mainly the following PRs:
Thanks for your efforts to keep this project alive! |
Hi Eyalin, thank you for the the updating of the NFC plugin. I do have a question when witting to NFC tags, if l write to lets say 20 tags the tags are written fine to 12 tags and after that the tag writing seems to stop writing and write the same tag number like cache bottle neck. Every time l write the tags l have o close the app completely and open it to do the writing again. Is there something wrong or please point me in the right direction. Reading works fine you can read as many as you can writing is the one that's like the cache/buffer is building up. Your assistance will be much appreciated. |
Hi Eyalin l need your assistance please. I have NFC reading and writing on my app. The reading is fine it's the writing part that is an issue. If l write to lets say 20 tags the tags are written fine from 1 to 12 tags and after that the tag writing seems to stop writing and write the same tag number like cache or the buffer issue. Every time l write the tags l have to close the app completely and open it to do the writing again. Is there something wrong or please point me in the right direction. Reading works fine you can read as many as you can writing is the one that's like the cache/buffer is building up. Your assistance will be much appreciated. Writing Function Code below this.nfc.write([referenceNumber, date]).then(success => { My environment information Ionic CLI : 6.20.1 (C:\Users\Tigere Bervin\AppData\Roaming\npm\node_modules@ionic\cli) Cordova: Cordova CLI : 11.0.0 Utility: cordova-res : 0.15.4 System: Android SDK Tools : 26.1.1 (C:\Users\Tigere Bervin\AppData\Local\Android\Sdk) |
@bagraercan , we use our own fork (https://github.com/InfosoftSystems/phonegap-nfc) in production and recently released our app to Google Play (with SDK 34 target) and Apple App store with no problems. |
Hi dwettstein, how many tags can you write to without the nfc buffering. I need to write to 300 Tags on on a site on fire devices detectors. |
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: