Authentication error with AppAuth Android - android

I´m trying to run my AppAuth Android in my Gluu Server 4.3 installed on my Ubuntu 20, but my app shows a "Failed to retrieve discovery document: Network error.
The only changes i do are in the manifest and the json conf
The manifest changes:
<activity
android:name="net.openid.appauth.RedirectUriReceiverActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https"
android:host="appopenid.org"
android:path="/oauth2redirect"/>
</intent-filter>
The config changes
{
"client_id": "c23cdb4c-6539-4045-90db-71171d594ffe",
"redirect_uri": "https://appopenid.org/oauth2redirect",
"end_session_redirect_uri": "https://appopenid.org/oauth2redirect",
"authorization_scope": "openid email profile",
"discovery_uri": "https://test7.gluu.org/.well-known/openid-configuration",
"authorization_endpoint_uri": "",
"token_endpoint_uri": "",
"registration_endpoint_uri": "",
"user_info_endpoint_uri": "",
"https_required": true
}
The error log
D/HostConnection: HostConnection::get() New Host Connection established 0xf326d3b0, tid 8608
D/goldfish-address-space: allocate: Ask for block of size 0x100
D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3ebffe000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_2
E/AppAuth: Network error when retrieving discovery document
I/LoginActivity: Failed to retrieve discovery document
W/System: A resource failed to call close.
I found that it could be cause my https redirect uri is not trusted but i don´t know how to solve it. Thank you so much

Related

Cannot connect to http sites with Volley (Andoid, Kotlin) (https works fine)

This is the first time that I am dipping my toes into andoroid development. For this I decided to make a little project to get into it.
My settup:
I want to control an led strip with a Raspberry Pi Pico W with my own android app. The Pico hosts a Webpage that I can access with its local IP adress. To change the LED's I can go to, for eg:192.168.0.201/setrgb/255/000/000 this would make the LED strip Red. (This works fine in a browser)
Using this article I set up a simple string request with volley. Using the example "https://www.google.com" works just fine and I get the html code of google.com as a string. However whenever I try to access my Pico it prints: "that didn't work" (see the code below). It also doesn't work with "http://www.columbia.edu/~fdc/sample.html" although I don't really know why.
Could it have something to do with the fact that google uses https and the other use http?
println("start")
val queue = Volley.newRequestQueue(this)
val url = "http://192.168.0.201/setrgb/000/000/000"
val stringRequest = StringRequest(Request.Method.GET, url,
{ response ->
println((url))
println("response:")
println(response)
println("end of response")
},
{ println("that didn't work")
println(url)})
// Add the request to the RequestQueue.
queue.add(stringRequest)
This is the output:
System.out I start
Volley V [61] CacheDispatcher.run: start new dispatcher
System.out I damn
Volley D [61] WaitingRequestManager.maybeAddToWaitingRequests: new request, sending to network http://192.168.0.201/setrgb/000/000/000
HostConnection D createUnique: call
HostConnection D HostConnection::get() New Host Connection established 0x7cfd607d6010, tid 32234
HostConnection D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_
OpenGLRenderer W Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
OpenGLRenderer W Failed to initialize 101010-2 format, error = EGL_SUCCESS
EGL_emulation D eglCreateContext: 0x7cfd607d8290: maj 2 min 0 rcv 2
EGL_emulation D eglMakeCurrent: 0x7cfd607d8290: ver 2 0 (tinfo 0x7cff77380080) (first time)
Gralloc4 I mapper 4.x is not supported
HostConnection D createUnique: call
HostConnection D HostConnection::get() New Host Connection established 0x7cfd607d7b10, tid 32234
goldfish-address-space D allocate: Ask for block of size 0x100
goldfish-address-space D allocate: ioctl allocate returned offset 0x3ebffe000 size 0x2000
Gralloc4 W allocator 4.x is not supported
HostConnection D HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_vulkan_queue_submit_with_commands ANDROID_EMU_sync_buffer_data ANDROID_EMU_read_color_buffer_dma ANDROID_EMU_hwc_multi_configs GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_gles_max_version_
Parcel W Expecting binder but got null!
System.out I that didn't work
System.out I http://192.168.0.201/setrgb/000/000/000
Volley D [2] MarkerLog.finish: (298 ms) [ ] http://192.168.0.201/setrgb/000/000/000 0x85adfa16 NORMAL 1
Volley D [2] MarkerLog.finish: (+0 ) [ 2] add-to-queue
Volley D [2] MarkerLog.finish: (+1 ) [61] cache-queue-take
Volley D [2] MarkerLog.finish: (+0 ) [61] cache-miss
Volley D [2] MarkerLog.finish: (+0 ) [62] network-queue-take
Volley D [2] MarkerLog.finish: (+7 ) [62] post-error
Volley D [2] MarkerLog.finish: (+290 ) [ 2] done
There seems to be some sort of "post-error", but I really don't know why and I can't really find anything though google.
The Following is the output if I use a working website like google.com:
[2] MarkerLog.finish: (+0 ) [ 2] add-to-queue
[2] MarkerLog.finish: (+2 ) [76] cache-queue-take
[2] MarkerLog.finish: (+0 ) [76] cache-miss
[2] MarkerLog.finish: (+1 ) [77] network-queue-take
[2] MarkerLog.finish: (+340 ) [77] network-http-complete
[2] MarkerLog.finish: (+5 ) [77] network-parse-complete
[2] MarkerLog.finish: (+3 ) [77] network-cache-written
[2] MarkerLog.finish: (+0 ) [77] post-response
[2] MarkerLog.finish: (+338 ) [ 2] done
Does anyone know how to fix this or do you have other ideas how to achive what I want?
I ended up figuring it out myself.
The problem had to do with the fact that the website I tried to access used http instead of https:
To give permission to acces http websites I added folowing line to the manifest.xml file:
android:usesCleartextTraffic="true"
It goes after <application.

