Get the NavController after creating a NavHostFragment programmatically - android

I create a NavHostFragment programmatically in the method onCreate method of my Activity just like this article says, but then the method findNavController(R.id.nav_host) throws the following exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{app.klosed.ui/app.klosed.ui.host.HostActivity}: java.lang.IllegalStateException: Activity app.klosed.ui.host.HostActivity#d3f794e does not have a NavController set on 2131231026
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalStateException: Activity app.klosed.ui.host.HostActivity#d3f794e does not have a NavController set on 2131231026
at androidx.navigation.Navigation.findNavController(Navigation.java:61)
at androidx.navigation.ActivityKt.findNavController(Activity.kt:30)
at app.klosed.ui.MainActivity.onCreate(MainActivity.kt:78)
at app.klosed.ui.host.HostActivity.onCreate(HostActivity.kt:32)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
How can I get the NavController object?

Have you try this?
Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.nav_host_fragment);
NavController navController = ((NavHostFragment) Objects.requireNonNull(fragment)).getNavController();

try this
val navController = Navigation.findNavController(this, R.id. nav_host)

Related

java.lang.RuntimeException: Unable to start activity ComponentInfo{<package-name>/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}

I have received numerous Crashlytics reports of an exception my app is throwing, but I have never seen this myself, and I am struggling to understand where it is coming from.
My running theory is that it is related to the Firebase Auth dependency I have - but that dependency isn't actively being used yet. There is a whole sign-up and sign-in flow that my production app has disabled. The only two instances of the library being used in production code is:
// Inside Activity.onCreate()
Firebase.auth.addAuthStateListener {
val user = it.currentUser
if (user != null) {
Firebase.analytics.setUserId(user.uid)
CoroutineScope(Dispatchers.IO).launch {
registerDeviceToken(applicationContext)
}
} else {
Firebase.analytics.setUserId(null)
Firebase.messaging.deleteToken()
}
}
and:
// Called from Activity.onStart()
fun hasPendingMagicLink(intent: Intent): Boolean {
val emailAddress = getMagicLinkEmailAddress()
return emailAddress != null
&& Firebase.auth.currentUser == null
&& Firebase.auth.isSignInWithEmailLink(intent.data.toString())
}
I have included the Crashlytics reports below.
Fatal Exception: java.lang.RuntimeException
Unable to start activity ComponentInfo{com.poliziano.notanotherpomodoroapp/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: java.lang.NullPointerException
android.app.ActivityThread.performLaunchActivity
Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.poliziano.notanotherpomodoroapp/com.google.android.gms.auth.api.signin.internal.SignInHubActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by java.lang.NullPointerException
android.app.ActivityThread.performLaunchActivity
Caused by java.lang.NullPointerException
at java.util.Objects.requireNonNull(Objects.java:203)
at com.google.android.gms.internal.auth-api.zzaz.checkNotNull(zzaz.java:2)
at com.google.android.gms.auth.api.signin.internal.SignInHubActivity.onCreate(SignInHubActivity.java:5)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

Android Navigation findNavController when NavHost is not in Activity

I have an activity which holds FragmentContainerView. In the FragmentContainerView I have a NavHostFragment. I want to setupActionBarWithNavController in the NavHostFragment.
class MenuNavHostFragment : Fragment() {
private lateinit var navController: NavController
fun setup(activity: MainActivity) {
navController = Navigation.findNavController(activity, R.id.fragment_menu_nav_host)
NavigationUI.setupActionBarWithNavController(activity, navController)
}
in MainActivity.kt
private lateinit var menuNavHostFragment: MenuNavHostFragment
private fun setupNavigation() {
menuNavHostFragment = MenuNavHostFragment()
menuNavHostFragment.setup(this)
}
in fragment_menu_nav_host:
...
tools:context=".View.MenuNavHostFragment">
<fragment
android:id="#+id/fragment_menu_nav_host"
android:name="androidx.navigation.fragment.NavHostFragment"
...
Which results in the following error message: ID does not reference a View inside this Activity
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.bla.bla/com.bla.bla.View.MainActivity}: java.lang.IllegalArgumentException: ID does not reference a View inside this Activity
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3261)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1977)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6923)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:870)
Caused by: java.lang.IllegalArgumentException: ID does not reference a View inside this Activity
at android.app.Activity.requireViewById(Activity.java:2686)
at androidx.core.app.ActivityCompat.requireViewById(ActivityCompat.java:363)
at androidx.navigation.Navigation.findNavController(Navigation.java:58)
at com.bla.bla.View.MenuNavHostFragment.setup(MenuNavHostFragment.kt:36)
at com.bla.bla.View.MainActivity.setupNavigation(MainActivity.kt:38)
How do I solve this?
The fragment in which navHostFragment is defined has to be created before calling the Navigation.findNavController() method to avoid this exception.

IllegalStateException: Could not convert SemanticsComponentNode to a View

I have a very simple #Composable function that I am trying to use in my layout. However, it ends up throwing an IllegalStateException and I am unable to figure out what I'm missing here.
class RallyActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
Greeting("Tom")
}
}
}
#Composable
fun Greeting(name: String) {
Text(
"Hello, $name",
TextStyle(fontSize = 48.0F)
)
}
2019-05-09 06:32:33.214 5493-5493/androidx.ui.material.studies E/AndroidRuntime: FATAL EXCEPTION: main
Process: androidx.ui.material.studies, PID: 5493
java.lang.RuntimeException: Unable to start activity ComponentInfo{androidx.ui.material.studies/androidx.ui.material.studies.rally.RallyActivity}: java.lang.IllegalStateException: Could not convert SemanticsComponentNode to a View
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.IllegalStateException: Could not convert SemanticsComponentNode to a View
at androidx.compose.ViewApplyAdapter.end(ViewComposer.kt:104)
at androidx.compose.Applier.up(Applier.kt:53)
at androidx.compose.Composer$realizeSlots$10.invoke(Composer.kt:1049)
at androidx.compose.Composer$realizeSlots$10.invoke(Composer.kt:178)
at androidx.compose.Composer$applyChanges$1.invoke(Composer.kt:270)
at androidx.compose.Composer$applyChanges$1.invoke(Composer.kt:178)
at androidx.compose.SlotTable.write(SlotTable.kt:689)
at androidx.compose.Composer.applyChanges(Composer.kt:269)
at androidx.compose.CompositionContext$recompose$1.invoke(CompositionContext.kt:104)
at androidx.compose.CompositionContext$recompose$1.invoke(CompositionContext.kt:24)
at androidx.compose.CompositionContextKt.runWithCurrent(CompositionContext.kt:128)
at androidx.compose.CompositionContext.recompose(CompositionContext.kt:94)
at androidx.compose.Compose.composeInto(Compose.kt:135)
at androidx.compose.ComposeKt.compose(Compose.kt:265)
at androidx.compose.ComposeKt.setContent(Compose.kt:239)
at androidx.ui.material.studies.rally.RallyActivity.onCreate(RallyActivity.kt:46)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Fixed this issue by wrapping the Greeting composable inside a CraneWrapper and a RallyTheme.
class RallyActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
CraneWrapper {
RallyTheme {
Greeting("Tom")
}
}
}
}
}

Proguard rule setup for mvvm

The code is working fine without Proguard Rule setup. But when I enabled proguard in release build, The project is build successfully. App is installed successfully but while launching the app it crashed every time .
Here is the error log
2018-10-29 13:52:04.299 1942-1942/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.eighsquare.mcoopon, PID: 1942
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.eighsquare.mcoopon/com.eighsquare.mcoopon.ui.splash.SplashActivity}: java.lang.RuntimeException: Cannot create an instance of class com.eighsquare.mcoopon.ui.splash.a
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
Caused by: java.lang.RuntimeException: Cannot create an instance of class com.eighsquare.mcoopon.ui.splash.a
at androidx.lifecycle.v$a.a(ViewModelProvider.java:202)
at androidx.lifecycle.v.a(ViewModelProvider.java:135)
at androidx.lifecycle.v.a(ViewModelProvider.java:103)
at com.eighsquare.mcoopon.base.BaseActivity$b.b(**BaseActivity.kt**:32)
at com.eighsquare.mcoopon.base.BaseActivity$b.a(BaseActivity.kt:16)
at kotlin.o.a(LazyJVM.kt:74)
at com.eighsquare.mcoopon.base.BaseActivity.q(Unknown Source:7)
at com.eighsquare.mcoopon.base.BaseActivity.onCreate(BaseActivity.kt:50)
at android.app.Activity.performCreate(Activity.java:7009)
at android.app.Activity.performCreate(Activity.java:7000)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
Caused by: java.lang.NoSuchMethodException: <init> [class android.app.Application]
at java.lang.Class.getConstructor0(Class.java:2320)
at java.lang.Class.getConstructor(Class.java:1725)
at androidx.lifecycle.v$a.a(ViewModelProvider.java:200)
at androidx.lifecycle.v.a(ViewModelProvider.java:135) 
at androidx.lifecycle.v.a(ViewModelProvider.java:103) 
at com.eighsquare.mcoopon.base.BaseActivity$b.b(BaseActivity.kt:32) 
at com.eighsquare.mcoopon.base.BaseActivity$b.a(BaseActivity.kt:16) 
at kotlin.o.a(LazyJVM.kt:74) 
at com.eighsquare.mcoopon.base.BaseActivity.q(Unknown Source:7) 
at com.eighsquare.mcoopon.base.BaseActivity.onCreate(BaseActivity.kt:50) 
at android.app.Activity.performCreate(Activity.java:7009) 
at android.app.Activity.performCreate(Activity.java:7000) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) 
at android.os.Handler.dispatchMessage(Handler.java:106) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6494) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
when I click on the BaseActivity.kt I am redirected to this code
val viewModel by lazy {
if (viewModelFactory != null)
ViewModelProviders.of(this, viewModelFactory).get(mViewModelClass)
else ViewModelProviders.of(this).get(mViewModelClass)
}
This code is placed in the BaseActivity to create Viewmodel.
Here is My BaseActivity.kt
abstract class BaseActivity<VM : ViewModel, DB : ViewDataBinding>(private val mViewModelClass: Class<VM>) : AppCompatBaseActivity() {
#LayoutRes
abstract fun getLayoutRes(): Int
abstract val viewModelFactory: ViewModelProvider.Factory?
val binding by lazy {
DataBindingUtil.setContentView(this, getLayoutRes()) as DB
}
val viewModel by lazy {
if (viewModelFactory != null)
ViewModelProviders.of(this, viewModelFactory).get(mViewModelClass)
else ViewModelProviders.of(this).get(mViewModelClass)
}
/**
* If you want to inject Dependency Injection
* on your activity, you can override this.
*/
open fun onInject() {}
open fun initView() {}
override fun onCreate(savedInstanceState: Bundle?) {
onInject()
LayoutInflaterCompat.setFactory2(layoutInflater, IconicsLayoutInflater2(delegate))
super.onCreate(savedInstanceState)
initViewModel(viewModel)
initView()
}
/**
*
* You need override this method.
* And you need to set viewModel to binding: binding.viewModel = viewModel
*
*/
abstract fun initViewModel(viewModel: VM)
fun isNetworkConnected(): Boolean {
return NetworkUtils.isNetworkConnected(this)
}
fun hideKeyboard() {
Utils.hideKeyboard(this)
}
fun changeFragment(fragment: Fragment, cleanStack: Boolean = false, addToBackStack: Boolean = true) {
Utils.changeFragment(this, fragment, cleanStack, addToBackStack)
}
}
I am using Dagger2
I lost my 2 hrs in searching the solution. Stackoverflow is the last hope.
After a long research I got a solution.
I Simply needed to add public #Inject constructor in my ViewModel class
eg;
class FullScreenViewModel public #Inject constructor(application: Application) : BaseViewModel<Any?>(application) {}

"You must pass in a non null View" when trying to get Facebook profile picture to ImageView

I'm using Firebase Facebook auth and trying to fetch profile picture to menu ImageView tried everything but it says same thing.
This is the Code in HomeScreen.java that has menu in it, And my Login is in MainScreen.java if you need other codes please let me know.
public class HomeScreen extends AppCompatActivity {
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mToggle;
private Toolbar mToolbar;
private CircleImageView mProfile;
#Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.MyNavTheme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_screen);
mToolbar = (Toolbar) findViewById(R.id.nav_actionbar);
setSupportActionBar(mToolbar);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout);
mToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.opendrawer, R.string.closedrawer);
mDrawerLayout.addDrawerListener(mToggle);
mToggle.syncState();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
/**-------------------Facebook Profile Picture-----------------------*/
mProfile = (CircleImageView) findViewById(R.id.ivProfile);
int dimensionPixelSize = getResources().getDimensionPixelSize(com.facebook.R.dimen.com_facebook_profilepictureview_preset_size_large);
Uri profilePictureUri= Profile.getCurrentProfile().getProfilePictureUri(dimensionPixelSize , dimensionPixelSize);
Glide.with(this).load(profilePictureUri)
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(mProfile);
}
ImageView I'm trying to put it in
<de.hdodenhof.circleimageview.CircleImageView
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="#+id/ivProfile"
android:layout_width="110dp"
android:layout_height="110dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
app:civ_border_width="2dp"
app:civ_border_color="#FFFFFF"/>
Error:
08-02 11:04:46.791 22863-22863/com.shopfolio.shopfolio E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.shopfolio.shopfolio, PID: 22863
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shopfolio.shopfolio/com.shopfolio.shopfolio.HomeScreen}: java.lang.IllegalArgumentException: You must pass in a non null View
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalArgumentException: You must pass in a non null View
at com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:678)
at com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:448)
at com.shopfolio.shopfolio.HomeScreen.onCreate(HomeScreen.java:56)
at android.app.Activity.performCreate(Activity.java:6980)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6540) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
08-02 11:04:46.791 22863-22863/com.shopfolio.shopfolio E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.shopfolio.shopfolio/com.shopfolio.shopfolio.HomeScreen}: java.lang.IllegalArgumentException: You must pass in a non null View
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6540)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.IllegalArgumentException: You must pass in a non null View
at com.bumptech.glide.GenericRequestBuilder.into(GenericRequestBuilder.java:678)
at com.bumptech.glide.DrawableRequestBuilder.into(DrawableRequestBuilder.java:448)
at com.shopfolio.shopfolio.HomeScreen.onCreate(HomeScreen.java:56)
at android.app.Activity.performCreate(Activity.java:6980)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892) 
at android.app.ActivityThread.-wrap11(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6540) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) 
Sorry if it's not clear enough

Categories

Resources