我在过去24小时内收到此错误。请帮助我。更新依赖项版本后出现此错误。我还添加了Exo播放器依赖性。我不知道真正的问题是什么。
我尝试了以下操作:
**清理并重建项目**
**删除C:/users/.android/cache中的缓存文件**
**重新启动android studio **
**检查xml文件中的编码方案**
这是我的构建gradle(app)文件:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.example.eventscheduling"
minSdkVersion 22
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation "androidx.constraintlayout:constraintlayout:2.0.1"
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.firebase:firebase-functions:19.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation "com.google.android.gms:play-services-location:17.0.0"
// Firebase dependencies
implementation 'com.google.firebase:firebase-storage:19.2.0'
implementation 'com.google.firebase:firebase-auth:19.3.2'
implementation 'com.google.firebase:firebase-firestore:21.6.0'
implementation 'com.firebaseui:firebase-ui-firestore:6.2.1'
// glide libraries
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
// CircleView images
implementation 'de.hdodenhof:circleimageview:3.1.0'
// Material dependency
implementation 'com.google.android.material:material:1.2.1'
//Stylable Toast
implementation 'com.muddzdev:styleabletoast:2.2.3'
// GraphView dependency
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
// Volley library
implementation 'com.android.volley:volley:1.1.1'
}
我一次又一次收到此错误。Build gradle(app)
这是构建gradle(模块)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是 list 文件<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.eventscheduling">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".eventorg.ui.evntOrg_setting" />
<activity android:name=".eventorg.ui.evntOrg_Package_detail" />
<activity android:name=".eventorg.ui.evntOrg_Package_create" />
<activity android:name=".eventorg.ui.evntOrg_emailVerification" />
<activity android:name=".eventorg.ui.evntOrg_friend_list" />
<activity android:name=".eventorg.ui.evntOrg_MessageDetail" />
<activity android:name=".eventorg.mapService" />
<activity android:name=".util.InternetBroadCastReceiver" />
<activity
android:name=".client.ui.client_home"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".eventorg.ui.evntOrg_home"
android:label="@string/title_activity_evnt_org_home"
android:theme="@style/AppTheme.NoActionBar" />
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".MapLocation"
android:label="Map" />
<activity
android:name=".eventorg.ui.evntOrg_signUp2"
android:label="Sign Up" />
<activity
android:name=".SplashActivity"
android:theme="@style/splashScreenStyle">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="EventSchedulingSystem" />
<activity
android:name=".eventorg.ui.evntOrg_signIn"
android:label="Sign In"
android:theme="@style/splashScreenStyle" />
<activity
android:name=".eventorg.ui.evntOrg_signUp"
android:label="Sign Up" />
<activity android:name=".client.ui.client_signIn" />
<activity android:name=".client.ui.client_signUp" />
<service android:name=".eventorg.mapService" />
</application>
</manifest>
任何帮助将不胜感激。 最佳答案
我收到此错误是因为我的Firebase依赖项的版本号不同。我通过更改版本号来解决此错误。