Getting error in changing the text of TextView in Kotlin - Android

I'm new to android development(just started a few hours ago) and just to see how things work im trying like when button is clicked the text of TextView should change, but the app crashes when it reaches that line. Can anyone please suggest me what changes should I make.
MainActivity.kt
package com.example.ruthvikapplication
import android.os.Bundle
import android.widget.Button
import android.widget.RatingBar
import android.widget.TextView
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val button1=findViewById<Button>(R.id.button)
val ratingBar1= findViewById<RatingBar>(R.id.ratingBar)
val title1= findViewById<TextView>(R.id.title)
button1.setOnClickListener{
Toast.makeText(this#MainActivity, "Your rating"+ratingBar1.rating.toString(), Toast.LENGTH_SHORT).show()
title1.text= "Thanks for rating!!" // app crashes here...
}
}
}
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#00FFCC"
tools:context=".MainActivity">
<TextView
android:id="#+id/myTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:rotationX="33"
android:text="Please rate this app!!"
android:textColor="#FF0000"
android:textSize="34sp"
android:textStyle="bold|italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rate"
app:backgroundTint="#FFC800"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="#+id/ratingBar"
app:layout_constraintTop_toBottomOf="#+id/myTitle" />
<RatingBar
android:id="#+id/ratingBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="10dp"
android:layout_marginRight="10dp"
android:background="#00FFCC"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="#+id/button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="#+id/myTitle"
tools:ignore="SpeakableTextPresentCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
The console
09/25 21:43:43: Launching 'app' on Pixel 5 API 30.
Install successfully finished in 4 s 826 ms.
$ adb shell am start -n "com.example.ruthvikapplication/com.example.ruthvikapplication.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 6745 on device 'Pixel_5_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/System: A resource failed to call close.
W/hvikapplicatio: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
W/hvikapplicatio: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
D/HostConnection: HostConnection::get() New Host Connection established 0xee45b910, tid 6768
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xee460760: maj 2 min 0 rcv 2
D/EGL_emulation: eglMakeCurrent: 0xee460760: ver 2 0 (tinfo 0xee7b43f0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xee461330, tid 6768
D/goldfish-address-space: allocate: Ask for block of size 0x100
D/goldfish-address-space: allocate: ioctl allocate returned offset 0x34dffc000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_has_shared_slots_host_memory_allocator ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit ANDROID_EMU_sync_buffer_data GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
I/Choreographer: Skipped 45 frames! The application may be doing too much work on its main thread.
I/OpenGLRenderer: Davey! duration=792ms; Flags=0, IntendedVsync=1872865754256, Vsync=1873615754226, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1873628675300, AnimationStart=1873628792800, PerformTraversalsStart=1873630847400, DrawStart=1873631928700, SyncQueued=1873632253400, SyncStart=1873637319300, IssueDrawCommandsStart=1873637409900, SwapBuffers=1873651804500, FrameCompleted=1873663434900, DequeueBufferDuration=2445200, QueueBufferDuration=5067700, GpuCompleted=9223372034707292159,
D/CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10121; state: ENABLED
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ruthvikapplication, PID: 6745
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
at com.example.ruthvikapplication.MainActivity.onCreate$lambda-0(MainActivity.kt:21)
at com.example.ruthvikapplication.MainActivity.$r8$lambda$dEE9GmU9yeAvvuQdJ131D5Xmycc(Unknown Source:0)
at com.example.ruthvikapplication.MainActivity$$ExternalSyntheticLambda0.onClick(Unknown Source:6)
at android.view.View.performClick(View.java:7448)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I/Process: Sending signal. PID: 6745 SIG: 9
I think the ID of TextView in XML is myTitle which is different from what you are using in Kotlin file i.e. title
Try log.d("TextView", title1.toString());
to check confirm

DeviceClient error when it calls method open

I'm using this sample code for Android from this page.
Just replaced the content of connstring from line 29 with "Hostname=<myHostname>.azureiotcentral.com;DeviceId=<myDevice>;SharedAccessKey=<myPrimaryKey>";
I'm using SAS Authentication.
The first error is when it tries to call client.open() (line 138).
It's giving me the following error each time when it's trying sending messages (line 122).
Connected to process 20170 on device '7.3_Foldable_API_30 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
No Network Security Config specified, using platform default
I/MultiDex: VM with version 2.1.0 has multidex support
Installing application
VM has multidex support, MultiDex support library is disabled.
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
I/TetheringManager: registerTetheringEventCallback:com.example.kttracking
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
D/HostConnection: HostConnection::get() New Host Connection established 0xf03da8e0, tid 20194
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
W/System.err: Exception while opening IoTHub connection: java.io.IOException: Could not open the connection
I/System.out: Shutting down...
I/System.out: Message Sent: "temperature":22.84, "humidity":48.31
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/EGL_emulation: eglCreateContext: 0xf03f3ee0: maj 3 min 0 rcv 3
D/EGL_emulation: eglMakeCurrent: 0xf03f3ee0: ver 3 0 (tinfo 0xf0738cf0) (first time)
I/Gralloc4: mapper 4.x is not supported
D/HostConnection: createUnique: call
HostConnection::get() New Host Connection established 0xf03f3af0, tid 20194
D/goldfish-address-space: allocate: Ask for block of size 0x100
allocate: ioctl allocate returned offset 0x3fc01c000 size 0x2000
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
I/System.out: Message Sent: "temperature":20.74, "humidity":31.12
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
I/System.out: Message Sent: "temperature":26.08, "humidity":43.27
W/System.err: Exception while sending event: java.lang.IllegalStateException: Cannot send event from an IoT Hub client that is closed.
What protocol are you using? Is that a MQTT? Also please check the version of the device client are you using.
Second thing that you can do is to try on a different device and see if the issue persists. at time certain devices do exhibit issues like this.
At the end I tried this library. It works.

Glide can't download image to ImageView

I am switch from iOS to Android and try to download the image by URL, for this problem I find that a lot of developers prefer to use the Glide library, I am trying to download images but can't understand why I see the error image. Look please on my code and say what I am doing wrong?
This error happens with JPEG and PNG formats.
Glide version 4.12.0
Code:
val urlJpg = "http://developer.alexanderklimov.ru/android/images/android_cat.jpg"
lateinit var img: ImageView
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
img = findViewById(R.id.imageView)
Glide.with(this) //1
.load(urlJpg)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_foreground)
.into(img)
}
Log:
2021-04-01 11:49:04.750 18374-18374/? I/glideandpicass: Not late-enabling -Xcheck:jni (already on)
2021-04-01 11:49:04.828 18374-18374/? I/glideandpicass: Unquickening 12 vdex files!
2021-04-01 11:49:04.832 18374-18374/? W/glideandpicass: Unexpected CPU variant for X86 using defaults: x86
2021-04-01 11:49:05.517 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.519 18374-18374/com.example.testglideandpicasso D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2021-04-01 11:49:05.593 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
2021-04-01 11:49:05.607 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
2021-04-01 11:49:05.626 18374-18404/com.example.testglideandpicasso D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
2021-04-01 11:49:05.984 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
2021-04-01 11:49:05.986 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.390 18374-18374/com.example.testglideandpicasso W/glideandpicass: Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (greylist,core-platform-api, reflection, allowed)
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58) 
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) 
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) 
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) 
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311) 
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280) 
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) 
2021-04-01 11:49:06.514 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eece00, tid 18402
2021-04-01 11:49:06.532 18374-18402/com.example.testglideandpicasso D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
2021-04-01 11:49:06.582 18374-18402/com.example.testglideandpicasso W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2021-04-01 11:49:06.585 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglCreateContext: 0xe8eedc70: maj 3 min 0 rcv 3
2021-04-01 11:49:06.594 18374-18402/com.example.testglideandpicasso D/EGL_emulation: eglMakeCurrent: 0xe8eedc70: ver 3 0 (tinfo 0xe923a070) (first time)
2021-04-01 11:49:06.618 18374-18402/com.example.testglideandpicasso I/Gralloc4: mapper 4.x is not supported
2021-04-01 11:49:06.619 18374-18402/com.example.testglideandpicasso D/HostConnection: createUnique: call
2021-04-01 11:49:06.620 18374-18402/com.example.testglideandpicasso D/HostConnection: HostConnection::get() New Host Connection established 0xe8eed570, tid 18402
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: Ask for block of size 0x100
2021-04-01 11:49:06.621 18374-18402/com.example.testglideandpicasso D/goldfish-address-space: allocate: ioctl allocate returned offset 0x3f7ef4000 size 0x2000
2021-04-01 11:49:06.639 18374-18402/com.example.testglideandpicasso D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_3_0
Glide logs:
2021-04-01 11:49:06.119 18374-18374/com.example.testglideandpicasso W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a #GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
2021-04-01 11:49:06.468 18374-18374/com.example.testglideandpicasso W/Glide: Load failed for http://developer.alexanderklimov.ru/android/images/android_cat.jpg with size [1173x746]
class com.bumptech.glide.load.engine.GlideException: Failed to load resource
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetching data failed, class java.io.InputStream, REMOTE
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Fetch failed
There was 1 root cause:
com.bumptech.glide.load.HttpException(Failed to connect or obtain data, status code: -1)
call GlideException#logRootCauses(String) for more detail
Cause (1 of 1): class com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
2021-04-01 11:49:06.471 18374-18374/com.example.testglideandpicasso I/Glide: Root cause (1 of 1)
com.bumptech.glide.load.HttpException: Failed to connect or obtain data, status code: -1
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:98)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58)
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100)
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70)
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63)
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311)
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280)
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393)
Caused by: java.io.IOException: Cleartext HTTP traffic to developer.alexanderklimov.ru not permitted
at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadDataWithRedirects(HttpUrlFetcher.java:93)
at com.bumptech.glide.load.data.HttpUrlFetcher.loadData(HttpUrlFetcher.java:58) 
at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:100) 
at com.bumptech.glide.load.engine.SourceGenerator.startNextLoad(SourceGenerator.java:70) 
at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:63) 
at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:311) 
at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:280) 
at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:235) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:923) 
at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:393) 
Adding Network Security Config xml file in manifest
res/xml/network_security_config.xml:
Create the Network security config.xml in resource xml folder.
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">developer.alexanderklimov.ru/</domain>
</domain-config>
</network-security-config>
Add the Network security config.xml in manifest like following.
<application
android:name=".MyApplication"
android:networkSecurityConfig="#xml/network_security_config" ... />
I examined the log and try solved my problem using this post Glide showing error: Failed to find GeneratedAppGlideModule
The example above will be good for some situation, but for my problem solution simple need to add allow clear HTTP traffic inside Manifest file.
android:usesCleartextTraffic="true"
All my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testglideandpicasso">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:usesCleartextTraffic="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/Theme.TestGlideAndPicasso">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
I think you're missing INTERNET permission in your AndroidManifest.xml.
Please define permission before application element in AndroidManifest.xml file.
<uses-permission android:name="android.permission.INTERNET" />
Any internet request on Android platform must have this permission, for more permissions, please check android developer documentation: https://developer.android.com/reference/android/Manifest.permission?hl=en
Have a nice trip on your Android development!

