Blackberry runtime store class cast exception - blackberry

The following line in my BLackBerry app causes no errors when run with JRE 7 but it gives a ClassCastException otherwise. Does anyone have an idea about what can be wrong?
DataBuffer databuffer =
(DataBuffer) RuntimeStore.getRuntimeStore().get(AppMain.databufferID);

Related

What does that code mean in exception error "Thread 3: EXC_BAD_ACCESS (code=2, address=0x16dbc7ff0)"?

I got a run time error during a debug run of my Xcode project for iOS. The project was running on an iPhone 8 device running iOS 15.5. I am using Xcode version 13.4.1 on a Mac Pro running macOS Monterey version 12.5.
The error message occurred at a line of code where I initialize a custom struct.
Thread 3: EXC_BAD_ACCESS (code=2, address=0x16dbc7ff0)
Here is my relevant code. The error message shows in red where GroupLocalCache is being initialized.
import Foundation
import CloudKit
// Wrap a CKRecordZone and its caches (each record type should have its records saved in the caches.
//
final class Zone {
let cloudKitZone: CKRecordZone
let caches = [BaseLocalCache]()
private var groupCache: GroupLocalCache
init(cloudKitZone: CKRecordZone, container: CKContainer, cloudKitDB: CKDatabase) {
self.cloudKitZone = cloudKitZone
self.groupCache = GroupLocalCache(container: container, cloudKitDB: cloudKitDB, cloudKitZone: cloudKitZone)
}
}
Here is the code for GroupLocalCache:
final class GroupLocalCache: BaseLocalCache {
let container: CKContainer
let cloudKitDB: CKDatabase
let zone: Zone
private var serverChangeToken: CKServerChangeToken?
private var groups = [Group]()
init(container: CKContainer, cloudKitDB: CKDatabase, cloudKitZone: CKRecordZone) {
self.container = container
self.cloudKitDB = cloudKitDB
self.zone = Zone(cloudKitZone: cloudKitZone, container: container, cloudKitDB: cloudKitDB)
super.init()
fetchChanges() // Fetching changes with a nil token to build up the cache.
}
}
BaseLocalCache is a modified version of the BaseLocalCache class that comes with CloudKitShare Xcode project from this Apple webpage: Sharing CloudKit Data with Other iCloud Users.
I want to look up what that "2" represents in the message where it says "code=2".
Other posts on stackoverflow* and Apple's Developer Forums for this same error address specific situations different than the error in my code.
I would like to know what the low level cause of the error is, so I need to know what those codes are that show up in exception error messages, since they tell what the real cause of exception error are in a lower level than answers to posts about exception errors commonly found.
I think I found documentation at one time for those codes at another source outside of Apple. It seems there are codes that are used by hardware manufacturers for "architectures" such as "arm64" and "armv7". I see those in Xcode project build settings.
Do I really need to know what each code as given in the error message represent?
I found this article at Apple's Developer Documentation:
Understanding the Exception Types in a Crash Report
I found this documentation on Apple's Exception Handling Framework in a search with Google: Exception Handling. I don't see what I need. This framework seems to be more than I need at this time.
You currently have an infinite loop of object creations. That's why you get a crash.
When crashing, do not hesitate to see the callstack, you should see it clearly.
The Zone initialization, calls a GroupLocalCache initialization, which calls a Zone initialization, which will call a GroupLocalCache initialization, etc.
So you need to change the logic on your objects.

Xcode Error when launching application Error: Unable to Capture View Hierarchy

