question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] NoSuchFieldError / files found with path 'META-INF/DEPENDENCIES' error on android

See original GitHub issue

Describe the bug Code fails for android. While compiling, we get files found with path 'META-INF/DEPENDENCIES' error. If we resolve this by excluding dependencies by adding packaging Block, then gets a runtime error NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier

To Reproduce Steps to reproduce the behavior: Just call the as[Type]() method and you will encounter this problem.

Expected behavior A request made to the URL

Stack trace

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!classes2.dex)

Environmental Data:

  • Java Version : 16
  • Library Version : Latest

Additional context The main problem is that while building APK, we can’t include the META-INF/DEPENDENCIES’. And excluding it result in this error.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
rybercommented, Mar 14, 2022

I’m not really clear on what the issue is but it’s a problem with Apache HttpClient and not with Unirest

Read more comments on GitHub >

github_iconTop Results From Across the Web

than one file was found with OS independent path 'META-INF ...
In my case it was enough to exclude only path 'META-INF/DEPENDENCIES' on yourProject/app/build.gradle inside android{} . Here it is
Read more >
than one file was found with OS independent path 'META-INF ...
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > More than one file was found with OS ...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Scanning a large number of directories and files may lead to out of memory errors. For more information on this issue, read the...
Read more >
How to Resolve the NoSuchFieldError in Java - Rollbar
NoSuchFieldError in Java is thrown when an application accesses or modifies a field of an object/class that no longer contains that field.
Read more >
Custom BugChecker test error: java.lang.NoSuchFieldError
NoSuchFieldError : ANNOTATION_PROCESSOR_MODULE_PATH. I debugged and found that this exception comes from StandardLocation.java that is present on rt.jar ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found