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

getMedia crashes the application #2

Open
orgotech-robin opened this issue Jan 2, 2019 · 5 comments
Open

getMedia crashes the application #2

orgotech-robin opened this issue Jan 2, 2019 · 5 comments

Comments

@orgotech-robin
Copy link

I can fetch the albums perfectly but when trying to access Media from the Album the app crashes. Its a COPY PASTE of readme example.

@ankon
Copy link

ankon commented Jan 3, 2019

Do you have any log messages? Can you expand a bit on the specifics of the device you're using (make/model, OS version, ...)?

Just saying "It crashes" doesn't really help in improving the software, as ... "It doesn't crash" is how we would describe our use of it :)

@orgotech-robin
Copy link
Author

orgotech-robin commented Jan 3, 2019

Of course. :)
iPhone X (11.4.1)

2019-01-03 10:34:17.395600+0100[2778:692284] -[NSTaggedPointerString objectForKeyedSubscript:]: unrecognized selector sent to instance 0xa51c50016ca8c8cb
2019-01-03 10:34:17.396299+0100[2778:692284] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString objectForKeyedSubscript:]: unrecognized selector sent to instance 0xa51c50016ca8c8cb'

First throw call stack:

(0x18372ed8c 0x1828e85ec 0x18373c098 0x1837345c8 0x18361a41c 0x102c45890 0x1034e51dc 0x1034e519c 0x1034f1200 0x1034f67c8 0x1034f6500 0x183353fac 0x183353b08)
libc++abi.dylib: terminating with uncaught exception of type NSException

Appreciate the help! :)

@UpriseNate
Copy link

On Android, I get a similar behavior (crash on getMedia) and the error that is returned to me is "java.lang.String cannot be cast to org.json.JSONObject"

@wuori
Copy link

wuori commented Sep 16, 2020

This issue (the crash) can be resolved by passing the entire album object to galleryAPI.getMedia vs. just the title.

Ex: galleryAPI.getMedia(album) vs. galleryAPI.getMedia(albumName)

Still can't get an album list on Android, but I'm working on these issues to see what I can do. I have very little iOS/Java experience so it's... painful.

@kssham
Copy link

kssham commented Feb 13, 2021

In "platforms\android\app\src\main\java\com\subitolabs\cordova\galleryapi\GalleryAPI.java"GalleryAPI.java"
Change
JSONObject object = (JSONObject) args.get(0);
ArrayOfObjects albums = getMedia(object.getString("title"));
to
String object = (String) args.get(0);
ArrayOfObjects albums = getMedia(object);

This works fine for me. Thank 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

No branches or pull requests

5 participants