android-studioimportshared-librariesgithub-apiimplementation

implementing the com.amulyakhare library in android studio


Hello i am trying to import a library called amulyakhare from github into my android studio project but i keep getting the following error after syncing:

Failed to resolve: com.amulyakhare:com.amulyakhare.textdrawable:1.0.1
Show in Project Structure dialog
Affected Modules: app

You can find the github page of the library here :

@github/amulyakhare

This is the code in the build.gradle(app):

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'



android {
    compileSdkVersion 30

    defaultConfig {
        applicationId "com.example.androidnewchatapp"
        minSdkVersion 28
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

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

}

dependencies {


    implementation platform('com.google.firebase:firebase-bom:27.1.0')

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'



    //Firebase UI
    implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
    implementation 'com.firebaseui:firebase-ui-database:7.1.1'



    //viewPager 2
    implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'

    //ButterKnife
    implementation 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor'com.jakewharton:butterknife-compiler:10.2.3'

    //Dexter
    implementation 'com.karumi:dexter:6.1.2'

    //TextDrawable (The amulyakhare Library)
    implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'

    //EventBus
    implementation 'org.greenrobot:eventbus:3.2.0'

    //Glide
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor'com.github.bumptech.glide:compiler:4.11.0'


    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    implementation 'com.google.firebase:firebase-analytics'
}

i dont know if there is something wrong wih the library or there is something missing in my code. Thank you in adnvance to those who can help out


Solution

  • I figured it out

    1)In your project level gradle add jcenter()

    allprojects {
        repositories {
            google()
            jcenter()
            maven { url 'https://jitpack.io' }
        }
    }