java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/preference/PreferenceManager;

See original GitHub issue

Describe the bug Below exception is thrown when I init the trust kit for android using below line TrustKit.initializeWithNetworkSecurityConfiguration(context) java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/preference/PreferenceManager; at com.datatheorem.android.trustkit.utils.VendorIdentifier.getOrCreate(VendorIdentifier.java:24) at com.datatheorem.android.trustkit.TrustKit.<init>(TrustKit.java:209) at com.datatheorem.android.trustkit.TrustKit.initializeWithNetworkSecurityConfiguration(TrustKit.java:321) at com.datatheorem.android.trustkit.TrustKit.initializeWithNetworkSecurityConfiguration(TrustKit.java:271)

To Reproduce There are no steps just the init line causes this issue and this issue has nothing to do with network_security_config and thats added under application tag in app’s manifest and in xml directory under res. The pattern for my base url is added and I am using 64 char length pinset. My network config is below for ref.

Expected behavior I want to implement SSL pinning for Android 21 and above.

TrustKit configuration <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="false"> <domain includeSubdomains="true">abcd.abcd-abcd.com</domain> <pin-set> <pin digest="SHA-256">XXX</pin> <pin digest="SHA-256">XXX</pin> <pin digest="SHA-256">XXX</pin> </pin-set> <trustkit-config enforcePinning="true" /> </domain-config> </network-security-config>

App details:

  • App target SDK: 30
  • App Min SDK: 21
  • App language: Java, Kotlin
  • Android R or API 30 (Tested on pixel 2 emulator)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:11
  • Comments:7

github_iconTop GitHub Comments

4reactions
prcaencommented, Sep 18, 2020

We are using the 1.1.2

1reaction
IgorGanapolskycommented, Dec 2, 2020

The resolution is to add the following dependency: implementation 'androidx.preference:preference-ktx:1.1.1'

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed resolution of: Landroid/support/v4/content ...
This issue is because third party lib is still using v4 support lib. To fix this issue add the following in your gradle.properties...
Read more >
Failed resolution of: Landroid/support/v4/content/LocalBroadcast
Caused by: java. lang. ClassNotFoundException : Didn't find class "android.support.v4.content.LocalBroadcastManager" on path: DexPathList[[ ...
Read more >
Android Library project throws java.lang.NoClassDefFoundError
NoClassDefFoundError: Failed resolution of: Lrx/Observer;. Caused by: java.lang.ClassNotFoundException: Didn't find class "rx.Observer" on path: DexPathList.
Read more >
java.lang.NoClassDefFoundError ... - the OneSpan Community
After integrating SDK , I am getting the error while initializing orchestrator and error is below :- java.lang.NoClassDefFoundError: Failed ...
Read more >
TabStrip java.lang.NoClassDefFoundError: Failed resolution of
Hi, After upgrading to B4A Version 10.2, I encountered error in TabStrip. Below is the error log. java.lang.NoClassDefFoundError: Failed ...
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