I have created a blank project and it runs successfully till I add this line in the gradle build: implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1'
Below is the build.gradle file for app level:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.aadhilahmed.navtest4"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
mavenCentral()
google()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1@aar') {
transitive=true
}
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1'
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
}
And this is the project level build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// 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
}
And the error message for the gradle build relates something to the v27.0.1 of appcompat, eventhough I use v26.1.0.Here it is.
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.android.support:appcompat-v7:27.0.2.
Required by:
project :app
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://maven.google.com/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://maven.google.com/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-fragment:25.4.0.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1
> Could not resolve com.android.support:support-fragment:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-fragment:25.4.0.
> Could not get resource 'https://maven.google.com/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Could not GET 'https://maven.google.com/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:support-fragment:25.4.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:support-fragment:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-fragment/25.4.0/support-fragment-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1 > com.mapbox.mapboxsdk:mapbox-android-telemetry:2.2.10
project :app > com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1 > com.mapbox.mapboxsdk:mapbox-android-services:2.2.10
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-compat:25.4.0.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1 > com.mapbox.mapboxsdk:mapbox-android-services:2.2.10
> Could not resolve com.android.support:support-compat:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-compat:25.4.0.
> Could not get resource 'https://maven.google.com/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Could not GET 'https://maven.google.com/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:support-compat:25.4.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:support-compat:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-compat/25.4.0/support-compat-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1 > com.mapbox.mapboxsdk:mapbox-android-services:2.2.10 > com.mapzen.android:lost:3.0.4
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://maven.google.com/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://maven.google.com/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:support-annotations:25.4.0.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/support-annotations/25.4.0/support-annotations-25.4.0.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
Required by:
project :app > com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1 > com.mapbox.mapboxsdk:mapbox-android-services:2.2.10 > com.mapzen.android:lost:3.0.4
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to maven.google.com:443 [maven.google.com/172.217.163.195] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to repo1.maven.org:443 [repo1.maven.org/151.101.52.209] failed: Connection refused: connect
> Could not resolve com.android.support:appcompat-v7:27.0.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom'.
> Connect to dl.google.com:443 [dl.google.com/172.217.163.206] failed: Connection refused: connect
And If I remove this(implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.11.1'
) line from gradle file, everything works properly again.I don't know from where this issue pops up. Any help is greatly appreciated.