AkshayChordiya / News

A sample News 🗞 app built using Modern Android Development [Architecture Components, Coroutines, Retrofit, Room, Kotlin, Dagger]
MIT License
848 stars 166 forks source link

App only displays a blank screen #8

Closed nirvik66 closed 6 years ago

nirvik66 commented 6 years ago

I tried running your project but all I get is a blank screen.

Here are the logs,

03-03 21:43:28.318 10149-10149/? I/art: Not late-enabling -Xcheck:jni (already on)
03-03 21:43:28.318 10149-10149/? W/art: Unexpected CPU variant for X86 using defaults: x86
03-03 21:43:28.334 10149-10156/? I/art: Debugger is no longer active
03-03 21:43:28.334 10149-10156/? I/art: Starting a blocking GC Instrumentation
03-03 21:43:28.439 10149-10149/? I/art: Starting a blocking GC AddRemoveAppImageSpace
03-03 21:43:28.563 10149-10149/? W/System: ClassLoader referenced unknown path: /data/app/com.akshay.newsapp-1/lib/x86
03-03 21:43:28.568 10149-10149/? I/InstantRun: starting instant run server: is main process
03-03 21:43:28.591 10149-10149/? D/DebugDB: Open http://0.0.0.0:8081 in your browser
03-03 21:43:28.633 10149-10149/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-03 21:43:28.743 10149-10149/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
03-03 21:43:28.767 10149-10149/? D/Main: Res = Resource(status=LOADING, data=null, message=null)
03-03 21:43:28.767 10149-10149/? D/Main: Data = null
03-03 21:43:28.807 10149-10149/? D/Main: Res = Resource(status=LOADING, data=[], message=null)
03-03 21:43:28.807 10149-10149/? D/Main: Data = []

                                         [ 03-03 21:43:28.824 10149:10175 D/         ]
                                         HostConnection::get() New Host Connection established 0xa11ab300, tid 10175
03-03 21:43:28.825 10149-10175/? I/OpenGLRenderer: Initialized EGL, version 1.4
03-03 21:43:28.825 10149-10175/? D/OpenGLRenderer: Swap behavior 1
03-03 21:43:28.825 10149-10175/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
03-03 21:43:28.825 10149-10175/? D/OpenGLRenderer: Swap behavior 0
03-03 21:43:28.833 10149-10175/? D/EGL_emulation: eglCreateContext: 0x9caf8e40: maj 2 min 0 rcv 2
03-03 21:43:28.849 10149-10175/? D/EGL_emulation: eglMakeCurrent: 0x9caf8e40: ver 2 0 (tinfo 0x9caabc30)
03-03 21:43:28.870 10149-10149/? W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
03-03 21:43:28.875 10149-10175/? D/EGL_emulation: eglMakeCurrent: 0x9caf8e40: ver 2 0 (tinfo 0x9caabc30)
03-03 21:43:28.944 10149-10175/? D/EGL_emulation: eglMakeCurrent: 0x9caf8e40: ver 2 0 (tinfo 0x9caabc30)

The app requests the news to the network, but it never updates with the proper data.

Can anyone double check if it's working?

Thanks

AkshayChordiya commented 6 years ago

@nirvik66 The log state that LOADING started:

03-03 21:43:28.767 10149-10149/? D/Main: Res = Resource(status=LOADING, data=null, message=null)
03-03 21:43:28.767 10149-10149/? D/Main: Data = null
03-03 21:43:28.807 10149-10149/? D/Main: Res = Resource(status=LOADING, data=[], message=null)
03-03 21:43:28.807 10149-10149/? D/Main: Data = []

But there is no log of error or success.

Kindly check the following points:

nirvik66 commented 6 years ago

Thanks for your quick response! It's weird but the code wasn't working using the emulator. I tried on a real device and it's working fine! Sorry for the inconvenience

AkshayChordiya commented 6 years ago

No problem. Then probably your emulator was not connected to web. I had faced this problem before.