android-studio - 在 android studio 中实现 com.amulyakhare 库
问题描述
您好,我正在尝试将一个名为 amulyakare 的库从 github 导入到我的 android studio 项目中,但同步后我一直收到以下错误:
Failed to resolve: com.amulyakhare:com.amulyakhare.textdrawable:1.0.1
Show in Project Structure dialog
Affected Modules: app
您可以在此处找到该库的 github 页面:
这是 build.gradle(app) 中的代码:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.example.androidnewchatapp"
minSdkVersion 28
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:27.1.0')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//Firebase UI
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
implementation 'com.firebaseui:firebase-ui-database:7.1.1'
//viewPager 2
implementation 'androidx.viewpager2:viewpager2:1.1.0-alpha01'
//ButterKnife
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor'com.jakewharton:butterknife-compiler:10.2.3'
//Dexter
implementation 'com.karumi:dexter:6.1.2'
//TextDrawable (The amulyakhare Library)
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
//EventBus
implementation 'org.greenrobot:eventbus:3.2.0'
//Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.google.firebase:firebase-analytics'
}
我不知道库是否有问题,或者我的代码中是否缺少某些内容。提前感谢那些可以提供帮助的人
解决方案
我想到了
1)在你的项目级gradle添加jcenter()
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
推荐阅读
- c - 递归函数降序输出
- html - 使用 jsoup 将 html 文本替换为 span
- python - Python RotatingFileHandler 似乎没有旋转日志
- phoenix-framework - Ecto.Repo 检查 id 是否存在于数据库中,Phoenix 框架
- angular5 - 选项卡关闭角度 5 时的 API 调用
- c++ - 在从给定超类继承的所有类上调用虚函数
- angular - 如何使整个 mat-tab 功能像锚标签
- java - 在单元测试中与 KafkaEmbedded 一起使用时,@DirtiesContext 的行为是什么?
- android - 阻止从 google play 下载 apk
- c# - 动态数据网格视图更新