Adding an API key to keys.gradle file - java

Hi I want to build this project, the develop branch of it which is 7 commits ahead and have the changes that I want, it requires to manually create a keys.gradle file and put the api keys in, but whatever I do it ends up with an error can someone help me please?
https://github.com/stumi01/Mizuu
here is the build.gradle
apply plugin: 'com.android.application'
apply from: "$rootDir/keys.gradle"
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
def config = defaultConfig {
applicationId "com.miz.mizuu"
minSdkVersion 15
targetSdkVersion 27
multiDexEnabled true
testApplicationId "com.miz.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
renderscriptTargetApi 21
renderscriptSupportModeEnabled true
resValue "string", "tmdb_api_key", "${tmdb_api_key}"
resValue "string", "trakt_api_key", "${trakt_api_key}"
}
config
buildTypes {
release {
minifyEnabled false
}
}
packagingOptions {
exclude 'META-INF/beans.xml'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
repositories {
mavenCentral()
mavenLocal()
maven {
url 'http://4thline.org/m2'
}
}
dependencies {
def JETTY_VERSION = "8.2.0.v20160908"
def ANDROID_VERSION = "27.0.2"
implementation "com.android.support:support-v4:$ANDROID_VERSION"
implementation "com.android.support:design:$ANDROID_VERSION"
implementation "com.android.support:appcompat-v7:$ANDROID_VERSION"
implementation "com.android.support:palette-v7:$ANDROID_VERSION"
implementation "com.android.support:recyclerview-v7:$ANDROID_VERSION"
implementation "com.android.support:cardview-v7:$ANDROID_VERSION"
implementation "com.google.guava:guava:24.0-android"
//DI
compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation "com.squareup.picasso:picasso:2.5.2"
implementation "com.squareup.retrofit2:retrofit:2.3.0"
implementation "com.squareup.okhttp3:okhttp:3.9.0"
implementation "com.squareup.okio:okio:1.13.0"
implementation "com.squareup:otto:1.3.4"
implementation "com.github.ksoichiro:android-observablescrollview:1.4.0"
implementation "com.jpardogo.materialtabstrip:library:1.0.7"
//Cling (UPNP support)
implementation group: "org.fourthline.cling", name: "cling-core", version:"2.1.1"
implementation group: "org.fourthline.cling", name: "cling-support", version:"2.1.1"
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: JETTY_VERSION
implementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: JETTY_VERSION
implementation group: 'org.eclipse.jetty', name: 'jetty-client', version: JETTY_VERSION
//compile files('libs/teleal-common-1.0.13.jar')
//SMB
implementation('jcifs:jcifs:1.3.17'){
exclude group: "javax.servlet"
}
/**
* // Cling 2.0 dependencies on Android
compile group: 'org.slf4j', name: 'slf4j-jdk14', version:'1.7.5'
*/
}

Related

No field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier

I am making a simple KeyAuth app on Android and using this API as an example: https://github.com/SprayDown/KeyAuth-JAVA-api
Below are the function I've been trying to work on and the gradle file for the application.
HttpResponse<String> response;
try {
response = response = Unirest.post(url).field("type", "init").field("ver", version)
.field("name", appname).field("ownerid", ownerid).asString();
} catch (UnirestException e) {
e.printStackTrace();
}
Above is the code I've been trying to run and getting the error. And here is my gradle file:
plugins {
id 'com.android.application'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.mercyz.regvnapk"
minSdk 24
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation group: 'commons-codec', name: 'commons-codec', version: '1.15'
implementation group: 'commons-logging', name: 'commons-logging', version: '1.2'
implementation group: 'org.apache.httpcomponents', name: 'httpasyncclient', version: '4.1.4'
implementation group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.13'
implementation group: 'org.apache.httpcomponents', name: 'httpcore', version: '4.4.14'
implementation group: 'org.apache.httpcomponents', name: 'httpcore-nio', version: '4.4.14'
implementation group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.5.13'
implementation 'net.sourceforge.htmlunit:htmlunit:2.15'
implementation group: 'org.json', name: 'json', version: '20210307'
implementation group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
// Use JUnit test framework.
testImplementation 'junit:junit:4.13'
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:29.0-jre'
}
Wonder what's going wrong with this.

ERROR: No cached version listing for io.fabric.tools:gradle:1.+ available for offline mode

Hello i am facing this Problem while running my code Can please someone help to solve this issue here is below my Gradle Code
App Level Gadle Code
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.jinito"
minSdkVersion 19
targetSdkVersion 28
versionCode 45
versionName '1.45'
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
signingConfigs {
debugConfig {
storeFile file("debug.keystore");
storePassword("android");
keyAlias "androiddebugkey"
keyPassword "android";
}
releaseConfig {
storeFile file("JinittoApp.jks");
storePassword("jui&84GA~4fM");
keyAlias "JinittoAndroidAppKey2017"
keyPassword "lW73_k9sX12";
}
}
buildTypes {
debug {
buildConfigField "boolean", "isDebug", "true"
debuggable true
signingConfig signingConfigs.releaseConfig
}
release {
buildConfigField "boolean", "isDebug", "false"
debuggable false
signingConfig signingConfigs.releaseConfig
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
}
}
dependencies {
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7'
testCompile 'junit:junit:4.12'
implementation 'com.squareup.retrofit2:retrofit:2.1.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.3.0'
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'com.wx.wheelview:wheelview:1.3.3'
compile files('libs/autobanh.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
compile files('libs/universal-image-loader-1.9.5.jar')
implementation 'com.stripe:stripe-android:4.0.1'
compile('com.google.android.gms:play-services:8.1.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
implementation 'com.facebook.android:facebook-android-sdk:4.8.0'
implementation 'com.android.support:multidex:1.0.1'
compile project(path: ':linkedin-sdk')
compile project(path: ':checkmobi_sdk')
implementation 'org.greenrobot:eventbus:3.0.0'
// compile 'com.rmtheis:tess-two:6.3.0'
implementation 'io.card:android-sdk:5.5.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.2'
implementation 'com.android.support:support-v13:+'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.google.android.gms:play-services:+'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.3'}
apply plugin: 'com.google.gms.google-services'
Project Level Gradle Code
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
mavenLocal()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i have followed the previous sollutions given by other people but it doesnt worked for my Please if someone know sollution to it please let me know
Thanks

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:

I cannot compile my project, scenario i converted one of my activity to kotlin using Android Studio's "Convert Java File to Kotlin File" and fixed all errors for code that was not properly converted.
Java complier log:
Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
com.android.tools.r8.CompilationFailedException: Compilation failed to complete
com.android.tools.r8.utils.AbortException: Error: null, Cannot fit requested classes in a single dex file (# methods: 110666 > 65536 ; # fields: 67264 > 65536)
build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
versionName "2.2.4"
versionCode 13
minSdkVersion 16
targetSdkVersion 27
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix ".d.5"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "server"
productFlavors {
prod {
applicationId "com.test.test"
dimension "server"
buildConfigField "String", "SERVER_HOST", "\"http://www.test.com\""
}
dev {
applicationId "dev.test.test"
versionNameSuffix ".dev"
dimension "server"
buildConfigField "String", "SERVER_HOST", "\"http://localhost/test\""
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.schibstedspain.android:leku:6.0.0'
implementation 'com.github.sparklit:adbutler-android-sdk:1.0'
implementation 'com.j256.ormlite:ormlite-core:5.0'
implementation 'com.j256.ormlite:ormlite-android:5.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.cardview:cardview:1.0.0-beta01'
implementation 'androidx.recyclerview:recyclerview:1.0.0-beta01'
implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.jakewharton.timber:timber:4.7.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
def nav_version = "1.0.0-alpha09"
implementation "android.arch.navigation:navigation-fragment:$nav_version"
// use -ktx for Kotlin
implementation "android.arch.navigation:navigation-ui:$nav_version"
// use -ktx for Kotlin
implementation 'pub.devrel:easypermissions:1.1.1'
implementation 'devlight.io:navigationtabbar:1.2.5'
}
configurations.all {
exclude group: 'com.google.guava', module: 'listenablefuture'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
build.gradle (project)
buildscript {
ext.kotlin_version = '1.3.11'
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://maven.google.com" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My bad (FIXED now)
Add this to build.gradle (app) in defaultConfig
multiDexEnabled true
build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
versionName "2.2.4"
versionCode 13
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
debug {
applicationIdSuffix ".debug"
versionNameSuffix ".d.5"
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions "server"
productFlavors {
prod {
applicationId "com.tfwm.lighting"
dimension "server"
buildConfigField "String", "SERVER_HOST", "\"http://www.test.com\""
}
dev {
applicationId "dev.tfwm.lighting"
versionNameSuffix ".dev"
dimension "server"
buildConfigField "String", "SERVER_HOST", "\"http://localhost/test\""
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.schibstedspain.android:leku:6.0.0'
implementation 'com.github.sparklit:adbutler-android-sdk:1.0'
implementation 'com.j256.ormlite:ormlite-core:5.0'
implementation 'com.j256.ormlite:ormlite-android:5.0'
implementation 'com.squareup.okhttp:okhttp:2.4.0'
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.cardview:cardview:1.0.0-beta01'
implementation 'androidx.recyclerview:recyclerview:1.0.0-beta01'
implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'androidx.vectordrawable:vectordrawable:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.facebook.fresco:fresco:1.9.0'
implementation 'com.jakewharton.timber:timber:4.7.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
testImplementation 'junit:junit:4.12'
def nav_version = "1.0.0-alpha09"
implementation "android.arch.navigation:navigation-fragment:$nav_version"
// use -ktx for Kotlin
implementation "android.arch.navigation:navigation-ui:$nav_version"
// use -ktx for Kotlin
implementation 'pub.devrel:easypermissions:1.1.1'
implementation 'devlight.io:navigationtabbar:1.2.5'
}
configurations.all {
// this is a workaround for the issue:
// https://stackoverflow.com/questions/52521302/how-to-solve-program-type-already-present-com-google-common-util-concurrent-lis
exclude group: 'com.google.guava', module: 'listenablefuture'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex in Android Studio 3.0 [closed]
Also solution is NOT REQUIRED if your minSdkVersion is set to 21 and above

IInAppBillingService Program type already present

I just updated my CompileSDKVersion and TargetSDK Version to 27, and updated the dependencies accordingly, and now my app won't run, it's getting this error:
Program type already present: com.android.vending.billing.IInAppBillingService
Message{kind=ERROR, text=Program type already present: com.android.vending.billing.IInAppBillingService, sources=[Unknown source file], tool name=Optional.of(D8)}
I'm using a billing library called checkout. I've tried reverting back to 26 and disabling certain dependencies but nothing seems to work.
My App Level Build.Gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "me.paxana.cwnet"
minSdkVersion 16
targetSdkVersion 27
versionCode 9
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.0'
implementation 'com.google.firebase:firebase-crash:15.0.0'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.firebaseui:firebase-ui-database:3.0.0'
implementation 'org.solovyev.android:checkout:1.2.1'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'me.zhanghai.android.materialratingbar:library:1.2.0'
implementation 'com.squareup.moshi:moshi:1.5.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
implementation 'com.anthonymandra:ToggleButtons:2.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.mikepenz:iconics-core:3.0.3#aar'
implementation 'com.mikepenz:fontawesome-typeface:5.0.6.0#aar'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
my project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://repo.spring.io/plugins-snapshot' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.24.4'
classpath 'io.spring.gradle:dependency-management-plugin:1.0.6.BUILD-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Graphhopper demo project doesn't work on Android Studio

I tried to work on Graphhopper demo project on Android Studio, which i found here: https://github.com/graphhopper/graphhopper/tree/master/android
After the Gradle building i got this error:
Error:Failed to resolve: com.graphhopper:graphhopper:0.6-SNAPSHOT
Now Android Studio cannot resolve symbols for Graphhopper classes.
Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.graphhopper.android"
minSdkVersion 10
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
lintOptions {
/* CGIARProvider refers to java.awt
* Helper7 refers to java.lang.management
* HeightTile refers to javax.imageio and java.awt
* OSMElement refers to javax.xml.stream
*/
disable 'InvalidPackage'
}
}
/** only necessary if you need to use latest SNAPSHOT
configurations.all {
// check for updates every build
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
**/
dependencies {
compile(group: 'com.graphhopper', name: 'graphhopper', version: '0.6-SNAPSHOT') {
exclude group: 'com.google.protobuf', module: 'protobuf-java'
exclude group: 'org.openstreetmap.osmosis', module: 'osmosis-osm-binary'
exclude group: 'org.apache.xmlgraphics', module: 'xmlgraphics-commons'
}
compile group: 'org.mapsforge', name: 'mapsforge-core', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map-android', version: '0.5.2'
compile group: 'org.mapsforge', name: 'mapsforge-map-reader', version: '0.5.2'
compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.12'
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.12'
}
It happens because com.graphhopper:graphhopper:0.6-SNAPSHOT is not in the central maven (or jcenter).
You can check all versions here.
The last stable version is 0.5.0
If you want to use the snapshot versions you have to add a repositoryin your build.gradle
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
Here the snapshot versions.

Categories