Don't have a lot of experience with debugging issues with Android. Have built an app with dotnet MAUI, and since adding a Shiny job to do a Web API call, I'm getting these errors in my logcat:
[07-20 08:11:56.776 1452:4329 D/ConnectivityService]
requestNetwork for uid/pid:10515/17091 activeRequest: null callbackRequest: 1115 [NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ]] callback flags: 0 order: 2147483647
[07-20 08:11:56.782 1452:2148 D/WifiNetworkFactory]
got request NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ]
[07-20 08:11:56.782 1452:2148 D/UntrustedWifiNetworkFactory]
got request NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ]
[07-20 08:11:56.783 1452:2148 D/OemPaidWifiNetworkFactory]
got request NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ]
[07-20 08:11:56.793 17091:17116 F/libc]
Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x78 in tid 17116 (WM.task-4), pid 17091 (uto.myapp)
[07-20 08:12:10.219 17119:17119 F/DEBUG]
Cmdline: com.devonuto.myapp
[07-20 08:12:10.219 17119:17119 F/DEBUG]
pid: 17091, tid: 17116, name: WM.task-4 >>> com.devonuto.myapp <<<
[07-20 08:12:10.219 17119:17119 F/DEBUG]
#00 pc 000000000010a950 /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/lib/arm64/libmonosgen-2.0.so (BuildId: 7126846382da0d3e3df8b79b9e84b9aa48aaaf36)
[07-20 08:12:10.219 17119:17119 F/DEBUG]
#01 pc 000000000010a798 /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/lib/arm64/libmonosgen-2.0.so (BuildId: 7126846382da0d3e3df8b79b9e84b9aa48aaaf36)
[07-20 08:12:10.219 17119:17119 F/DEBUG]
#02 pc 000000000009ab9c /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/lib/arm64/libmonosgen-2.0.so (mono_runtime_invoke+52) (BuildId: 7126846382da0d3e3df8b79b9e84b9aa48aaaf36)
[07-20 08:12:10.219 17119:17119 F/DEBUG]
#03 pc 000000000002af5c /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/lib/arm64/libmonodroid.so (xamarin::android::internal::MonodroidRuntime::Java_mono_android_Runtime_register(_JNIEnv*, _jstring*, _jclass*, _jstring*)+276) (BuildId: f2b35ad7b68e8f683693b4693ca43b2d312da134)
[07-20 08:12:10.219 17119:17119 F/DEBUG]
#06 pc 000000000090d5c0 /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/oat/arm64/base.vdex (crc6401c279856d6dfa9c.ShinyJobWorker.<clinit>+16)
[07-20 08:12:10.220 17119:17119 F/DEBUG]
#23 pc 00000000003db2a8 /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/oat/arm64/base.vdex (androidx.work.WorkerFactory.createWorkerWithDefaultFallback+20)
[07-20 08:12:10.220 17119:17119 F/DEBUG]
#29 pc 00000000003df47e /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/oat/arm64/base.vdex (androidx.work.impl.WorkerWrapper.runWorker+734)
[07-20 08:12:10.220 17119:17119 F/DEBUG]
#35 pc 00000000003df192 /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/oat/arm64/base.vdex (androidx.work.impl.WorkerWrapper.run+32)
[07-20 08:12:10.220 17119:17119 F/DEBUG]
#41 pc 00000000003ee5ac /data/app/~~vGtfU8056GdzOPsvkH9Xwg==/com.devonuto.myapp-9GAii6I21Z8cSs5-r99zdw==/oat/arm64/base.vdex (androidx.work.impl.utils.SerialExecutor$Task.run+4)
[07-20 08:12:18.887 1452:4329 D/ConnectivityService]
ConnectivityService NetworkRequestInfo binderDied(uid/pid:10515/17091, [NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ]], android.os.BinderProxy@fb80569)
[07-20 08:12:18.887 1452:3898 W/ActivityManager]
Scheduling restart of crashed service com.devonuto.myapp/androidx.work.impl.background.systemjob.SystemJobService in 1000ms for connection
[07-20 08:12:18.887 1452:2155 D/ConnectivityService]
releasing NetworkRequest [ REQUEST id=1116, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VCN_MANAGED Uid: 10515 RequestorUid: 10515 RequestorPkg: com.devonuto.myapp UnderlyingNetworks: Null] ] (release request)
The developer of Shiny isn't interested in helping with issues using Alpha releases, but basically I just want to work out if this is something I have done wrong, or a bug with the Shiny Alpha MAUI release?
in MauiProgram.cs I have:
// Shiny Jobs
builder.Services.AddJob(new JobInfo(typeof(DataRefreshJob), nameof(DataRefreshJob), false)
{
RequiredInternetAccess = InternetAccess.Any,
}, true);
And in my DataRefreshJob.cs, the Run task is essentially:
public async Task Run(JobInfo jobInfo, CancellationToken cancelToken)
{
_service = AppService.GetService<IMethodService>();
_ = _service.GetScheduledApiData();
}
Looking at the LogCat, is it having exception with the ConnectivityService? Something to do with: RequiredInternetAccess = InternetAccess.Any?
Any advice would be appreciated. Thanks.
For anyone who may stumble upon this, it was not caused by the Shiny Job, instead was caused by using SemaphoreSlims used to control concurrent calls to an API.
Job appeared to be the source, as it was kicking off a bunch of async API calls. When those calls hit the SemaphoreSlim waitasync() it was causing the SEGV_MAPERR.
Removing the use of semaphore slim, and queing the async API calls up instead solved the issue.