Any jar file that references a third-party library may trigger this error. The solution is as follows:
1. Add dependencies in build.gradle of app, and add the following code in defaultconfig [Note: it must be the module of app, not other modules]
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.why.project.poidemo"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//poi
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:multidex:1.0.3'
}
2. If you customize the application subclass, you need to override a method in this subclass
@Override
public void onCreate() {
super.onCreate();
// add the line as below
MultiDex.install(this);
}
Read More:
- Rendering Problems The following classes could not be instantiated: xml layout file could not be loaded
- [Solved] INSTALL_FAILED_DEXOPT (DEX optimization verification failed)
- Error in Tensorflow using variables: List of Tensors when single Tensor expected
- [Solved] UE4 Error: Couldn‘t find file for package *** requested by async loading code. NameToLoad: ***
- [Solved] GBase 8a V95 Replace Node Error: single vc mode does not support ‘–freenode’
- [How to Fix]Unable to find the requested Boost libraries
- The showdialog() method in thread/threading. Timer/task reported an error: “before ole can be called, the current thread must be set to single thread unit (STA) mode.”
- [Fixed] Typeerror: error 1009: Cannot access properties or methods referenced by an empty object
- [Solved] waterdrop Import hive to clickhouse Error: Too many partitions for single INSERT block (more than 100).
- [GO] The entry file under the main package in golang calls other go file functions and appears undefined
- The requested URL returned error: 403 [How to Solve]
- Sqllineage Error: OSError: [Errno 99] Cannot assign requested address
- Vue Error reported after introduction of path: Already included file name ‘××ב differs from file name ‘××ב only in casing.
- laravel Error mews/captcha is locked to version 3.2.4 and an update of this package was not requested.
- [Solved] TensorFlow severing Container Creat Error: failed: Out of range: Read less bytes than requested
- fatal: unable to access”: The requested URL returned error: 500
- [HBase Error]“java.lang.OutOfMemoryError: Requested array size exceeds VM limit”
- [Solved] TortoiseGitPlink Fatal Error: No supported authentication methods available (server sent: publi
- [Solved] Curl: (22) the requested URL returned error: 404 when installing XXX on MAC brew
- Two implementation methods of spring boot scan mapper interface class