osmbonuspack icon indicating copy to clipboard operation
osmbonuspack copied to clipboard

Failed to resolve: com.github.mkergall:osmbonuspack:6.9.0 [build Gradle warning]

Open erAmanpal opened this issue 2 years ago • 1 comments

Dear Developer/s

I am unable to use osmbonuspack because I of the subject cited above.

image

I have refer many articles and stackoverflow.com, but none of the method works for me.

A little help will be very useful to me thanks. I am sending the code of both gradle file below for your reference. Thanks in advance.

[Build gradle (app module)] //import org.gradle.api.initialization.resolve.RepositoriesMode

plugins { id 'com.android.application' // Add the Google services Gradle plugin id 'com.google.gms.google-services' id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' }

android { namespace 'com.example.transphillaur' compileSdk 33

defaultConfig {
    applicationId "com.example.transphillaur"
    minSdk 24
    targetSdk 33
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}

repositories {   // local repo

// mavenCentral() flatDir { dirs 'libs' } }

compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
buildFeatures {
    viewBinding true
}

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.google.firebase:firebase-auth:21.1.0'
implementation 'com.google.firebase:firebase-database:20.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

//Open street map  osmdroid wiki plugin
implementation 'org.osmdroid:osmdroid-android:6.1.16'
//OSMBonusPack

// implementation project(":OSMBonusPack") implementation 'androidx.legacy:legacy-support-v4:1.0.0'

compileOnly(name: 'osmbonuspack_6.9.0', ext: 'aar')

implementation 'com.github.mkergall:osmbonuspack:6.9.0'



// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:31.3.0')


// TODO: Add the dependencies for Firebase products you want to use
// When using the BoM, don't specify versions in Firebase dependencies
implementation 'com.google.firebase:firebase-analytics:21.2.2'


// Add the dependencies for any other desired Firebase products
// https://firebase.google.com/docs/android/setup#available-libraries


//implementation 'com.google.android.gms:play-services-maps:17.0.0'

// implementation name:'osmbonuspack_6.9.0', ext:'aar' implementation 'org.osmdroid:osmdroid-android:6.1.16' implementation 'org.apache.commons:commons-lang3:3.12.0' implementation 'com.google.code.gson:gson:2.10.1' implementation 'com.squareup.okhttp3:okhttp:4.7.2'

}

//dependencyResolutionManagement { // repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) // repositories { // google() // mavenCentral() // jcenter() // maven { url 'https://jitpack.io' } // } //}

[Build gradle : Project level] //import org.gradle.api.initialization.resolve.RepositoriesMode

// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { // Make sure that you have the following two repositories google() // Google's Maven repository mavenCentral() // Maven Central repository maven { url "https://jitpack.io" } //OSMBonusPack is available through JitPack (it is not available on Maven Central).

     // local repo
        //mavenCentral()

// flatDir { // dirs 'libs' // }

}
dependencies {
    // Add the dependency for the Google services Gradle plugin
    classpath 'com.google.gms:google-services:4.3.15'


}

// dependencyResolutionManagement { // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // repositories { // google() // mavenCentral() // maven { url 'https://jitpack.io' } // jcenter() // Warning: this repository is going to shut down soon // } // }

}

plugins { id 'com.android.application' version '7.4.2' apply false id 'com.android.library' version '7.4.2' apply false id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin' version '2.0.1' apply false }

allprojects { repositories { // Make sure that you have the following two repositories google() // Google's Maven repository mavenCentral() // Maven Central repository

}

}

erAmanpal avatar Apr 22 '23 15:04 erAmanpal

Quick clue about this nightmare:

Have a look at this example: https://github.com/MKergall/osmbonuspack/blob/master/OSMBonusPackTuto/build.gradle Then choose to include OBP either using JitPack, or as a local lib, but don't mix both.

MKergall avatar Apr 24 '23 12:04 MKergall