以下是错误
FATAL EXCEPTION: main
Process: com.example.myapp, PID: 23564
android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.coordinatorlayout.widget.CoordinatorLayout
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class androidx.coordinatorlayout.widget.CoordinatorLayout
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.coordinatorlayout.widget.CoordinatorLayout" on path: DexPathList[[zip file "/data/app/com.example.myapp-NCewvyoi2h2F2Z1UfLtpjw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.myapp-NCewvyoi2h2F2Z1UfLtpjw==/lib/arm, /system/lib, /vendor/lib]]
我正在使用androidx
以下是buid.gradle(Module:app)
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
targetSdkVersion 28
versionCode 5010002
versionName "1.0.02-beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
///https://github.com/AppIntro/AppIntro
implementation 'com.github.AppIntro:AppIntro:5.1.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
//https://github.com/cachapa/ExpandableLayout
implementation 'com.github.krtkush:LinearTimer:v2.1.1'
//https://github.com/krtkush/LinearTimer
implementation 'com.facebook.shimmer:shimmer:0.4.0'
//https://github.com/team-supercharge/ShimmerLayout
implementation 'com.google.firebase:firebase-core:17.1.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.github.aabhasr1:OtpView:v1.1.2' //
https://github.com/aabhasr1/OtpView
}
apply plugin: 'com.google.gms.google-services'
从Android Studio安装时,应用程序运行正常。从App Store安装后崩溃了
答案 0 :(得分:3)
请尝试在您的Gradle文件中放置以下代码:
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'