Skip to content

fix android sdk 34 and removed all deprecated dependencies & fix ios - #512

Open
iabdullahbeker wants to merge 1 commit into
chariotsolutions:masterfrom
iabdullahbeker:abdullah/fix-ios-android-34-issues
Open

fix android sdk 34 and removed all deprecated dependencies & fix ios#512
iabdullahbeker wants to merge 1 commit into
chariotsolutions:masterfrom
iabdullahbeker:abdullah/fix-ios-android-34-issues

Conversation

@iabdullahbeker

Copy link
Copy Markdown

fix android sdk 34 and removed all deprecated dependencies & fix ios file.

@msd117

msd117 commented Jul 16, 2024

Copy link
Copy Markdown

Can we get this pr merged in repo

@iabdullahbeker

Copy link
Copy Markdown
Author

Can we get this pr merged in repo

There're alot of PR , but without merges !

@CedricDALAT

Copy link
Copy Markdown

Hi @iabdullahbeker ,
Thanks a lot for your fixes !
It works, but you've commited some changes on the tagToJson function where you've added a second argument, but you didn't change the function, so it crashes when building.

sendEvent(TAG_DEFAULT, Util.tagToJSON(tag, messages));
                                   ^
  required: Tag
  found:    Tag,Parcelable[]
  reason: actual and formal argument lists differ in length
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.

@iabdullahbeker

iabdullahbeker commented Aug 3, 2024

Copy link
Copy Markdown
Author

Hi @iabdullahbeker , Thanks a lot for your fixes ! It works, but you've commited some changes on the tagToJson function where you've added a second argument, but you didn't change the function, so it crashes when building.

sendEvent(TAG_DEFAULT, Util.tagToJSON(tag, messages));
                                   ^
  required: Tag
  found:    Tag,Parcelable[]
  reason: actual and formal argument lists differ in length
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.

tha function has two params .. see it's here .

    static JSONObject tagToJSON(Tag tag, Parcelable[] messages) {
        JSONObject json = new JSONObject();

        if (tag != null) {
            try {
                json.put("id", byteArrayToJSON(tag.getId()));
                json.put("techTypes", new JSONArray(Arrays.asList(tag.getTechList())));
                
                if (messages != null && messages.length > 0) {
                    json.put("ndefMessage", messageToJSON((NdefMessage)messages[0]));
                }
            } catch (JSONException e) {
                Log.e(TAG, "Failed to convert tag into json: " + tag.toString(), e);
            }
        }
        return json;
    }

@CedricDALAT

Copy link
Copy Markdown

tha function has two params .. see it's here .

    static JSONObject tagToJSON(Tag tag, Parcelable[] messages) {
        JSONObject json = new JSONObject();

        if (tag != null) {
            try {
                json.put("id", byteArrayToJSON(tag.getId()));
                json.put("techTypes", new JSONArray(Arrays.asList(tag.getTechList())));
                
                if (messages != null && messages.length > 0) {
                    json.put("ndefMessage", messageToJSON((NdefMessage)messages[0]));
                }
            } catch (JSONException e) {
                Log.e(TAG, "Failed to convert tag into json: " + tag.toString(), e);
            }
        }
        return json;
    }

Well, i'm not an android developer, but, from what i understand, this function is defined in the Util.java file and in your project or in the master of this repo the function only has one parameter.

@iabdullahbeker

Copy link
Copy Markdown
Author

tha function has two params .. see it's here .

    static JSONObject tagToJSON(Tag tag, Parcelable[] messages) {
        JSONObject json = new JSONObject();

        if (tag != null) {
            try {
                json.put("id", byteArrayToJSON(tag.getId()));
                json.put("techTypes", new JSONArray(Arrays.asList(tag.getTechList())));
                
                if (messages != null && messages.length > 0) {
                    json.put("ndefMessage", messageToJSON((NdefMessage)messages[0]));
                }
            } catch (JSONException e) {
                Log.e(TAG, "Failed to convert tag into json: " + tag.toString(), e);
            }
        }
        return json;
    }

Well, i'm not an android developer, but, from what i understand, this function is defined in the Util.java file and in your project or in the master of this repo the function only has one parameter.

in my research after i installed the package for first time , i found some issues in Util.java and NfcPlugin.java
so i found an updated file for Util.java and with chatGPT help i've fixed NfcPlugin.java to be compatible with SDK 34 .

if you need those two files , just send me your email and i will send it over to you .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants