NeoApplications / Neo-Feed

a custom Google Now Feed alternative for launchers
GNU General Public License v3.0
148 stars 6 forks source link

Nullpointer Exception in the Neo Launcher Feed #28

Open RyanKoech opened 6 months ago

RyanKoech commented 6 months ago

Describe the bug Trying to open an new article in the Neo Lancher Feed causes crash

To Reproduce Steps to reproduce the behavior:

  1. Install latest Neo-Feed on main branch and set any RSS feed provider of choice
  2. Go to Install Neo Launcher. Head at this commit
  3. Go to launcher settings, Search & Feed, Set Neo Feed as Launcher Feed
  4. Go back to home screen
  5. Scroll right to open feed from left
  6. Click any article
  7. Observe crash

Expected behavior News article page should open

Neo Feed Version(please complete the following information):

Smartphone (please complete the following information):

Additional context FATAL EXCEPTION: main Process: com.saulhdev.neofeed.dev, PID: 6917 java.lang.NullPointerException at com.saulhdev.feeder.overlay.ComposeOverlayView.getActivityResultRegistry(ComposeOverlayView.kt:115) at androidx.activity.compose.ActivityResultRegistryKt.rememberLauncherForActivityResult(ActivityResultRegistry.kt:96) at com.saulhdev.feeder.compose.pages.OverlayPageKt.OverlayPage(OverlayPage.kt:123) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1$1$1.invoke(ComposeOverlayView.kt:94) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1$1$1.invoke(ComposeOverlayView.kt:93) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at org.kodein.di.compose.WithDIKt$withDI$7.invoke(WithDI.kt:35) at org.kodein.di.compose.WithDIKt$withDI$7.invoke(WithDI.kt:35) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at org.kodein.di.compose.WithDIKt.withDI(WithDI.kt:35) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1$1.invoke(ComposeOverlayView.kt:93) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1$1.invoke(ComposeOverlayView.kt:92) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.material3.TextKt.ProvideTextStyle(Text.kt:352) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:74) at androidx.compose.material3.MaterialThemeKt$MaterialTheme$1.invoke(MaterialTheme.kt:73) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.material3.MaterialThemeKt.MaterialTheme(MaterialTheme.kt:66) at com.saulhdev.feeder.theme.AppThemeKt.AppTheme(AppTheme.kt:38) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1.invoke(ComposeOverlayView.kt:92) at com.saulhdev.feeder.overlay.ComposeOverlayView$onCreate$1.invoke(ComposeOverlayView.kt:90) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.ui.platform.ComposeView.Content(ComposeView.android.kt:428) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:252) at androidx.compose.ui.platform.AbstractComposeView$ensureCompositionCreated$1.invoke(ComposeView.android.kt:251) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.CompositionLocalsKt.ProvideCommonCompositionLocals(CompositionLocals.kt:186) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:119) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt$ProvideAndroidCompositionLocals$3.invoke(AndroidCompositionLocals.android.kt:118) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) 2023-12-12 11:45:47.121 6917-6917 AndroidRuntime com.saulhdev.neofeed.dev E at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228) at androidx.compose.ui.platform.AndroidCompositionLocals_androidKt.ProvideAndroidCompositionLocals(AndroidCompositionLocals.android.kt:110) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:139) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1$2.invoke(Wrapper.android.kt:138) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:248) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:138) at androidx.compose.ui.platform.WrappedComposition$setContent$1$1.invoke(Wrapper.android.kt:123) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:108) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35) at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:93) at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3284) at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3217) at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:721) at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:1059) at androidx.compose.runtime.CompositionImpl.composeInitial(Composition.kt:629) at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:615) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:123) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.setOnViewTreeOwnersAvailable(AndroidComposeView.android.kt:1287) at androidx.compose.ui.platform.WrappedComposition.setContent(Wrapper.android.kt:114) at androidx.compose.ui.platform.WrappedComposition.onStateChanged(Wrapper.android.kt:164) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:121) at androidx.compose.ui.platform.WrappedComposition$setContent$1.invoke(Wrapper.android.kt:114) at androidx.compose.ui.platform.AndroidComposeView.onAttachedToWindow(AndroidComposeView.android.kt:1362) at android.view.View.dispatchAttachedToWindow(View.java:21980) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3490) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3497) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3014) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2465) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9305) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1339) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1348) at android.view.Choreographer.doCallbacks(Choreographer.java:952) at android.view.Choreographer.doFrame(Choreographer.java:882) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1322) at android.os.Handler.handleCallback(Handler.java:958) at android.os.Handler.dispatchMessage(Handler.java:99) 2023-12-12 11:45:47.121 6917-6917 AndroidRuntime com.saulhdev.neofeed.dev E at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:294) at android.app.ActivityThread.main(ActivityThread.java:8177) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

saulhdev commented 5 months ago

Thanks for the feedback. I am migrating to compose views and I still have to find a way to get the activity from the overlay view.