适用于 Android 应用程序的 EditSpinner。 Android Studio 更新后如何修复或替换丢失的库?

问题描述 投票:0回答:1

我真的需要帮助。我有一个小型应用程序项目,它使用 GitHub 上的 EditSpinner 库,它对我来说是一个至关重要的组件。几天前,由于 Android Studio 更新,我的整个项目崩溃了。我好不容易才把它拼凑起来,但现在我无法访问这个图书馆。没有它,什么都行不通。您能否建议如何解决此问题或提出替代方案?是否可以不使用存储库而直接将下载的源代码集成到我的项目中?

repositories {
    mavenCentral()
    google()
    jcenter()
}


dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'org.jetbrains:annotations:15.0'
    implementation 'com.google.code.gson:gson:2.8.8'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'

    implementation "com.reginald:editspinner:1.1.0"


    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

}
Failed to resolve: com.reginald:editspinner:1.1.0
Show in Project Structure dialog
Affected Modules: app

我尝试了在互联网上可以找到的所有内容,但是专门关于此组件的信息很少。

java android jcenter
1个回答
0
投票

我通过从 build.gradle 中删除依赖项并直接从存储库包含 2 个源文件来修复它:https://github.com/xyxyLiu/Edit-Spinner

我复制的源文件是

  • com.reginald.editspinner.EditSpinner.java
    - 确保也创建了
    com/reginald/editspinner
    包文件夹树
  • attrs.xml
    - 把它放进去
    res/values

EditSpinner.java 需要进行一些小的更改:

  • EditSpinner.DEBUG
    常数更改为
    false
  • 导入我的项目自己的
    R
    类。
© www.soinside.com 2019 - 2024. All rights reserved.