I can't use MapMyIndia in kotlin, I need to know how I can install it.
Now in my code I got this:
Project level build.gradle
maven {
url 'https://maven.mapmyindia.com/repository/mapmyindia/'
}
App level dependency build.gradle
implementation 'com.mapmyindia.sdk:mapmyindia-android-sdk:6.8.2'
But when I want to use anything with MapMyIndia on my activity or xml I got none about it.
There is one more place where you should import the.
in settings.gradle Project Settings and
should look something like this
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://maven.mapmyindia.com/repository/mapmyindia/' }
}
}
rootProject.name = "This is Sparta"
include ':app'
That should do the trick.
Related
I get an error saying "Failed to resolve: com.github.mancj:MaterialSearchBar:0.8.5"
any ideas on how to fix this?
my build gradle proj
buildscript {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath 'com.google.gms:google-services:4.3.10'
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build gradle app:
dependencies {
.....
implementation 'com.github.mancj:MaterialSearchBar:0.8.5'
} ```
Try adding this to your project's build.gradle(the one you showed in the first):
allprojects { repositories { google() mavenCentral() jcenter() } }
Edit: Just checked the library you were asking about. It asks you to add that maven { url ....} in the repositories section of allprojects as well:
Try adding maven { url "https://jitpack.io" } in your settings.gradle file:
settings.gradle (Project Settings)
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" } <-- here
}
}
rootProject.name = "StackOverflow"
include ':app'
I think this happens because Build is configured to prefer settings repositories over project repositories
i want to implement a dependency from GitHub in my android project but it gives me this error
Could not find com.github.RobertApikyan:SegmentedControl:1.2.0
I'm implementing this:
implementation 'com.github.RobertApikyan:SegmentedControl:1.2.0'
I think is the case because by build.gradle file doesn't search on GitHub for repos.
This is my build.gradle file:
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Workaround 1:
You can host a project release into mavenCentral using github, it is located at:
https://github.com/{user}/{repository}/packages?package_type=Maven
And in order to pull packages from it, add new repository in your build.gradle:
mavenCentral()
Wordaround 2:
You can host your project's any branch or version at jitpack.io
and the great thing is that you don't need to setup anything it'll build your packages in their server and notify you. Your project will be located at:
https://jitpack.io/#{user}/{repository}
And in order to pull packages from it, add new repository in your build.gradle:
maven { url 'https://jitpack.io' }
I have problem with build project in android-studio from https://github.com/Samsung/microbit.
I imported repository by git, but while build gradle project from in android-studio I have error:
ERROR: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.71.
I am not sure how I can change version 1.2.72 to other version.
Edit:
Solution:
I added mavenCentral() to
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
google()
}
}
I think there is no need to use that as you can use kotlin-stdlib directly.
Try this:
In your app level build.gradle file, under dependencies section:
dependencies{
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.41"
}
I got this error when I used this dependency 'com.myhexaville:smart-image-picker:1.0.3'
When i commented this dependency, gradle synced successfully.
Please suggest me a proper solution for this problem.
Add Google's Maven repository to your project's build.gradle file :
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
If you are using android-studio 3.0 or above use this :
allprojects {
repositories {
jcenter()
google()
}
}
I am new to gradle concept. I'm doing gradle for app engine (I don't know maven or ant) and I gone through in [https://cloud.google.com/appengine/docs/standard/java/tools/gradle] but I can't able to understand the difference between the:
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:appengine-gradle-plugin:+'
}
}
and:
repositories {
jcenter()
mavenCentral()
}
dependencies {
providedCompile 'javax.servlet:servlet-api:2.5'
compile 'com.google.appengine:appengine:+'
}
I searched in the internet I can't able to understand? Can anyone explain this?
It may be confusing at the very beginning but is quite easy. With gradle you do manage the project but both gradle and the project that is managed can have their own dependencies. So, if you'd like e.g. use guava to compile your project files it will be:
repositories {
mavenCentral()
}
dependencies {
compile 'com.google.guava:guava:22.0'
}
but if you'd like to use guava in build.gradle file then the following piece of code is necessary:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.guava:guava:22.0'
}
}
So buildscript is used to configure build.gradle itself.
In the example provided buildscript block is used to configure dependency for plugin that is applied later on in build.gradle and the second block configures the dependencies for the project itself.