owncloud / owncloud/android

[BUG] Crash in Google Play - MissingAndroidContextException

Open
#3,586 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Crash p2-high Type:bug
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

org.koin.android.error.MissingAndroidContextException: 
  at org.koin.android.ext.koin.ModuleExtKt.androidContext (ModuleExt.kt:33)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$3.invoke (RemoteDataSourceModule.kt:65)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$3.invoke (RemoteDataSourceModule.kt:65)
  at org.koin.core.instance.InstanceFactory.create (InstanceFactory.kt:50)
  at org.koin.core.instance.SingleInstanceFactory.create (SingleInstanceFactory.kt:40)
  at org.koin.core.instance.SingleInstanceFactory.get (SingleInstanceFactory.kt:48)
  at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core (InstanceRegistry.kt:87)
  at org.koin.core.scope.Scope.resolveInstance (Scope.kt:214)
  at org.koin.core.scope.Scope.get (Scope.kt:181)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$5.invoke (RemoteDataSourceModule.kt:95)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$5.invoke (RemoteDataSourceModule.kt:69)
  at org.koin.core.instance.InstanceFactory.create (InstanceFactory.kt:50)
  at org.koin.core.instance.SingleInstanceFactory.create (SingleInstanceFactory.kt:40)
  at org.koin.core.instance.SingleInstanceFactory.get (SingleInstanceFactory.kt:48)
  at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core (InstanceRegistry.kt:87)
  at org.koin.core.scope.Scope.resolveInstance (Scope.kt:214)
  at org.koin.core.scope.Scope.get (Scope.kt:181)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$12.invoke (RemoteDataSourceModule.kt:95)
  at com.owncloud.android.dependecyinjection.RemoteDataSourceModuleKt$remoteDataSourceModule$1$12.invoke (RemoteDataSourceModule.kt:77)
  at org.koin.core.instance.InstanceFactory.create (InstanceFactory.kt:50)
  at org.koin.core.instance.FactoryInstanceFactory.get (FactoryInstanceFactory.kt:36)
  at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core (InstanceRegistry.kt:87)
  at org.koin.core.scope.Scope.resolveInstance (Scope.kt:214)
  at org.koin.core.scope.Scope.get (Scope.kt:181)
  at com.owncloud.android.dependecyinjection.RepositoryModuleKt$repositoryModule$1$2.invoke (RepositoryModule.kt:57)
  at com.owncloud.android.dependecyinjection.RepositoryModuleKt$repositoryModule$1$2.invoke (RepositoryModule.kt:44)
  at org.koin.core.instance.InstanceFactory.create (InstanceFactory.kt:50)
  at org.koin.core.instance.FactoryInstanceFactory.get (FactoryInstanceFactory.kt:36)
  at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core (InstanceRegistry.kt:87)
  at org.koin.core.scope.Scope.resolveInstance (Scope.kt:214)
  at org.koin.core.scope.Scope.get (Scope.kt:181)
  at com.owncloud.android.dependecyinjection.UseCaseModuleKt$useCaseModule$1$9.invoke (UseCaseModule.kt:105)
  at com.owncloud.android.dependecyinjection.UseCaseModuleKt$useCaseModule$1$9.invoke (UseCaseModule.kt:69)
  at org.koin.core.instance.InstanceFactory.create (InstanceFactory.kt:50)
  at org.koin.core.instance.FactoryInstanceFactory.get (FactoryInstanceFactory.kt:36)
  at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core (InstanceRegistry.kt:87)
  at org.koin.core.scope.Scope.resolveInstance (Scope.kt:214)
  at org.koin.core.scope.Scope.get (Scope.kt:181)
  at com.owncloud.android.presentation.manager.AvatarManager$getAvatarForAccount$$inlined$inject$default$1.invoke (KoinComponent.kt:67)
  at kotlin.UnsafeLazyImpl.getValue (Lazy.kt:81)
  at com.owncloud.android.presentation.manager.AvatarManager.getAvatarForAccount$lambda-1 (AvatarManager.kt:68)
  at com.owncloud.android.presentation.manager.AvatarManager.getAvatarForAccount (AvatarManager.kt:69)
  at com.owncloud.android.utils.AvatarUtils$loadAvatarForAccount$1.invokeSuspend (AvatarUtils.kt:62)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)
Screenshot 2022-03-15 at 17 26 43

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with RemoteDataSourceModule.kt at lines 65 and 95, then trace how AvatarManager.kt lines 68-69 reaches AvatarUtils.kt line 62. Investigate why the Google Play path lacks the Android context expected by Koin; done means reproducing the crash path and preventing MissingAndroidContextException there.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.