jfrog / jfrog/artifactory-client-java

Using in Android causes a "No static field"

Open
#362 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
331
Forks
163
Avg merge
20h 9m
Merged PRs (30d)
1

Description

In an Android Gradle project using
implementation 'org.jfrog.artifactory.client:artifactory-java-client-services:2.13.0'
I run with

        val artifactory: Artifactory = ArtifactoryClientBuilder.create()
            .setUrl("https://artifactory.server.info")
            .build()

into this

    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!classes4.dex)
        at org.apache.http.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:151)
        at org.jfrog.artifactory.client.httpClient.http.HttpBuilderBase.createConnectionMgr(HttpBuilderBase.java:359)
        at org.jfrog.artifactory.client.httpClient.http.HttpBuilderBase.configConnectionManager(HttpBuilderBase.java:344)
        at org.jfrog.artifactory.client.httpClient.http.HttpBuilderBase.build(HttpBuilderBase.java:78)
        at org.jfrog.artifactory.client.ArtifactoryClientBuilder.createClientBuilder(ArtifactoryClientBuilder.java:174)
        at org.jfrog.artifactory.client.ArtifactoryClientBuilder.build(ArtifactoryClientBuilder.java:196)
        at info.hannes.appUpdate.AppUpdateHelper.requestArtifactoryVersions(AppUpdateHelper.kt:159)

Does someone has an idea how to get rid of it ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure in an Android Gradle project using artifactory-java-client-services:2.13.0, then inspect HttpBuilderBase.createConnectionMgr and SSLConnectionSocketFactory at the reported stack-trace locations. Compare the client’s Apache HTTP dependencies with the Android framework classes. Done means the ArtifactoryClientBuilder can build and make its request without the NoSuchFieldError.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.