I'm working on an app that uses a cocoapod, which has been built using j2objc. But when I try to run unit tests in Xcode I see the following error:
Terminating app due to uncaught exception 'JavaLangArrayStoreException', reason: 'source of type IOSByteArray is not an array'
I understand that arrays in Java don't map perfectly onto Objective C arrays. But this exception doesn't prevent the app from running, so is there a way to ignore this for unit tests and UI tests?
The code that's failing is inside a cocoapod, so I'm not sure I'll be able to do any manual conversions. Here's the line that's failing:
return IOSObjectArray_Get(nil_chk([rawType getGenericInterfaces]), i);
I do not know your code but you must understand that array of Objective-C is not -the same as
IOSByteArray
!You have to convert
IOSByteArray
into usual objc array before using of it.use either this
or this
- (NSData *)toNSData;
method to work.