E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.nnroh.debtmanager, PID: 23433
java.lang.RuntimeException: Unable to
try using this code in the manifest.xml inside the application tag.
<uses-library android:name="org.apache.http.legacy" android:required="false"/>
Below I'm listing possible solutions, try this steps one by one:
go to build.gradle(Module: app) in debug block and disable minifyEnabled:
buildTypes {
debug {
minifyEnabled false
}
}
In my case, I was including another layout
<include layout="@layout/attached_layout" />
to my activity's layout and this solved it.
android {
...
...
...
dataBinding {
enabled = true
}
}
eg:
<activity android:name="com.pathToClass.MyActivity"
<com.pathToClass.MyCustomView
android:id="@+id/myview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp" />
dexOptions {
preDexLibraries false
}
Add this to build.gradle(Module:app)
android {
defaultConfig {
...
multiDexEnabled true
}
dependencies {
...
implementation 'androidx.multidex:multidex:2.0.1'
}
}
if you are using application class you have to extend it with MultiDexApplication
instead of Application
and add it to AndroidManifest.xml
<application
android:name="com.myPackageName.MyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
else add MultiDexApplication
class path from library as name
<application
android:name="androidx.multidex.MultiDexApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">
Looks like the class is loaded by reflection, but your proguard file doesn't prevent that class from being obfuscated