Android Studio Giraffe-2022.3.1-Patch-3安装注意事项

2023-11-29 18:44

本文主要是介绍Android Studio Giraffe-2022.3.1-Patch-3安装注意事项,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

准备工作:

android studio下载地址:https://developer.android.google.cn/studio/releases?hl=zh-cn
gradle下载地址:https://services.gradle.org/distributions/
比较稳定的网络环境(比较android studio相关的依赖需要从谷歌那边下载的)
连接超时大部分是网络环境问题

一、环境

系统:Win11、jdk17
Android Studio Giraffe | 2022.3.1 Patch 3
gradle8.0

android studio安装省略,基本上是下一步下一步

需要注意:安装路径改成自己想安装的位置,如D盘
选择定制方式就可以选择自己想安装的位置
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

添加阿里云镜像:
在这里插入图片描述
创建 init.gradle 文件,gradle为文件格式
在这里插入图片描述

allprojects {repositories { mavenLocal() maven { name "Alibaba" ; url "https://maven.aliyun.com/repository/public" } maven { name "Bstek" ; url "https://nexus.bsdn.org/content/groups/public/" } mavenCentral()}buildscript {repositories { maven { name "Alibaba" ; url 'https://maven.aliyun.com/repository/public' } maven { name "Bstek" ; url 'https://nexus.bsdn.org/content/groups/public/' } maven { name "M2" ; url 'https://plugins.gradle.org/m2/' }}}
}

不够还能继续添加:

        maven {url = uri("https://maven.aliyun.com/repository/central")}  maven {url = uri("https://maven.aliyun.com/repository/public")}  maven {url = uri("https://maven.aliyun.com/repository/gradle-plugin")}  maven {url = uri("https://maven.aliyun.com/repository/google")}  maven {url = uri("https://jitpack.io")}  

二、配置

gradle配置:
在这里插入图片描述

Specified location对应地址:D:/Software/Android/gradle-repository/wrapper/dists/gradle-8.0-all/gradle-8.0

在这里插入图片描述

SDK位置:
在这里插入图片描述

gradle-wrapper.properties 配置:
在这里插入图片描述

遇到的问题

1.Android Gradle 插件和 Android Studio 兼容性

编译器版本:
在这里插入图片描述

Android Studio Giraffe | 2022.3.1 Patch 3
Build #AI-223.8836.35.2231.11005911, built on October 26, 2023
Runtime version: 17.0.6+0-b2043.56-10027231 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 11 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1024M
Cores: 8
Registry:external.system.auto.import.disabled=truedebugger.new.tool.window.layout=trueide.text.editor.with.preview.show.floating.toolbar=falseide.experimental.ui=trueNon-Bundled Plugins:Batch Scripts Support (1.0.13)CMD Support (1.0.5)

从版本信息中可以看到 android studio 2022.3.1需要对应的运行环境是JDK17

于是从官网文档中查看对应版的Gradle版本是3.2到8.1之间,我选择gradle plugin为7.4.2gradle版本是8.0

在这里插入图片描述

AGP指Android Gradle 插件 (AGP)

3.android系统版本对应的sdk版本

android API 升级
在这里插入图片描述

自 2023 年 8 月 31 日起,所有应用都**必须以 Android 12(API 级别 33)**或更高版本为目标平台,才能送交
Google Play 审核,否则可能无法被某些 Google Play 用户发现。将应用的目标 API 级别配置为新近的 API
级别可确保用户享受到安全性和性能方面的改进,同时应用仍然可以在较低版本的 Android(低至指定的
minSdkVersion)上运行。如需了解详情,请参阅 Google Play 的目标 API 级别要求。

编译器对应的支持的API级别上限
在这里插入图片描述

3. 控制台报错 A problem occurred configuring root project ‘My Application3’.

A problem occurred configuring root project 'My Application3'.
> Could not resolve all files for configuration ':classpath'.> Could not resolve com.android.tools.build:gradle:7.4.2.Required by:project : > com.android.application:com.android.application.gradle.plugin:7.4.2> No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a library for use during runtime, compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.0' but:- Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')- Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a component for use during runtime, and its dependencies declared externally:- Incompatible because this component declares documentation and the consumer needed a library- Other compatible attributes:- Doesn't say anything about its target Java version (required compatibility with Java 8)- Doesn't say anything about its elements (required them packaged as a jar)- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')- Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a library for use during runtime, packaged as a jar, and its dependencies declared externally:- Incompatible because this component declares a component, compatible with Java 11 and the consumer needed a component, compatible with Java 8- Other compatible attribute:- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')- Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a component for use during runtime, and its dependencies declared externally:- Incompatible because this component declares documentation and the consumer needed a library- Other compatible attributes:- Doesn't say anything about its target Java version (required compatibility with Java 8)- Doesn't say anything about its elements (required them packaged as a jar)- Doesn't say anything about org.gradle.plugin.api-version (required '8.0')

Incompatible because this component declares a component for use during compile-time, compatible with Java 11 and the consumer needed a component for use during runtime, compatible with Java 8
不兼容,因为该组件声明了一个在编译时使用的组件,与 Java 11 兼容,而消费者需要一个在运行时使用的组件,与 Java 8 兼容
解决方法:使用JDK17即可解决

在这里插入图片描述

附件

参考:
Android Studio下载及安装和Gradle的配置

Android Studio Giraffe | 2022.3.1版本说明

Android studio汉化(2023最新版)

Android Studio.exe 下载 2023 最新更新,网盘下载

Android Studio 中最新的 Gradle 配置中设置插件依赖 ( 2023 年 8 月 24 日 | 最新 Gradle 中配置插件依赖的变化 | 增加 Maven 仓库源 )

这篇关于Android Studio Giraffe-2022.3.1-Patch-3安装注意事项的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/433912

相关文章

gitlab安装及邮箱配置和常用使用方式

《gitlab安装及邮箱配置和常用使用方式》:本文主要介绍gitlab安装及邮箱配置和常用使用方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1.安装GitLab2.配置GitLab邮件服务3.GitLab的账号注册邮箱验证及其分组4.gitlab分支和标签的

MySQL MCP 服务器安装配置最佳实践

《MySQLMCP服务器安装配置最佳实践》本文介绍MySQLMCP服务器的安装配置方法,本文结合实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下... 目录mysql MCP 服务器安装配置指南简介功能特点安装方法数据库配置使用MCP Inspector进行调试开发指

在Windows上使用qemu安装ubuntu24.04服务器的详细指南

《在Windows上使用qemu安装ubuntu24.04服务器的详细指南》本文介绍了在Windows上使用QEMU安装Ubuntu24.04的全流程:安装QEMU、准备ISO镜像、创建虚拟磁盘、配置... 目录1. 安装QEMU环境2. 准备Ubuntu 24.04镜像3. 启动QEMU安装Ubuntu4

Python UV安装、升级、卸载详细步骤记录

《PythonUV安装、升级、卸载详细步骤记录》:本文主要介绍PythonUV安装、升级、卸载的详细步骤,uv是Astral推出的下一代Python包与项目管理器,主打单一可执行文件、极致性能... 目录安装检查升级设置自动补全卸载UV 命令总结 官方文档详见:https://docs.astral.sh/

Nexus安装和启动的实现教程

《Nexus安装和启动的实现教程》:本文主要介绍Nexus安装和启动的实现教程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、Nexus下载二、Nexus安装和启动三、关闭Nexus总结一、Nexus下载官方下载链接:DownloadWindows系统根

Java SWT库详解与安装指南(最新推荐)

《JavaSWT库详解与安装指南(最新推荐)》:本文主要介绍JavaSWT库详解与安装指南,在本章中,我们介绍了如何下载、安装SWTJAR包,并详述了在Eclipse以及命令行环境中配置Java... 目录1. Java SWT类库概述2. SWT与AWT和Swing的区别2.1 历史背景与设计理念2.1.

安装centos8设置基础软件仓库时出错的解决方案

《安装centos8设置基础软件仓库时出错的解决方案》:本文主要介绍安装centos8设置基础软件仓库时出错的解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录安装Centos8设置基础软件仓库时出错版本 8版本 8.2.200android4版本 javas

Android学习总结之Java和kotlin区别超详细分析

《Android学习总结之Java和kotlin区别超详细分析》Java和Kotlin都是用于Android开发的编程语言,它们各自具有独特的特点和优势,:本文主要介绍Android学习总结之Ja... 目录一、空安全机制真题 1:Kotlin 如何解决 Java 的 NullPointerExceptio

Pytorch介绍与安装过程

《Pytorch介绍与安装过程》PyTorch因其直观的设计、卓越的灵活性以及强大的动态计算图功能,迅速在学术界和工业界获得了广泛认可,成为当前深度学习研究和开发的主流工具之一,本文给大家介绍Pyto... 目录1、Pytorch介绍1.1、核心理念1.2、核心组件与功能1.3、适用场景与优势总结1.4、优

conda安装GPU版pytorch默认却是cpu版本

《conda安装GPU版pytorch默认却是cpu版本》本文主要介绍了遇到Conda安装PyTorchGPU版本却默认安装CPU的问题,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的... 目录一、问题描述二、网上解决方案罗列【此节为反面方案罗列!!!】三、发现的根本原因[独家]3.1 p