# #android #firebase #gradle #android-gradle-plugin #firebase-cloud-messaging
Вопрос:
это мой код класса на уровне модуля. Я правильно добавил все зависимости, но даже тогда я не могу подключить свое приложение к firebase.
plugins { id 'com.android.application' id 'com.google.gms.google-services' } android { compileSdk 31 defaultConfig { applicationId "com.fitPanda.fitpanda" minSdk 21 targetSdk 31 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility = 1.8 targetCompatibility = 1.8 } compileSdkVersion 31 buildToolsVersion '30.0.3' }
здесь я добавил все необходимые зависимости
dependencies { implementation platform('com.google.firebase:firebase-bom:29.0.0') implementation 'com.google.firebase:firebase-analytics' implementation 'com.google.android.material:material:1.4.0' implementation 'com.google.firebase:firebase-messaging:23.0.0' annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' implementation 'com.google.android.gms:play-services-ads:20.5.0' // For apps targeting Android 12, add WorkManager dependency. constraints { implementation('androidx.work:work-runtime:2.7.0') { because '''androidx.work:work-runtime:2.1.0 pulled from play-services-ads has a bug using PendingIntent without FLAG_IMMUTABLE or FLAG_MUTABLE and will fail in apps targeting S .''' } } implementation 'androidx.appcompat:appcompat:1.4.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.2' testImplementation 'junit:junit:' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' }
это мой код для оценки уровня проекта
buildscript { repositories { google() mavenCentral() } gradle.projectsEvaluated { tasks.withType(JavaCompile){ options.encoding='UTF-8' options.compilerArgslt;lt;"-Xlint:deprecation" } }
here I added all the required classpaths
dependencies { classpath 'com.android.tools.build:gradle:7.0.3' classpath 'com.google.gms:google-services:4.3.10' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' } } task clean(type: Delete) { delete rootProject.buildDir }
this my settings.gradle file, I also removed the jcenter(), even then nothing is working.
dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven {url "https://maven.google.com"} } } rootProject.name = "FitPanda" include ':app'