I have recently updated my Android Studio to latest version. But the gradle file here seems bit different.
here is the gradle code :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.1' apply false
id 'com.android.library' version '7.3.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
I want to add these below jitsi lines in the project gradle file. how should I paste it so that it syncs properly without any errors.
here is the jitsi code :
allprojects {
repositories {
maven {
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
google()
mavenCentral()
maven { url 'https://www.jitpack.io' }
}
}
I have tried changing the gradle file by adding or replacing the above lines, Nothing changes. It is throwing an error.
As you appear to be using the recently revised build configuration scripts, you should be able to declare your repositories under the settings.gradle
file:
pluginManagement {
// Plugin repositories go here
}
// ...
dependencyResolutionManagement {
/**
* The dependencyResolutionManagement {repositories {...}}
* block is where you configure the repositories and dependencies used by
* all modules in your project, such as libraries that you are using to
* create your application. However, you should configure module-specific
* dependencies in each module-level build.gradle file. For new projects,
* Android Studio includes Google's Maven repository and the Maven Central
* Repository by default, but it does not configure any dependencies (unless
* you select a template that requires some).
*/
// The following line makes it so that project modules (such as your
// "app" module) can't declare their own repositories {} block
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
// Add your repositories here...
maven {
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
maven { url 'https://www.jitpack.io' }
}
}
only buildscript {}, pluginManagement {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed
As for this error, this is because plugins
blocks are always resolved first, and so any other code must be declared after that block:
// There shouldn't be any code before this!
plugins {
}
// Okay to have build script code here...