Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法正常引用 #5

Open
wesleyisme opened this issue Jan 8, 2022 · 2 comments
Open

无法正常引用 #5

wesleyisme opened this issue Jan 8, 2022 · 2 comments

Comments

@wesleyisme
Copy link

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

@ssy341
Copy link

ssy341 commented Jan 26, 2022

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

@rihua63
Copy link

rihua63 commented Jan 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants