How to add Mapbox telemetry 2.0.0-SNAPSHOT as dependency? - android

I just forked fresh mapbox library and tried to add it to my project as a module. Main problem is that gradle gives error when it's synchronising, because I can't access telemetry 2.0.0-SNAPSHOT
Error:Could not find com.mapbox.mapboxsdk:mapbox-android-telemetry:2.0.0-SNAPSHOT.
Required by:
MyApp:app:unspecified > com.mapbox.mapboxsdk:MapboxGLAndroidSDK:5.0.0-SNAPSHOT
Search in build.gradle files
How can I add telemetry services to my project?
Or it's impossible and I should be patient and just check for latest public Mapbox release in git history (currently it's 4.2.2 on Android), checkout and use that version and wait for a new public release?

Finally I found out that top level gradle file was missing snapshot sonatype repository.
allprojects {
repositories {
jcenter()
flatDir {
dirs 'libs'
}
maven { url "http://oss.sonatype.org/content/repositories/snapshots/" }
}
}

Related

Android O Gradle build fails with travis ci

I'm trying to use Travis CI for my Android Project but my Builds constantly failing but works on local build. I am using Android Studio Preview 3 and gradle 3 alpha 3.
I am getting this error below.
Could not find com.android.tools.build:gradle:3.0.0-alpha3.
Here is my build log
My Travis Config file
My Project gradle file
I'm getting an Access denied error to your build log, and I didn't use it, but I'll try to answer you.
As announced here:
The Android Gradle Plugin 3.0.0-alpha3 was also released through
maven.google.com.
You can try to fix it by adding Google’s Maven Repository here like this:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Make sure that the repositories section includes a maven section with
the "https://maven.google.com" endpoint. For example:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
As commented here, this version doesn't exist in Bintray JCenter:
com.android.tools.build.gradle
latest version is 2.5.0-alpha-preview-02, there is no 3.0.0-alpha3
Also be sure to update build tools to the latest version as suggested in this related question:
Update your build tools from SDK manager
I add links to samples using the new sdkmanager command line here.
I would need a sample project reproducing the issue to check my suggestions.

getting failed to resolve when adding dependency

I am trying to add an external dependency from jcenter
compile 'com.droidninja:filepicker:2.0.4'
but I keep getting these errors and I can't figure out what is going wrong.
I have seen the same errors come up in lot of projects but nobody seems to know whats going wrong.
The problem is not with the dependency you just added but the Android Support library's dependencies. The latest SDK updates move towards using the remote Google Maven repository instead of downloading everything to be available locally. In order to fix dependency resolution problems follow the Adding Support Libraries guide. Really briefly this is what you have to do:
Open your project's build.gradle (note that this is not the module's file!)
Add the Google Maven repo to the project repositories:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
It's also recommended to add the repo to the buildscript block too, so later on the Gradle plugins can be downloaded from there too:
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}

install repository and sync project. android studio

When opening Android Studio I get the following error messages under messages Gradle Sync:
Please help. I need it for my work.
Add this to your project level build.gradle:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
as described here: cannot install repository and sync project - not able to use support libraries 25.2.0

Creating cordova 5.x android gradle build offline

Recently I upgraded my Cordova project from Cordova 3.0 to 5.3.3 and Android platform from 3.6 to 4.1. New android platform uses gradle for build and need to connect to internet (maven repo) every day for building. Once it connects to repo, it does not require connection for that day.
I am working behind the proxy which does not have access to maven repo. I am new to gradle build and want to configure gradle for offline building cordova application.
Here are environment details
OS -> MAC OSX
Cordova version -> 5.3.3
Cordova Android platform version -> 4.1
Kindly suggest.
Dependencies are declared in Gradle in the dependencies section and the repositories section controls where the dependencies are fetched from. For example:
repositories {
jcenter()
}
dependencies {
compile 'com.google.guava:guava:18.0'
}
This says, guava:18.0 is fetched during compile time, from the jcenter() repository. You can also use maven central as:
repositories {
mavenCentral()
}
A custom repo like a company repo as:
repositories {
maven {
url "http://repo.mycompany.com/maven2"
}
}
or, the local .m2 repo as:
repositories {
mavenLocal()
}
You can define multiple repositories as well:
repositories {
mavenLocal()
jcenter()
}
Gradle searches for dependencies in the order that the repositories are listed. So it will look in local .m2 first, and if a matching dependency isn't available, it goes out to JCenter to download dependencies.

Android Crashlytics plugin not installing library

When using the Crashlytics plugin in intellij I follow these steps.
Click plugin on toolbar.
Select App
Allow crashlytics to update AndroidManifest.xml as well has my first Activity.
Click "Next"
Try to build the App as the plugin instructs.
Then when i try to build i get this:
package com.crashlytics.android does not exist
I look in my dependencies and library and the jar is nowhere to be found.
What am I missing that would cause the library to not be loaded?
I solved this by following the maven instructions here https://crashlytics.com/downloads/maven and then just grabbing the jar from my .m2 and putting it in my libs folder. (This particular project was started as a maven project, then Maven was discarded and it has not yet been migrated to Gradle, so we're kind of in no-man's land). Anyway, I now have the jar.
The following configuration should work for Gradle-based projects:
buildscript {
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
classpath "com.crashlytics.tools.gradle:crashlytics-gradle:1.+"
}
}
apply plugin: "crashlytics"
repositories {
maven { url "http://download.crashlytics.com/maven" }
}
dependencies {
compile "com.crashlytics.android:crashlytics:1.1.+"
}
Taken from https://crashlytics.com/downloads/gradle
After the automated setup from android studio, I was missing this line:
compile 'com.crashlytics.android:crashlytics:1.1.+'

Categories

Resources