IDE:Fire Version:8.4.96.2033 Target (If relevant): Android Description:
Only the following line will result in a bit weird runtime exception: java.lang.IllegalAccessError: tried to access method geobingancore.android.CachedTileManager.set_pendingTasks:()V from class geobingancore.android.CachedTileManager$3
@ck:
So It came out to be I got a bunch of the similar messages across the project.
And now it seems it actually has to do with actual modifiers.
Here is the clarification:
Conditions to trigger such error:
You have a class the contains the private variable (say base64AuthString).
You have a method that will invoke another method that will execute asynch and as I result with set this private variable in its completionHandler.
So here is such a method:
public func performLogin(withUsername username: String, password: String, completionHandler: (Error?) -> Void) {
guard let base64String = String.base64CredentialString(withUsername: username, andPassword: password) else {
let encodingError = ErrorBuilder.from(errorDescription: "General encoding error")
completionHandler(encodingError)
return
}
guard let userDetailURL = try? URL.constructWithValidation(fromString: apiURLBaseString + "user/details") else {
let encodingError = ErrorBuilder.from(errorDescription: "General encoding error")
completionHandler(encodingError)
return
}
HTTPClient(basicAuthentificationString: base64String).performRequest(withURL: userDetailURL) { (responseº: Response?, dataº: Data?, errorº: Error?) in
if let error = errorº {
completionHandler(error)
return
}
guard let _ = responseº else {
let returnedError = ErrorBuilder.from(errorDescription: "Response missing")
completionHandler(returnedError)
return
}
guard let data = dataº else {
let returnedError = ErrorBuilder.from(errorDescription: "No data in response")
completionHandler(returnedError)
return
}
if (data.toUTF8EncodedString() == "Couldn't authenticate you"){
let returnedError = ErrorBuilder.from(errorDescription: "General login error")
completionHandler(returnedError)
return
}
self.base64AuthString = base64String
#if COOPER
if let context = self._context {
let persistentPropertyList = PersistentPropertyList(applicationContext: context, preferenceFileKey: gLiteral.sharedPreferenceFileKey)
persistentPropertyList.setString(base64String, forKey: self.peristentPropertyListTokenKey)
persistentPropertyList.setString(username, forKey: self.persistentPropertyListTokenUsername)
persistentPropertyList.synchronize()
}
#else
let persistentPropertyList = PersistentPropertyList()
persistentPropertyList.setString(base64String, forKey: self.peristentPropertyListTokenKey)
persistentPropertyList.setString(username, forKey: self.persistentPropertyListTokenUsername)
persistentPropertyList.synchronize()
#endif
completionHandler(nil)
}
}
The problem appears in the generated binary as a result of how the following thing will be digested by the toolchain:
Looking at the decompiled .jar code:
The completionHandler now becomes a nameless class (NamelessClass_13), where original callee of performLogin (OSMAPIManager) will be stored as an ivar.
However as you can see later: self.$self.setbase64AuthString(var8 = (String)self.base64String); will be called, but this generated setter is private, so IllegalAccessError will occur.
Changing the access modifier from private to public will resolve this issue.
yes we redid how anonymous things worked in some regards, sounds like a bug got in. I’ll log and see if your testcase will work, if it’s not enough I’ll ask for something more complete .