无法找到com.kyanogen.signatureview:1.2依赖的技术问询
问题描述
自2024年10月15日起,无法在Android项目中使用com.kyanogen.signatureview:signature-view:1.2库,执行Gradle构建时出现以下错误:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.Could not find com.kyanogen.signatureview:signature-view:1.2.
Required by:
project :appPossible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
项目的app/build.gradle代码如下:
import java.text.SimpleDateFormat plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' id 'com.google.gms.google-services' } android { compileSdkVersion 31 buildToolsVersion '30.0.3' def versionPropsFile = file('version.properties') def value = 1 Properties versionProps = new Properties() if (!versionPropsFile.exists()) { versionProps['VERSION_PATCH'] = "1" versionProps['VERSION_NUMBER'] = "-1" versionProps['VERSION_BUILD'] = "-1" // I set it to minus one so the first build is 0 which isn't super important. versionProps.store(versionPropsFile.newWriter(), null) } def runTasks = gradle.startParameter.taskNames if ('assembleRelease' in runTasks) { value = 1 } def mVersionName = "" def mFileName = "" if (versionPropsFile.canRead()) { versionProps.load(new FileInputStream(versionPropsFile)) versionProps['VERSION_PATCH'] = (versionProps['VERSION_PATCH'].toInteger() + value).toString() versionProps['VERSION_NUMBER'] = (versionProps['VERSION_NUMBER'].toInteger() + value).toString() versionProps['VERSION_BUILD'] = (versionProps['VERSION_BUILD'].toInteger() + value).toString() versionProps.store(versionPropsFile.newWriter(), null) // 1: change major and minor version here mVersionName = "1.5.${versionProps['VERSION_PATCH']}" // 2: change AppName for your app name mFileName = "AppName-${mVersionName}.apk" defaultConfig { // versionName "${mVersionName} Build: ${versionProps['VERSION_BUILD']}" applicationId "com.example.esales" minSdkVersion 23 targetSdkVersion 31 versionCode 1 versionName "${mVersionName}" resConfigs "en" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } }else { throw new FileNotFoundException("Could not read version.properties!") } buildTypes { debug { buildConfigField("int", "BUILD_TIME", System.currentTimeSeconds().toString()) buildConfigField "String", "BUILD_DATE", "\"${new SimpleDateFormat("dd.MM.yyyy").format(new Date())}\"" } release { buildConfigField "String", "BUILD_DATE", "\"${new SimpleDateFormat("dd.MM.yyyy").format(new Date())}\"" useProguard true minifyEnabled true shrinkResources true 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{ viewBinding true } packagingOptions { resources.excludes.add("META-INF/NOTICE.md") resources.excludes.add("META-INF/LICENSE.md") resources.excludes.add("META-INF/DEPENDENCIES") exclude 'AndroidManifest.xml' exclude 'lib/arm64-v8a/libcardioDecider.so' exclude 'lib/arm64-v8a/libcardioRecognizer.so' exclude 'lib/arm64-v8a/libcardioRecognizer_tegra2.so' exclude 'lib/arm64-v8a/libopencv_core.so' exclude 'lib/arm64-v8a/libopencv_imgproc.so' exclude 'lib/armeabi/libcardioDecider.so' exclude 'lib/armeabi-v7a/libcardioDecider.so' exclude 'lib/armeabi-v7a/libcardioRecognizer.so' exclude 'lib/armeabi-v7a/libcardioRecognizer_tegra2.so' exclude 'lib/armeabi-v7a/libopencv_core.so' exclude 'lib/armeabi-v7a/libopencv_imgproc.so' exclude 'lib/mips/libcardioDecider.so' exclude 'lib/x86/libcardioDecider.so' exclude 'lib/x86/libcardioRecognizer.so' exclude 'lib/x86/libcardioRecognizer_tegra2.so' exclude 'lib/x86/libopencv_core.so' exclude 'lib/x86/libopencv_imgproc.so' exclude 'lib/x86_64/libcardioDecider.so' exclude 'lib/x86_64/libcardioRecognizer.so' exclude 'lib/x86_64/libcardioRecognizer_tegra2.so' exclude 'lib/x86_64/libopencv_core.so' exclude 'lib/x86_64/libopencv_imgproc.so' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation 'androidx.core:core-ktx:1.5.0' implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.5.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'com.google.android.gms:play-services-maps:18.0.2' implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0' testImplementation 'junit:junit:4.+' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' def appCenterSdkVersion = '4.3.1' implementation "com.microsoft.appcenter:appcenter-analytics:${appCenterSdkVersion}" implementation "com.microsoft.appcenter:appcenter-crashes:${appCenterSdkVersion}" // Okhttp3 for the POST requests implementation 'com.squareup.okhttp3:okhttp:4.9.0' // Gson (To convert raw JSON to pretty JSON) implementation 'com.google.code.gson:gson:2.8.6' //Navigation Drawer implementation 'com.google.android.material:material:1.6.0-alpha01' //recyclerView implementation 'androidx.recyclerview:recyclerview:1.2.0' //bt printer implementation 'com.github.dantsu:escpos-thermalprinter-android:2.0.11' //circle Image implementation 'de.hdodenhof:circleimageview:3.1.0' // Retrofit implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' // Coroutines to make the HTTP requests asynchronous(In the background thread) implementation ('org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3-native-mt') implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2' // Coroutine Lifecycle Scopes implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0" implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0" //MPChart implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0' // // iText PDF // implementation 'com.karumi:dexter:6.0.0' // implementation 'com.itextpdf:itextg:5.5.10' //pdfViewer implementation('com.github.mhiew:android-pdf-viewer:3.2.0-beta.3') //progressDialog implementation "androidx.cardview:cardview:1.0.0" //bottomNavigatorNew implementation 'com.google.android.material:material:1.0.0' //picasso implementation 'com.squareup.picasso:picasso:2.71828' //toggleswitchupdated implementation 'com.github.jaycee88:Android-Toggle-Switch:1.2.3.1' //quickaction implementation 'com.github.piruin:quickaction:2.4.3' //searchinvoice implementation 'com.github.miteshpithadiya:SearchableSpinner:master' //BarcodeScanner implementation 'com.google.android.gms:play-services-vision:20.1.3' //SwipeRecycerView implementation 'com.github.tsuryo:Swipeable-RecyclerView:1.1' //floating button implementation 'com.google.android.material:material:1.3.0-alpha02' //image Badge View implementation("io.github.nikartm:image-support:2.0.0") //implementation 'nl.bryanderidder:themed-toggle-button-group:1.4.1' //this not used remove if need implementation 'com.github.psinetron:slycalendarview:0.0.9' //longlatgoogle implementation 'com.google.android.gms:play-services-location:18.0.0' //gmail server implementation 'com.sun.mail:android-mail:1.6.6' implementation 'com.sun.mail:android-activation:1.6.7' //signature openCv implementation 'com.kyanogen.signatureview:signature-view:1.2' //Drive implementation 'com.google.api-client:google-api-client-android:1.23.0' implementation 'com.google.apis:google-api-services-drive:v3-rev136-1.25.0' implementation 'com.google.android.gms:play-services-auth:20.3.0' implementation 'com.google.guava:guava:27.0.1-android' implementation platform('com.google.firebase:firebase-bom:31.0.1') implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.work:work-runtime-ktx:2.7.0' implementation 'com.github.ligi:tracedroid:4.1' //btprint implementation 'com.github.anggastudio:Printama:0.9.7' //new spinner implementation 'com.github.arcadefire:nice-spinner:1.4.4' implementation 'com.squareup.okhttp3:okhttp:4.10.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.10.0' }
疑问:该库是否已被弃用?如何解决此问题以继续使用该库?
解决方案
库状态说明
com.kyanogen.signatureview:signature-view:1.2已从公开远程仓库移除,无法再通过常规Gradle远程依赖方式获取,相当于已被弃用或下架。
解决方法
1. 本地引入库文件
- 从旧项目的Gradle缓存目录(一般在
~/.gradle/caches/modules-2/files-2.1/com.kyanogen.signatureview/signature-view/1.2/)找到对应的aar文件,或从该库历史源码编译生成aar/jar。 - 将文件复制到项目的
app/libs目录下。 - 修改
app/build.gradle中的依赖,替换原远程依赖:// 替换原来的implementation 'com.kyanogen.signatureview:signature-view:1.2' implementation files('libs/signature-view-1.2.aar')
2. 迁移至替代库
选择仍在维护的第三方签名库,例如com.github.gcacace:signature-pad:1.3.1(需确保根项目build.gradle配置对应仓库),或AndroidX官方签名组件。修改布局文件中的签名控件引用,以及代码逻辑适配新库API。
3. 自行维护源码
若能找到该库开源源码,可fork仓库后自行维护:
- 将源码作为模块导入项目,或编译成aar后本地引入。
- 后续可按需修复bug、适配新Android版本。
内容的提问来源于stack exchange,提问作者Ijaas Fouzer
相关产品推荐
相关产品推荐