I have tried to load the flutter app, that I created, on my phone, but when I try to launch it, it shows a white screen or crashes directly.
The error I am getting is:
Error: Unable to Capture View Hierarchy.
Details: Log Title: Data source expression execution failure.
Log Details: error evaluating expression “(id)[[(Class)objc_getClass("DBGTargetHub") sharedHub] performRequestWithRequestInBase64:#"…"]”: error: <user expression 1>:1:14: use of undeclared identifier 'objc_getClass'
(id)[[(Class)objc_getClass("DBGTargetHub") sharedHub] performRequestWithRequestInBase64:#"YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMSAAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGvEBMLDBscHR4fICwtLi8wMzk6Oz4/VSRudWxs0w0ODxAVGldOUy5rZXlzWk5TLm9iamVjdHNWJGNsYXNzpBESExSAAoADgASABaQWFxgZgAaAB4ARgBKAEF8QF0RCR0hpZXJhcmNoeVJlcXVlc3RUeXBlXxAcREJHSGllcmFyY2h5UmVxdWVzdFByZWRpY2F0ZV8QHURCR0hpZXJhcmNoeVJlcXVlc3RJZGVudGlmaWVyXxAXREJHSGllcmFyY2h5UmVxdWVzdE5hbWUQAdMNDg8hJhqkIiMkJYAIgAmACoALpCcoKSeADIAOgA+ADIAQXxATZW51bVByb3ZpZGVyQ2xhc3Nlc18QEWluY2x1ZGVMYXp5VmFsdWVzXxATc3RyaWN0ZXN0VmlzaWJpbGl0eV8QFm9wdGlvbnNQcm92aWRlckNsYXNzZXPSDg8xMqCADdI0NTY3WiRjbGFzc25hbWVYJGNsYXNzZXNXTlNBcnJheaI2OFhOU09iamVjdAgQA9I0NTw9XE5TRGljdGlvbmFyeaI8OF8QJEQ4MTE0NkQ2LTY1MjAtNDE4Qy05MjA4LTQ1NDJBQUY5NjFEQ18QD0luaXRpYWwgcmVxdWVzdAAIABEAGgAkACkAMgA3AEkATABRAFMAaQBvAHYAfgCJAJAAlQCXAJkAmwCdAKIApACmAKgAqgCsAMYA5QEFAR8BIQEoAS0BLwExATMBNQE6ATwBPgFAAUIBRAFaAW4BhAGdAaIBowGlAaoBtQG+AcYByQHSAdMB1QHaAecB6gIRAAAAAAAAAgEAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAiM="]
^
Log Method: -[DBGDataSourceConnectionLibViewDebugger _executeLLDBExpression:forRequest:onPotentialThread:iteration:]_block_invoke
Method: -[DBGViewDebugger _initiateInitialRequestWithDataSourceVersion:]_block_invoke
Environment: Xcode 11.4.1 (11E503a) debugging iPhone 8 (Model A1863, A1905, A1906, A1907) iOS 13.3.1 (17D50).
Please file a bug at https://feedbackassistant.apple.com with this warning message and any useful information you can provide.
I don't know how to fix this?
Thanks for your answers in advance!

unable to extract model type swift

I'm having a slight issue with CoreML using Swift Playgrounds while attempting to make a gender classifier model. When I add the Gender.mlmodel and Gender.swift to their respective folders within the Playground Page (Resources/ and Sources/), I get a rather peculiar error, shown below:
Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Unable to extract model type from stream in compiled model: Error opening file stream: /var/folders/kt/11b_lk412hv327qjhvgnhvzr0000gn/T/com.apple.dt.Xcode.pg/auxiliarymodules/7C17E9A3-54C7-4828-96BD-00AE07EC7F3E/Gender_Classifier_PageSources.framework/Resources/Gender.mlmodel/coremldata.bin: unspecified iostream_category error" UserInfo={NSLocalizedDescription=Unable to extract model type from stream in compiled model: Error opening file stream: /var/folders/kt/11b_lk412hv327qjhvgnhvzr0000gn/T/com.apple.dt.Xcode.pg/auxiliarymodules/7C17E9A3-54C7-4828-96BD-00AE07EC7F3E/Gender_Classifier_PageSources.framework/Resources/Gender.mlmodel/coremldata.bin: unspecified iostream_category error}: file /BuildRoot/Library/Caches/com.apple.xbs/Sources/swiftlang/swiftlang-900.0.74.1/src/swift/stdlib/public/core/ErrorType.swift, line 181
I've thought that it had an issue accessing the file itself, so I tried using different locations and the absolute path as a String (which returned a value when force-unwrapped), but to no avail. In addition, I tried other models that I know are able to be loaded (SqueezeNet.mlmodel), and that did not work as well, returning a comparable error.
I appreciate any help that anyone would be able to offer, I'm completely perplexed by this issue. Thank you!
I found the solution to this: apparently Swift Playgrounds does not compile .mlmodel to .mlmodelc, thus causing the failure to read a non-compiled model. For anyone else wondering, just run MLModel.compile(at: URL?) to convert it to the compiled format.
In Swift 5.2.3, the following is correct.
let url = try MLModel.compileModel(at: URL(fileURLWithPath: "<#/path/to/read/model.mlmodel#>"))
let mode = try MLModel(contentsOf: url)

Error while upgrading to latest version of PDFTron

I was using the previous version of PDFTron for iOS (6.5.4a). Now since a new version is available so I decided to upgrade to 6.7.2 . I am using static framework. Now when I open a pdf, go back from it and again try to open the same pdf the app crashes with the following error :
libc++abi.dylib: terminating with uncaught exception of type trn::Common::Exception: Exception:
Message: Bad image dimensions
Conditional expression: inout_size.x>0 && inout_size.y>0
Version : 6.7.1.53210N
Filename : PDFDraw.cpp
Function : CalcDevMtxFromSize
Linenumber : 239
There have been improvements to image reading, and this exception should no longer occur. Please update to the latest version. If the latest version doesn't help, then we would need access to the file in question.

REMObjects - How to fix LoadFromFile Read Error

I am using Delphi 7, while calling LoadFromFile from my REMObject Type I am randomly encountering a Stream Read Error.
The following line is where I get the error:
FileData.LoadFromFile(QItem.PDFPath);
What can I do to find and fix the error?

Resources