Comments (13)
287 isn’t in public nuget yet. Please wait for public releases before filing defects on it. I only work on master so I don’t always have things in order yet
from shiny.
Your NRE is happening during the geofence process. Is it coming from your delegate code perhaps?
- I'm actually going to move this to an individual call instead of an array.
- based on 1, this won't matter
- This is by design. StartupTasks must all pass (unless the author of the task doesn't need them to) as it was designed for wiring up infrastructure. If they fail, they should crash otherwise you can start seeing missing behavior in your app potentially.
from shiny.
I'm going to consider this closed case for now. Anything related can be a separate issue at this point.
from shiny.
I only work on dev I meant. So things keep pushing to myget
from shiny.
I couldn't reproduce this. By crash, are you meaning it is showing up in the logging in the sample?
from shiny.
I haven't seen it yet in the Sample (not certain what Shiny build it's using - that would be a neat addition to the Environment screen), but it has now happened twice in the real app I'm close to releasing.
I do want to correct myself: it's being tracked as an error, not a crash, presumably here:
shiny/src/Shiny.Locations/Platforms/Android/GeofenceManagerImpl.cs
Lines 47 to 56 in cfdb474
A few comments on that log call in particular:
- What if each
region.Create()
had its owntry
/catch
to include region details with the exception? AggregateException
being a generally unhelpful wrapper around the actual error(s), I wonder about having the Shiny Logging infrastructure check forAggregateException
and log theInnerExceptions
directly.- Thoughts on having the infrastructure that calls
IShinyStartupTask.Start()
handle the generaltry
/catch
, rather than individual tasks needing to do it?
I need to check with the guy testing the app, but this error may be due to attempting to recreate the geofence after revoking permission for Locations.
from shiny.
- What if each
region.Create()
had its owntry
/catch
to include region details with the exception?
Took a shot at this: #40. I believe this will avoid this particular AggregateException
as well.
from shiny.
I need to check with the guy testing the app, but this error may be due to attempting to recreate the geofence after revoking permission for Locations.
I can't rule out permissions, but I thought I'd mention I have a separate crash report specifically related to permissions:
android.os.Parcel.createException
Parcel.java, line 1950
java.lang.SecurityException: Geofence usage requires ACCESS_FINE_LOCATION permissionandroid.os.Parcel.createException Parcel.java:1950
android.os.Parcel.readException Parcel.java:1918
android.os.Parcel.readException Parcel.java:1868
com.google.android.gms.internal.zzeb.zzb
com.google.android.gms.internal.zzbzl.zza
com.google.android.gms.internal.zzbzu.zza
com.google.android.gms.internal.zzbzc.zza
com.google.android.gms.common.api.internal.zzm.zzb
com.google.android.gms.common.api.internal.zzc.zza
com.google.android.gms.common.api.internal.zzbr.zzb
com.google.android.gms.common.api.internal.zzbr.zza
com.google.android.gms.common.api.internal.zzbp.handleMessage
android.os.Handler.dispatchMessage Handler.java:102
android.os.Looper.loop Looper.java:193
android.os.HandlerThread.run HandlerThread.java:65
I'd be curious to read your thoughts on the "Shiny way" to handle this, pre-create and if permissions are lost after the geofence is originally added to Shiny's repository.
Your NRE is happening during the geofence process. Is it coming from your delegate code perhaps?
I'd expect my code to appear in a stack trace if it were, but I doubt it:
private class GeofenceDelegate : IGeofenceDelegate
{
public async Task OnStatusChanged(GeofenceState newStatus, GeofenceRegion region)
{
Analytics.TrackEvent("Geofence Change", new Dictionary<string, string>
{
{ "id", region?.Identifier },
{ "center", region?.Center?.ToString() },
{ "radius", region?.Radius?.ToString() },
{ "status", newStatus.ToString() },
});
switch (newStatus)
{
case GeofenceState.Entered:
await Api.Post.GeofenceTrigger(region.Identifier, true);
break;
case GeofenceState.Exited:
await Api.Post.GeofenceTrigger(region.Identifier, false);
break;
}
}
}
from shiny.
Your NRE is happening during the geofence process.
I was looking for where it might have been logged. You're thinking it's in here:
via
shiny/src/Shiny.Core/Platforms/Android/Dispatcher.cs
Lines 11 to 21 in cfd1ed4
Odd that the error was reported as GeofenceManagerImpl.Process(Intent)
.
from shiny.
Odd that the error was reported as GeofenceManagerImpl.Process(Intent).
The code of where Process was happening has moved in dev which is why you aren't seeing it relating to your error.
I'd be curious to read your thoughts on the "Shiny way" to handle this, pre-create and if permissions are lost after the geofence is originally added to Shiny's repository.
The permissions error makes sense and there isn't much I can do about that. This is the reason I try to blindly restore the geofences on boot. If permission has been pulled, you'll likely want to do check when your app is in the foreground. I could downgrade the log to an event instead of an error. May even add a category specifically around this type of issue
I'd expect my code to appear in a stack trace if it were, but I doubt it:
I'm still not seeing where the NRE could be. Is there more to the stack trace in your appcenter log?
from shiny.
I'd expect my code to appear in a stack trace if it were, but I doubt it:
I'm still not seeing where the NRE could be. Is there more to the stack trace in your appcenter log?
There is not. Not sure if that's due to AggregateException or how Dispatcher Task handling works or something else. I can bump to the latest beta to see if this persists.
Beyond #40, which now seems unlikely to be related to what I am seeing, I am not sure how to get a better trace on my actual error. 🤔
I did try revoking Location permission for the sample app with geofences configured…no errors logged so far. 🤷♂️
from shiny.
Note: I reformatted the original exception stack trace as code, as some of the generics (specifically <OnReceive>
) were being interpreted as HTML. I'm looking closer at the Process()
code that moved in 1efa4eb, and there are a couple NRE opportunities:
shiny/src/Shiny.Locations/Platforms/Android/GeofenceManagerImpl.cs
Lines 60 to 68 in 5cff99d
I took a closer look at the GeofencingEvent
docs and I'm reasonably certain it's an unhandled geofence error. PR incoming (separate from #40).
from shiny.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from shiny.
Related Issues (20)
- [Bug]: MAUI iOS token not working with Firebase. (Previously under issue #1377) HOT 4
- [Bug]: IBleDelegate::OnAdapterStateChanged is not called HOT 1
- [Bug]: IPeripheral's connection state is not updated after .Scan() running again HOT 4
- [Bug]: App in background or not running. No any event fires under Android HOT 1
- net8.0 support for Maui HOT 5
- [Bug]: Location Permission Always Requester does not work (or appear) HOT 3
- [Bug]: Android does not throw a Disconnected into the BleDelegate HOT 1
- IBleManager.IsScanning is always False in Apple
- [Bug]: IPeripheral's connection state is not updated after .Scan() running again HOT 3
- [Bug]: Bug with NotifyCharacteristic Subscription HOT 1
- Cannot send local notification with a ScheduleDate set using 3.2.4 HOT 6
- [Feature Request]: Allow specifying user-agent header on NSURLSession Config HOT 1
- [Bug]: actionIdentifier not available in OnEntry delegate for Push Notifications HOT 1
- [Bug]: ServiceCollectionExtensions.AddBluetoothLE() throws "System.InvalidOperationException: This service descriptor is keyed. Your service provider may not support keyed services." HOT 2
- [Bug]: Shiny not working with Azure Notification Hub and FCM V1 HOT 3
- [Bug]: CharacteristicExtensions.GetAllCharacteristics returns only characteristics of the latest found service
- [Bug]: Setting up Shiny services for MAUI with .Net 8.0 support HOT 3
- [Bug]: await IBleManager.RequestAccessAsync() never returns a completed task the first time asking for permissions HOT 6
- [Bug]: Cannot use ScheduleDate and RepeatInterval at the same time HOT 1
- [Bug]: Connecting and disconnecting the connection does not work reliably HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shiny.