Flutter firebase messaging gives registerPlugin exception in Android

Everything was fine until the last Flutter upgrade to beta 2.0.1 (same as current stable I think).
Now I suddenly get this message during init of the firebase messaging.
NoSuchMethodError: No top-level getter '_registerPlugins' declared.
Receiver: top-level
Tried calling: _registerPlugins
This error is triggered by calling:
FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);
Down the call path this calls:
package: firebase_messaging_platform_interface-1.0.0-dev.10
file : method_channel_messaging.dart:
await channel.invokeMapMethod('Messaging#startBackgroundIsolate', {
'pluginCallbackHandle': bgHandle.toRawHandle(),
'userCallbackHandle': userHandle.toRawHandle(),
});
That ends up in:
package: flutter
file : platform_channel.dart:
final ByteData? result = await binaryMessenger.send(
name,
codec.encodeMethodCall(MethodCall(method, arguments)),
);
Seems like the exception is thrown here...
Those are the messages it generates in my console. Nothing that indicates a problem I think:
I/FLTFireBGExecutor( 8226): Creating background FlutterEngine instance, with args: [--start-paused, --enable-dart-profiling]
D/EGL_emulation( 8226): eglCreateContext: 0xe3b20600: maj 2 min 0 rcv 2
D/EGL_emulation( 8226): eglCreateContext: 0xe3b206c0: maj 2 min 0 rcv 2
D/HostConnection( 8226): HostConnection::get() New Host Connection established 0xc4abc480, tid 8310
D/HostConnection( 8226): HostComposition ext
ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
ANDROID_EMU_direct_mem
ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2
ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands
ANDROID_EMU_vulkan_null_optional_strings
ANDROID_EMU_vulkan_create_resources_with_requirements
ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer
ANDROID_EMU_vulkan_ignored_handles ANDROID_EMU_vulkan_free_memory_sync
ANDROID_EMU_vulkan_shader_float16_int8
ANDROID_EMU_vulkan_async_queue_submit GL_OES_vertex_array_object
GL_KHR_texture_compression_astc_ldr ANDROID_EMU_host_side_tracing
ANDROID_EMU_async_frame_commands ANDROID_EMU_gles_max_version_2
D/EGL_emulation( 8226): eglMakeCurrent: 0xe3b206c0: ver 2 0 (tinfo 0xe3bb0b50)
>>> At this moment the exception is thrown <<<
I/FLTFireMsgService( 8226): FlutterFirebaseMessagingBackgroundService started!
Does anybody have any suggestions?

Categories

Resources