Невозможно найти метод com.android.build.api.variant.SourceDirectories$Flat com.android.build.api.variant.Sources.getByNAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Невозможно найти метод com.android.build.api.variant.SourceDirectories$Flat com.android.build.api.variant.Sources.getByN

Сообщение Anonymous »


Im having an issue with syncing the gradle for my android studio project

Unable to find method ''com.android.build.api.variant.SourceDirectories$Flat com.android.build.api.variant.Sources.getByName(java.lang.String)'' 'com.android.build.api.variant.SourceDirectories$Flat com.android.build.api.variant.Sources.getByName(java.lang.String)' Here's my project gradle and app gradle:

buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.0.4' classpath 'com.google.gms:google-services:+' } }// Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.application' version '7.2.2' apply false id 'com.android.library' version '7.2.2' apply false id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false } task clean(type: Delete) { delete rootProject.buildDir } And here is the app gradle

plugins { id 'com.android.application' id 'com.google.gms.google-services' id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' } android { compileSdk 33 testOptions.unitTests.includeAndroidResources true defaultConfig { applicationId "com.example.tradesource" minSdk 21 targetSdk 33 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 } namespace 'com.example.tradesource' buildFeatures { viewBinding true } } dependencies { implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'com.google.android.material:material:1.4.0' implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'com.google.firebase:firebase-database:20.0.6' implementation 'com.google.firebase:firebase-auth:21.0.8' implementation 'com.google.android.gms:play-services-maps:18.1.0' implementation 'com.google.android.gms:play-services-location:21.0.0' implementation 'androidx.navigation:navigation-fragment:2.4.1' implementation 'androidx.navigation:navigation-ui:2.4.1' implementation 'com.android.volley:volley:1.2.1' implementation 'com.google.firebase:firebase-messaging:23.0.2' implementation 'com.google.firebase:firebase-analytics:21.2.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:3.4.0' testImplementation 'org.robolectric:robolectric:4.8' androidTestImplementation project(path: ':app') implementation 'androidx.test.espresso:espresso-intents:3.4.0' androidTestImplementation 'com.android.support.test.espresso:espresso-intents:2.2.1' androidTestImplementation 'androidx.test:runner:1.4.0' androidTestImplementation 'androidx.test:rules:1.4.0' androidTestImplementation 'androidx.test:core:1.4.0' implementation 'com.google.code.gson:gson:2.10' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } Tried to change plugins for Android Gradle and Google Services Plugin to versions 7.0.4 and 4.3.10 so they are "compatible" but this did not work.

Not sure what else to do


Источник: https://stackoverflow.com/questions/780 ... esflat-com
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»