【问题标题】:Maven project and android dependenciesMaven项目和android依赖
【发布时间】:2020-04-16 19:43:54
【问题描述】:

尝试将android依赖项添加到maven项目,但无法获取依赖项。获取 android 依赖项有什么特别之处吗?


<repository>
    <id>google</id>
    <url>https://maven.google.com/</url>
</repository>

<dependency>
    <groupId>androidx.appcompat</groupId>
    <artifactId>appcompat</artifactId>
    <version>1.1.0</version>
</dependency>

还有错误:

Cannot resolve androidx.appcompat:appcompat:1.1.0

【问题讨论】:

    标签: android maven dependencies pom.xml


    【解决方案1】:

    添加

     <scope>runtime</scope>
    

    喜欢这个

    <dependency>
    <groupId>androidx.appcompat</groupId>
    <artifactId>appcompat</artifactId>
    <version>1.0.2</version>
    <scope>runtime</scope>
    </dependency>
    

    【讨论】:

    • 还是一样:Cannot resolve androidx.appcompat:appcompat:1.1.0
    • 嗯,这是个好问题。它不只是一个应该从存储库下载的jar吗?
    猜你喜欢
    • 2011-04-15
    • 2018-10-20
    • 1970-01-01
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多