nextcloud / nextcloud/android

widget crashes when not logged in

Open
#16,516 0 comments 0 reactions 0 assignees View on GitHub
0. Needs triage bug feature: dashboard and widgets performance: ISE/IAE :confused:
Dominant language
Kotlin
Stars
5.6k
Forks
2k
Avg merge
2d 18h
Merged PRs (30d)
92

Description

### ⚠️ Before posting ⚠️

- [x] This is a **bug**, not a question or an enhancement.
- [x] I've [searched for similar issues](https://github.com/nextcloud/android/issues) and didn't find a duplicate.
- [x] I've written a clear and descriptive title for this issue, not just "Bug" or "Crash".
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/).

### Steps to reproduce

Attempt to add the 3x4 widget to the homepage.

### Expected behaviour

Widget on homepage

### Actual behaviour

Crash with code dump

### Cause of error
```java
Exception in thread "DefaultDispatcher-worker-1" com.nextcloud.client.network.ClientFactory$CreationException: com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:51)
at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Caused by: Exception in thread "DefaultDispatcher-worker-1" com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
at com.owncloud.android.lib.common.accounts.AccountUtils.getBaseUrlForAccount(AccountUtils.java:72)
at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:198)
at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:182)
at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:49)
at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30350290`
* Build flavor: `generic`

### Device information
* Brand: `google`
* Device: `akita`
* Model: `Pixel 8a`
* Id: `BP4A.260205.001`
* Product: `akita`

### Firmware
* SDK: `36`
* Release: `16`
* Incremental: `14624666`

### Android version

16

### Device brand and model

pixel 8a

### Stock or custom OS?

Stock

### Nextcloud android app version

3.25.2

### Nextcloud server version

latest

### Using a reverse proxy?

I don't know

### Android logs

### Cause of error
```java
Exception in thread "DefaultDispatcher-worker-1" com.nextcloud.client.network.ClientFactory$CreationException: com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:51)
at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)
Caused by: Exception in thread "DefaultDispatcher-worker-1" com.owncloud.android.lib.common.accounts.AccountUtils$AccountNotFoundException: Account not found
at com.owncloud.android.lib.common.accounts.AccountUtils.getBaseUrlForAccount(AccountUtils.java:72)
at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:198)
at com.owncloud.android.lib.common.OwnCloudClientFactory.createNextcloudClient(OwnCloudClientFactory.java:182)
at com.nextcloud.client.network.ClientFactoryImpl.createNextcloudClient(ClientFactoryImpl.java:49)
at com.nextcloud.client.widget.DashboardWidgetConfigurationActivity$loadWidgets$1.invokeSuspend(DashboardWidgetConfigurationActivity.kt:139)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:589)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:823)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

```

### App information
* ID: `com.nextcloud.client`
* Version: `30350290`
* Build flavor: `generic`

### Device information
* Brand: `google`
* Device: `akita`
* Model: `Pixel 8a`
* Id: `BP4A.260205.001`
* Product: `akita`

### Firmware
* SDK: `36`
* Release: `16`
* Incremental: `14624666`

### Server error logs

```bash

```

### Additional information

I am not logged into my server. I just wanted to see the widget appearance.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.