Getting error while integrating jitpack.io in android

95 views Asked by At

Hi I am getting this error while I sync the project e: D:\Projects\Android Projects\Learning\Android\Task\settings.gradle.kts:13:21: Unexpected tokens (use ';' to separate expressions on the same line)

this is my settings.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
}

rootProject.name = "Gweiland_Task"
include(":app")

and this is my module and project level build file

project

// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
    id("com.android.application") version "8.1.2" apply false
}

module

plugins {
    id("com.android.application")
}

android {
    namespace = "com.example.gweiland_task"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.example.gweiland_task"
        minSdk = 25
        targetSdk = 34
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    viewBinding {
        enable = true
    }
}

dependencies {

    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.10.0")
    implementation("androidx.constraintlayout:constraintlayout:2.1.4")
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.5")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")

//    mp chart
    implementation("com.github.PhilJay:MPAndroidChart:v3.1.0")
    implementation("com.github.jitpack:android-example:1.0.1")
}

I am trying to import the jitpack.io for one of my libraries

2

There are 2 answers

0
Sergei Kozelko On

You are trying to use Groovy code in a Kotlin build script. The correct syntax is

maven { url = uri("https://jitpack.io") }
0
littleoldlady On

With hedgehog AS I used the following in settings.gradle:

marvin(url= "https://jitpack.io")