gpt4 book ai didi

android - 类未找到异常 : unable to find class "android.support.v4.util.ArrayMap"

转载 作者:行者123 更新时间:2023-11-29 02:24:49 31 4
gpt4 key购买 nike

我的应用程序的签名 apk 在高于 5.0.1 的 android 版本上运行,但我面临这个问题,我的应用程序在 5.0.1 版本上启动应用程序后立即崩溃,这是我得到的错误 - 引起:java.lang.ClassNotFoundException:在路径上找不到类“android.support.v4.util.ArrayMap”:DexPathList[[zip 文件“/data/app/com.*****1/base.apk"],nativeLibraryDirectories=[/vendor/lib,/system/lib]]

请注意,当我使用 android studio 运行时,该应用程序不会崩溃,但当我运行已签名的 apk 时,它会崩溃。 我不知道该怎么办,我已经经历了很多 stackoverflow 问题,但没有发现可以解决我的问题。这是我的 app.gradle 文件 -

**buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' } // for crashlytics
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "*****"
minSdkVersion 21
targetSdkVersion 26
flavorDimensions "default"
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
versionCode 3
multiDexEnabled true
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
javaMaxHeapSize "2g"
}
}
repositories {
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//google 's library
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:support-v13:26.0.2'
implementation 'com.android.support:cardview-v7:26.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'

//for barcode generation
implementation 'com.google.zxing:core:3.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.journeyapps:zxing-android-embedded:3.0.2@aar'

//multidex support
compile 'com.android.support:multidex:1.0.1'

//for fancy dialogs
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
compile 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'

//for home screen carousal view
compile 'com.synnapps:carouselview:0.1.4'

//for bottom navigation
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'

//for shaping the image view
compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
compile 'com.jackandphantom.android:circularimageview:1.2.0'

//libraries for retrofit and conversion factory GSON
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'

//FilePicker Library
compile 'com.droidninja:filepicker:2.0.8'

//for welcome screen
compile 'com.stephentuso:welcome:1.4.1'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.3.1'

//material calender picker
compile 'com.wdullaer:materialdatetimepicker:3.4.0'


implementation 'com.trello:rxlifecycle:1.0'
implementation 'com.trello:rxlifecycle-components:1.0'
compile 'com.polidea.rxandroidble:rxandroidble:1.4.3'
implementation 'com.android.support:design:26.0.2'
compile 'io.reactivex.rxjava2:rxjava:2.0.7'

compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

//libraries for firebase integration
//for analytics
compile 'com.google.firebase:firebase-core:11.8.0'

//for cloud messenging
compile 'com.google.firebase:firebase-messaging:11.8.0'

//for circular indicator
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'me.biubiubiu.justifytext:library:1.1'
implementation files('libs/imagecapture.jar')
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
}
apply plugin: 'com.google.gms.google-services'**

这是我的build.gradle(项目级别)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()

maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io"

}

}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

如果 gradle 版本是 3.x.x 尝试添加 maven { url 'https://maven.google.com' }

allprojects {
repositories {
//add here
}
}

代替 google() 和同步 gradle。它应该有所帮助。您可以使用 this link 查看它们之间的区别.

关于android - 类未找到异常 : unable to find class "android.support.v4.util.ArrayMap",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52872857/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com