AndroidSerialPort icon indicating copy to clipboard operation
AndroidSerialPort copied to clipboard

无法正常引用

Open wesleyisme opened this issue 3 years ago • 2 comments

按说明添加了 dependencies { implementation 'com.github.Acccord:AndroidSerialPort:1.5.0' } 但是一直无法正常引用 Failed to resolve: com.github.Acccord:AndroidSerialPort:1.5.0

wesleyisme avatar Jan 08 '22 13:01 wesleyisme

@wesleyisme 多构建几次,我这边按照说明操作的,没有出现这个情况,或者再清理下缓存后重新构建

ssy341 avatar Jan 26 '22 17:01 ssy341

尝试在"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
    }
}

rihua63 avatar Jan 22 '24 07:01 rihua63