Could not resolve all files for configuration ‘:app:androidApis‘

这篇具有很好参考价值的文章主要介绍了Could not resolve all files for configuration ‘:app:androidApis‘。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

 我在第一次使用AndroidStudio时,编译项目遇到了此问题

Could not resolve all files for configuration ':app:androidApis'.
Failed to transform file 'android.jar' to match attributes {artifactType=android-mockable-jar, returnDefaultValues=false} using transform MockableJarTransform
Cannot create mockable android.jar
invalid entry compressed size (expected 17451 but got 17576 bytes)
 

后来上网查找了很多解决法案,试了很多方法,最后解决了,这是我的解决方案,在此分享给大家,希望能给你们带来帮助。

在出现上述问题的时候,打开sdk manager

could not resolve all files for configuration ':app:androidapis'.,android studio

下载一个低版本的API(这里我自己下的是api27)

could not resolve all files for configuration ':app:androidapis'.,android studio

下载完成后,接着打开file->pioject structure ,在modules的app中把sdk version 改为下载的那个版本

could not resolve all files for configuration ':app:androidapis'.,android studio

然后跟着下面图片修改,将项目app -> build.gradle中的sdk version改成下载的版本(只改数字,其他不用动)

could not resolve all files for configuration ':app:androidapis'.,android studio

在gradle scripts中的build.gradle(也就是另一个build.gradle)添加以下代码,如果已有,就覆盖修改

buildscript {
    
    repositories {
        google()
        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
    }
}

最后点击file - > invalidate caches /restart 进行清除缓存和重启,就好了,这是我第一次使用时遇到这个问题的解决方案了文章来源地址https://www.toymoban.com/news/detail-761655.html

到了这里,关于Could not resolve all files for configuration ‘:app:androidApis‘的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • Android问题笔记二十五:在构建提示“Could not resolve all files for configuration ‘:app:debugRuntimeClasspath”

    专栏分享 点击跳转=Unity3D特效百例 点击跳转=案例项目实战源码 点击跳转=游戏脚本-辅助自动化 点击跳转=Android控件全解手册 点击跳转=Scratch编程案例 点击跳转=软考全系列 众所周知,人生是一个漫长的流程,不断 克服困难 ,不断反思前进的过程。在这个过程中会产生很多对

    2024年02月03日
    浏览(38)
  • A problem occurred configuring root project ‘android‘.> Could not resolve all artifacts for configu

    1.异常描述android studio 构建报错提示无法加载dependencies中的插件  问题解决: buildscript中的repositories仓库中添加以以下仓库地址

    2024年02月03日
    浏览(57)
  • 报错解决A problem occurred configuring root project ‘android‘.> Could not resolve all artifacts for con

    报错如下 * Error running Gradle: ProcessException: Process \\\"C:Usersshunyuemydemoflutter_appandroidgradlew.bat\\\" Starting a Gradle Daemon (subsequent builds will be faster) FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project \\\'android\\\'. Could not resolve all artifacts for configuration \\\':classpath\\\'. 解

    2024年02月04日
    浏览(71)
  • Could not find a configuration file for package “OpenCV“ that is compatible with requested version “

    错误详情: 这个错误提示是在使用CMake构建项目时出现的,原因是CMake无法找到与所需OpenCV版本兼容的配置文件。 解决方法如下: 1. 确认OpenCV版本:首先需要确认所需的OpenCV版本是多少,然后检查系统中是否已经安装了该版本的OpenCV。 2. 指定OpenCV配置文件路径:如果系统中

    2024年02月07日
    浏览(33)
  • Could not resolve dependencies for project

    maven 打包Could not resolve dependencies for project和无效的目标发行版: 1.8 1.maven 打包Could not resolve dependencies for project 最近项目上使用的是idea ide的多模块话,需要模块之间的依赖,比如说系统管理模块依赖授权模块进行认证和授权,而认证授权模块需要依赖系统管理模块进行,然后

    2024年02月08日
    浏览(49)
  • 解决Truffle搭建项目环境时候出现ExtendableError: Could not find suitable configuration file.

    首先,搭建区块链环境需要一个私有链或者公链,这里使用的是Ganache的quickstart 创建一个区块链实例。如下图:红色圈圈里面代表端口,配置truffle-config.js会用到。 第二步:利用truffle init命令创建一个项目时,一般出现的文件目录如下: . ├── contracts │ └── Migrations.

    2024年02月03日
    浏览(39)
  • Maven编译报错:Could not resolve dependencies for project

    编译项目时 出现报错: Failed to execute goal on project xxx-mybatis: Could not resolve dependencies for project com.xxx:xxx-mybatis:jar:0.0.1-SNAPSHOT: Could not transfer artifact org.mybatis:mybatis:jar:3.4.5 from/to central ( https://repo.maven.apache.org/maven2): GET request of: org/mybatis/mybatis/3.4.5/mybatis-3.4.5.jar from central failed: Pr

    2024年02月03日
    浏览(39)
  • 报错解决:Could not find a package configuration file provided by “Pangolin“以及一系列问题

    Pangolin是一个用于视觉SLAM(Simultaneous Localization and Mapping,同时定位与地图构建)的开源软件包,旨在帮助机器人、自动驾驶汽车、无人机和其他自主系统实现实时的三维环境感知和定位。该软件包由Steven Lovegrove和Rok Solidar于2013年创建,其主要功能是使用视觉传感器(例如摄

    2024年02月01日
    浏览(50)
  • fatal: could not read Username for ‘https://git.xxx.com‘: Device not configured

    使用sourcetree完成当前项目时报错 1、创建的feature分支,完成当前项目时 2、创建的hotfix分支,完成当前项目时 1.在使用 webhook 自动部署时测试出现此问题 2.这里是因为你的git仓库是有用户名和密码,但是你没有配置git仓库的用户名和密码,而导致的问题 1、在你的私有库文件

    2024年02月12日
    浏览(54)
  • Could not create parent directory for lock file

    今天做开发的时候 上午还好好的项目,导了写东西后 下午构建的时候就报这个错。 Could not create parent directory for lock file 这个错多半是缓存gradle文件的权限有问题 总结了一下,有几个方法: 1、terminal中  清除缓存 ./gradlew clean  然后  ./gradlew  assembleDebug       2、Invalidate

    2024年02月12日
    浏览(40)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包