There is no problem as such however, rather I think the LocationRequest class has some idiosyncrasies which are catching the compiler out in some way ?
Specifically it does not have a ctor, but rather a public static create() method. I have not had any trouble with other Java/Android classes and extended constructors until this one.
I’m not sure whether an extended constructor could/should work in a case such as this or whether the compiler should treat an attempt to use one here as an error ? Just thought I’d mention it.
In a new Android App project for MCVE purposes, the problem doesn’t appear to occur, but it definitely occurs in my actual application. The build error if I use an extended constructor in an instance method:
OK, yes it still happens and I’ve managed to create an MCVE. Rather than starting with an empty project and adding the code that breaks I instead started with my original project and stripped out everything except a minimum to allow the app to run and demonstrate the problem, without needing any of the supporting scaffold (Google Api’s, sign on etc etc) and confirmed that the problem remains.
The problem code is in the LocationService (check the comments around the fRequest member and initialisation of that.
The only other vestigial parts of the original project that remain are the gradle dependencies (altho these are not now actually used) and the external libs references (included in the “libs” subfolder of the project) including the signalr client aar which is duplicated in the project folder itself to enable the build. I left these in on the off-chance that might somehow be involved, though I don’t see how they might be.
Incidentally, the 9.1.100.2107 build seems to have a problem with debugging Android apps.
VS2015 (Community) is crashing and re-starting every time a debug session ends, whether cleanly or not, even if the debug session is expressly “stopped” from within VS itself. To start with I thought it was something I had done in introducing the SignalR support in my project but it’s still happening even with this bare-bones version of the app and (I just checked) also with a brand new, empty “New Android Project”.