I know there are thousand of similar topic of gradle failed resolving the library download process. But since this is a new gradle, i encoutered too many errors from the previous succesfully project.
The error keeps showing? Why is this happened. I already define the configuration correctly. (sigh)
So then now I tried to use the new gradle 7.2 with the following settings.gradle:
pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\.android.*")
includeGroupByRegex("com\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
maven { url "https://jitpack.io" }
mavenCentral()
}
}
rootProject.name = "CPP Compiler"
include ':app'
The interesting part here is libs.versions.toml already defined :
[versions]
agp = "8.4.1"
kotlin = "1.9.0"
coreKtx = "1.10.1"
lifecycleRuntimeKtx = "2.6.1"
activityCompose = "1.8.0"
composeBom = "2023.08.00"
pdfviewpagerLibrary = "1.1.3"
[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-ui = { group = "androidx.compose.ui", name = "ui" }
androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
es-voghdev-pdfviewpager-library = { group ="es.voghdev.pdfviewpager", name="library", version.ref = "pdfviewpagerLibrary" }
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
And along the way for the build.gradle (module app)
I just use this without any typos :
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}
android {
namespace 'fgroupindonesia.cppcompiler'
compileSdk 34
defaultConfig {
applicationId "fgroupindonesia.cppcompiler"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.1'
}
packaging {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}
dependencies {
implementation libs.androidx.core.ktx
implementation libs.androidx.lifecycle.runtime.ktx
implementation libs.androidx.activity.compose
implementation platform(libs.androidx.compose.bom)
implementation libs.androidx.ui
implementation libs.androidx.ui.graphics
implementation libs.androidx.ui.tooling.preview
implementation libs.androidx.material3
implementation libs.es.voghdev.pdfviewpager.library
debugImplementation libs.androidx.ui.tooling
}
Does anyone know where the missing point here? I confused, everytime changing laptop to another place thus, different Gradle, different configuration needed. (sigh)
Change it from
es-voghdev-pdfviewpager-library = { group ="es.voghdev.pdfviewpager", name="library", version.ref = "pdfviewpagerLibrary" }
to
pdfviewpagerLibrary = "1.1.2"
es-voghdev-pdfviewpager-library = { group ="com.github.voghDev", name="PdfViewPager", version.ref = "pdfviewpagerLibrary" }
here is the reference
https://jitpack.io/#voghDev/PdfViewPager/1.1.2
Test: