Build Issue with Latest httpclient SDK

Đang mở
#196 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
40/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
java, kotlin
Lĩnh vực
api, backend

Hướng nghiên cứu

Start by reading the HTTP client construction path shown in the stack trace, especially HttpClientFactoryImpl and B2WebApiHttpClientImpl, and inspect how the SDK’s HTTP client dependency is configured. Reproduce the failure on Android with version 6.2.0 and compare it with the reported working 3.1.0 setup. Done means the SDK can upload from Android without this verifier linkage error while preserving hostname verification.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I am using Kotlin and using latest version 6.2.0

When trying to upload file from the app, i am getting following error:

FATAL EXCEPTION: DefaultDispatcher-worker-6
Process: app.amazeai.android, PID: 28754
java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/framework.jar!classes5.dex)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
at com.backblaze.b2.client.webApiHttpClient.HttpClientFactoryImpl$Builder.createConnectionManager(HttpClientFactoryImpl.java:196)
at com.backblaze.b2.client.webApiHttpClient.HttpClientFactoryImpl$Builder.build(HttpClientFactoryImpl.java:160)
at com.backblaze.b2.client.webApiHttpClient.HttpClientFactoryImpl.build(HttpClientFactoryImpl.java:66)
at com.backblaze.b2.client.webApiHttpClient.B2WebApiHttpClientImpl.<init>(B2WebApiHttpClientImpl.java:59)
at com.backblaze.b2.client.webApiHttpClient.B2WebApiHttpClientImpl.<init>(B2WebApiHttpClientImpl.java:49)
at com.backblaze.b2.client.webApiHttpClient.B2WebApiHttpClientImpl$Builder.build(B2WebApiHttpClientImpl.java:380)
at com.backblaze.b2.client.webApiHttpClient.B2StorageHttpClientBuilder.build(B2StorageHttpClientBuilder.java:68)
at com.backblaze.b2.client.webApiHttpClient.B2StorageHttpClientFactory.create(B2StorageHttpClientFactory.java:21)
at com.backblaze.b2.client.B2StorageClientFactoryPathBasedImpl.create(B2StorageClientFactoryPathBasedImpl.java:69)
at com.backblaze.b2.client.B2StorageClientFactory.create(B2StorageClientFactory.java:44)
at app.amazeai.android.data.repository.ImageRepositoryImpl.uploadFileToBackblaze(ImageRepository.kt:64)
at app.amazeai.android.ui.chats.ChatBoardViewModel$runImageGenerateApi$1$1$1.invokeSuspend(ChatBoardViewModel.kt:885)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@fcebd38, Dispatchers.IO]

I read (AllowAllHostnameVerifier) is gone for a very good reason: it is a security flaw. If you add it, your app is likely to be rejected for distribution on the Play Store
Reference: https://stackoverflow.com/questions/76276666/how-to-fix-no-static-field-instance-of-type-lorg-apache-http-conn-ssl-allowallh

How to fix this?

When i use version 3.1.0 with okhttp its working fine except mime type is not updated.

Ngôn ngữ chính
Java
Star
103
Fork
23
Merge trung bình
5 ngày 8 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Backblaze/b2-sdk-java

Tất cả issue của Backblaze/b2-sdk-java

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.