Skip to content
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

[Bug]: Android issues with sending Arrays in Capacitor Plugin #7747

Open
1 of 3 tasks
biozal opened this issue Nov 4, 2024 · 0 comments
Open
1 of 3 tasks

[Bug]: Android issues with sending Arrays in Capacitor Plugin #7747

biozal opened this issue Nov 4, 2024 · 0 comments
Labels

Comments

@biozal
Copy link

biozal commented Nov 4, 2024

Capacitor Version

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

[success] iOS looking great! 👌
[success] Android looking great! 👌

Other API Details

❯ npm --version
npm verbose cli /opt/homebrew/Cellar/node/22.8.0/bin/node /opt/homebrew/bin/npm
npm info using npm@10.8.2
npm info using node@v22.8.0
10.8.2
npm verbose cwd /Users/labeaaa/Developer/couchbase/cbl-ionic/example
npm verbose os Darwin 24.0.0
npm verbose node v22.8.0
npm verbose npm  v10.8.2
npm verbose exit 0
npm info ok

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

When sending an Javascript nested array such as:
const groups: any[] = [];
groups.push(['a', 'b', 'c']);
groups.push([1, 2, 3]);

If I push an object with this shape over the bridge, I get an error from the bridge before it calls the plugin method:
JSONArray is not a valid type. Valid types are simple types and dictionaries and one-dimensional arrays of those types, including MutableDictionary, Dictionary, Map, MutableArray, Array, List, Blob, Date, String, Number, Boolean and null

This same object works just fine on iOS. On iOS I'm using Swift and on Android I'm using Kotlin.

Expected Behavior

I would expect that the nested array would serialize down to a JSONArray and be usable in my plugin. I've looked at passing over the information as a string and then serializing it and deserializing in Kotlin but this is a massive hit in performance when sending large JSON objects (our max is 20 MB in size) per object.

Project Reproduction

https://github.com/Couchbase-Ecosystem/cbl-ionic/example

Additional Information

This is for the new cbl-ionic plugin for Couchbase Mobile.

@biozal biozal added the triage label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant