1

Estoy intentado solucionar este problema: Cannot resolve symbol ProcessLifecycleOwner pero no encuentro la manera, he probado a importar import android.arch.lifecycle.ProcessLifecycleOwner; sin éxito.

El error me salta en esta parte de mi código:

if(ProcessLifecycleOwner.get().getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED)) {
                        nAdView.show();
                    }else {
                        Log.d("AppInBackground", "App Is In Background Ad Is Not Going To Show");
                    }

Esta extraído de aquí https://stackoverflow.com/questions/57234180/issue-violation-of-interfering-with-apps-third-party-ads-or-device-functional

Saludos y gracias de antemano

6
  • 1
    Utilizas android studio verdad? en el import te lo marca como rojo?
    – Wilmer
    el 1 sep. 2019 a las 14:54
  • @Wilmer efectivamente, me pasa eso exactamente
    – Gorpe
    el 1 sep. 2019 a las 14:55
  • 1
    En android studio dale a Build -> Clean Project para sincronizar todas las dependencias
    – Wilmer
    el 1 sep. 2019 a las 15:02
  • 1
    agrega esto a tu gradle implementation 'android.arch.lifecycle:extensions:1.1.0' implementation 'android.arch.lifecycle:compiler:1.1.0'
    – Wilmer
    el 1 sep. 2019 a las 15:14
  • Solucionado, muchas gracias @Wilmer
    – Gorpe
    el 1 sep. 2019 a las 16:07

1 respuesta 1

1

Agrega esto a tu configuracion gradle

implementation 'android.arch.lifecycle:extensions:1.1.0' 
implementation 'android.arch.lifecycle:compiler:1.1.0'

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.