-
Notifications
You must be signed in to change notification settings - Fork 2
Installation
Davide Bassi edited this page Jun 19, 2023
·
2 revisions
The library is published on jitpack.io.
The custom domain com.open-meteo
used as group id is an alias to com.github.open-meteo
: both work.
Please note that $version
is used as the version placeholder
- Add the JitPack repository to your root build.gradle file:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency:
dependencies {
...
implementation 'com.open-meteo:open-meteo-api-kotlin:$version'
}
- If you get the error:
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
update thedependencyResolutionManagement
your root settings.gradle file like this:
dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // this threw the error
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // you may also set it to PREFER_PROJECT to avoid the warning
repositories {
google()
mavenCentral()
}
}
- Add the JitPack repository to your settings.gradle file:
dependencyResolutionManagement {
...
repositories {
...
maven { url 'https://jitpack.io' }
}
}
- Add the dependency to the app build.gradle:
dependencies {
...
implementation 'com.open-meteo:open-meteo-api-kotlin:$version'
}
- If you get the error:
Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
update thedependencyResolutionManagement
your root settings.gradle file like this:
dependencyResolutionManagement {
// repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // this threw the error
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // you may also set it to PREFER_PROJECT to avoid the warning
repositories {
google()
mavenCentral()
}
}
- Add the JitPack repository to your build file:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
- Add the dependency:
<dependency>
<groupId>com.open-meteo</groupId>
<artifactId>open-meteo-api-kotlin</artifactId>
<version>$version</version>
</dependency>