AndroidSerialPort
AndroidSerialPort copied to clipboard
无法正常引用
按说明添加了 dependencies { implementation 'com.github.Acccord:AndroidSerialPort:1.5.0' } 但是一直无法正常引用 Failed to resolve: com.github.Acccord:AndroidSerialPort:1.5.0
@wesleyisme 多构建几次,我这边按照说明操作的,没有出现这个情况,或者再清理下缓存后重新构建
尝试在"allprojects"中添加maven { url 'https://jitpack.io' }
,而不是在"buildscript"中添加,如:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.1"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
如果报错:Build was configured to prefer settings repositories over project repositories but repository 'maven' was added by build file 'build.gradle'
,可以删除"allprojects"块,并在项目根目录的settings.gradle
文件中添加maven { url 'https://jitpack.io' }
,如:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
jcenter() // Warning: this repository is going to shut down soon
}
}