Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Weather App Concurrency and Error Handling Making Our Code Asynchronous

Soumodeep Bhowmick
Soumodeep Bhowmick
4,062 Points

Not getting the JSON data in the log.

The log is below... Please help me out. 04/25 11:43:15: Launching app $ adb install-multiple -r -t D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_3.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_8.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_9.apk D:\Projects\Stormy\app\build\intermediates\resources\instant-run\debug\resources-debug.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_6.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_1.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_0.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\dep\dependencies.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_2.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_7.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_4.apk D:\Projects\Stormy\app\build\intermediates\split-apk\debug\slices\slice_5.apk D:\Projects\Stormy\app\build\intermediates\instant-run-apk\debug\app-debug.apk Split APKs installed in 2 s 159 ms $ adb shell am start -n "com.soumodeep.stormy/com.soumodeep.stormy.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER Client not ready yet..Waiting for process to come online Connected to process 15499 on device Nexus_5X_API_28_x86 [emulator-5554] Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page. W/oumodeep.storm: JIT profile information will not be recorded: profile file does not exits. I/chatty: uid=10112(com.soumodeep.stormy) identical 10 lines W/oumodeep.storm: JIT profile information will not be recorded: profile file does not exits. I/InstantRun: starting instant run server: is main process W/oumodeep.storm: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection) W/oumodeep.storm: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection) D/NetworkSecurityConfig: No Network Security Config specified, using platform default W/oumodeep.storm: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setUseSessionTickets(Z)V (light greylist, reflection) Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setHostname(Ljava/lang/String;)V (light greylist, reflection) Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection) W/oumodeep.storm: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection) Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection) W/oumodeep.storm: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection) Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection) D/OpenGLRenderer: Skia GL Pipeline D/: HostConnection::get() New Host Connection established 0xdd52aa00, tid 15520 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0 I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0 I/OpenGLRenderer: Initialized EGL, version 1.4 D/OpenGLRenderer: Swap behavior 1 W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without... D/OpenGLRenderer: Swap behavior 0 D/EGL_emulation: eglCreateContext: 0xdbc05be0: maj 3 min 1 rcv 4 D/EGL_emulation: eglMakeCurrent: 0xdbc05be0: ver 3 1 (tinfo 0xe33525a0) E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da glUtilsParamSize: unknow param 0x000082da D/EGL_emulation: eglMakeCurrent: 0xdbc05be0: ver 3 1 (tinfo 0xe33525a0)

1 Answer

I'm not sure what version of Android you were using but there has been a behavior change to all apps that target Android 9 Pie and above. By default Http requests don't work. Because the request is not made to Log v does not appear in the Logcat. In order to make http network requests you have to specify it in the Android Manifest file. In the application tag add android: usesCleartextTraffic="true". See stack overflow:

https://stackoverflow.com/questions/51902629/how-to-allow-all-network-connection-types-http-and-https-in-android-9-pie