I have forked a project from github, modified it and now I want to use my modified version as dependency in my project. Like this:
implementation("com.github.my_user_name:library_name:master-SNAPSHOT")
For this I looked fro my repo on JitPack to see if it builds alright, and it did
but when I run the project I get this error:
Configuration cache state could not be cached: field __librarySourceSets__ of task :app:mapDebugSourceSetPaths of type com.android.build.gradle.tasks.MapSourceSetPathsTask`: error writing value of type 'org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection
> Could not resolve all files for configuration ':app:debugRuntimeClasspath.
//build.gradle,kts(MyAppName)
@Suppress(“DSL_SCOPE_VIOLATION”) // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinAndroid) apply false
alias(libs.plugins.androidLibrary) apply false
alias(libs.plugins.hiltAndroid) apply false
alias(libs.plugins.kotlin.plugin.serialization) apply false // needs to be as the project’s JVM version
alias(libs.plugins.ksp) apply false
alias(libs.plugins.org.jetbrains.kotlin.jvm) apply false
}
true // Needed to make the Suppress annotation work for the plugins block
//settings.gradle.kts(MyAppName)
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri(“https://www.jitpack.io” )
}
}
}
rootProject.name = “MyAppNAme”
include(“:app”)
include(“:feature:profile”) // this is where I want to use the library
//build.gradle.kts(:feature:profile)
@Suppress(“DSL_SCOPE_VIOLATION”) // TODO: Remove once KTIJ-19369 is fixed
plugins {
alias(libs.plugins.androidLibrary)
alias(libs.plugins.kotlinAndroid)
alias(libs.plugins.hiltAndroid)
alias(libs.plugins.kotlin.plugin.serialization)
alias(libs.plugins.ksp)
}
android {
namespace = “com.example.feature.profile”
compileSdk = 34
defaultConfig {
minSdk = 24
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles("consumer-rules.pro")
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
// excludes += "META-INF/DEPENDENCIES"
// Avoid SRT and RTMP clash, from StreamPack
pickFirsts += "**/*.so"
}
}
buildFeatures {
compose = true
}
composeOptions {
//kotlinCompilerExtensionVersion = "1.5.4" // !important to keep this version
kotlinCompilerExtensionVersion = "1.5.8"
}
}
dependencies {
implementation(“com.github.my_user_name:library_name:master-SNAPSHOT”)
}
Is this the right way to use github repo as a dependency. If not, what am I doing wrong?