安装 Android Studio 2024.1.1.6(Koala SDK35)和过程问题解决

记录更新Android Studio版本及适配Android V应用配置的一些过程问题。

  • 安装包:android-studio-2024.1.1.6-windows.exe
  • 原版本:Android Studio23.2.1.23

Koala 安装过程

Uninstall old version 不会删除原本配置(左下角提示)

Uninstall old version
Uninstall old version
Android Studio Setup
Android Studio Setup

Choose Component
Choose Component

Configuration Settings 可自选路径 E:\SOFTWARE\Android\Android Studio 24.1.1.6

Configuration Settings
Configuration Settings

Choose Start Menu Folder 配置桌面开始图标

Choose Start Menu Folder
Choose Start Menu Folder

 安装完成 ,提示马上启动

Install Complete
Install Complete

【问题解决】启动报错 Operation not supported: bind 

Start fail

Internal error. Please refer to https://issuetracker.google.com/issues/new?component=192708

java.net.SocketException: Operation not supported: bind
    at java.base/sun.nio.ch.UnixDomainSockets.bind0(Native Method)
    at java.base/sun.nio.ch.UnixDomainSockets.bind(UnixDomainSockets.java:129)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.unixBind(ServerSocketChannelImpl.java:319)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:292)
    at java.base/java.nio.channels.ServerSocketChannel.bind(ServerSocketChannel.java:224)
    at com.intellij.platform.ide.bootstrap.DirectoryLock.tryListen(DirectoryLock.java:281)
    at com.intellij.platform.ide.bootstrap.DirectoryLock.lockOrActivate(DirectoryLock.java:147)
    at com.intellij.platform.ide.bootstrap.StartupUtil$lockSystemDirs$result$1.invokeSuspend(main.kt:528)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

-----
Your JRE: 17.0.10+0--11609105 amd64 (JetBrains s.r.o.)
E:\SOFTWARE\Android\Android Studio 24.1.1.6\jbr

解决方案:到bin文件下执行studio.bat打开(或者双击打开studio.bat--For Windows)

如路径:E:\SOFTWARE\Android\Android Studio 24.1.1.6\bin\studio.bat

IDE初始化和使用

如果没有配置SDK,打开软件就会提示

然后打开项目的时候会提示选用Android Studio还是Project的SDK。

To keep results consistent between IDE and command line builds, only one path can be used. Do you want to: 

[1] Use Android Studio's default SDK (modifies the project's local.properties file.) 

[2] Use the project's SDK (modifies Android Studio's default.)  Note that switching SDKs could cause compile errors if the selected SDK doesn't have the necessary Android platforms or build tools.

【配置】SDK和Gradle

当前Android Studio无法下载高版本的SDK和Gradle,可以自行下载好然后放到相应工作路径。

Android V的preview SDK和build tool,分别拷贝到SDK\build-tools和Sdk\platforms文件目录即可。那么配置项目gradle的时候需要名称对应。

【问题解决】Namespace not specified.

Build Output

Namespace not specified. Specify a namespace in the module's build file: E:\code\Demo_hotfix\build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

A problem occurred configuring root project 'Demo'.
> Could not create an instance of type com.android.build.api.variant.impl.ApplicationVariantImpl.
   > Namespace not specified. Specify a namespace in the module's build file: E:\code\Demo_hotfix\build.gradle. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 7s

分析:在Android U上编译还没有命名空间的要求。

解决方案:在app的build.gradle添加namespace

android {namespace 'com.ddd.demo'
}

应用Debug

当前配置

//这个看着没用,kotlin才需要 添加android-
ext {compileSdkVersion = 'android-VanillaIceCream'
}android {namespace 'com.ddd.demo'compileSdkPreview 'VanillaIceCream'//compileSdkVersion 35buildToolsVersion '35.0.0 rc3'defaultConfig {applicationId "com.ddd.demo"minSdkVersion 30targetSdkVersion 35versionName getVersionNamePrefix()}
}

修改namespace、sdk版本等配置后编译报错,其实可以通过描述Recommendation找到解决方案。

1、[warn]compileSdkPreview

第一条只是警告,还不是报错。

compileSdkPreview = "VanillaIceCream" has not been tested with this version of the Android Gradle plugin.

This Android Gradle plugin (8.5.0-alpha08) was tested up to compileSdk = 34.

If you are already using the latest preview version of the Android Gradle plugin,
you may need to wait until a newer version with support for compileSdkPreview = "VanillaIceCream" is available.

For more information refer to the compatibility table:
https://d.android.com/r/tools/api-level-support

To suppress this warning, add/update
    android.suppressUnsupportedCompileSdk=VanillaIceCream
to this project's gradle.properties.

2、[error]:processDebugMainManifest ※

> Task :processDebugMainManifest FAILED
Incorrect package="com.ddd.phone" found in source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.ddd.phone" from the source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.

Execution failed for task ':processDebugMainManifest'.
> Incorrect package="com.ddd.phone" found in source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.
  Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
  Recommendation: remove package="com.ddd.phone" from the source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 717ms
44 actionable tasks: 1 executed, 43 up-to-date

解决:将build.gradle的命名空间跟AndroidManifest.xml配置的packages内容一致。

3、[error]Incorrect package="xxxx" found in AndroidManifest.xml

是因为定义了不同的命名空间和进程包名等,虽然说建议移除AndroidManifest中的packages配置,但是根由不是这个,解决了问题2就能解决此问题。

Incorrect package="com.ddd.phone" found in source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.ddd.phone" from the source AndroidManifest.xml: E:\code\Demo_V_hotfix\AndroidManifest.xml.

其他

官方说明 :设置 Android 15 SDK  |  Android Developers

//更改 gradle 配置:
//AGP > 7.0.0:
//groovy:
android {compileSdkPreview "VanillaIceCream"...defaultConfig {targetSdkPreview "VanillaIceCream"}
}//kotlin:
android {compileSdkPreview = "VanillaIceCream"...defaultConfig {targetSdkPreview = "VanillaIceCream"}
}//AGP 4.2.0 或更低:
//groovy:
android {compileSdkVersion "android-VanillaIceCream"...defaultConfig {targetSdkVersion "android-VanillaIceCream"}
}//kotlin:
android {compileSdkPreview = "android-VanillaIceCream"...defaultConfig {targetSdkPreview = "android-VanillaIceCream"}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/pingmian/21581.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

LeetCode hot100-64-Y

74. 搜索二维矩阵 给你一个满足下述两条属性的 m x n 整数矩阵:每行中的整数从左到右按非严格递增顺序排列。每行的第一个整数大于前一行的最后一个整数。给你一个整数 target ,如果 target 在矩阵中,返回 true ;否则,…

YOLOv5改进 | 主干网络 | 将主干网络替换为轻量化的ShuffleNetv2【原理 + 完整代码】

💡💡💡本专栏所有程序均经过测试,可成功执行💡💡💡 目标检测是计算机视觉中一个重要的下游任务。对于边缘盒子的计算平台来说,一个大型模型很难实现实时检测的要求。基于一系列消融…

MQ之初识kafka

1. MQ简介 1.1 MQ的诞生背景 以前网络上的计算机(或者说不同的进程)传递数据,通信都是点对点的,而且要实现相同的协议(HTTP、 TCP、WebService)。1983 年的时候,有个在 MIT 工作的印度小伙突发…

前端开发记录

一.Node相关 镜像:registry "https://registry.npmmirror.com" 二.Eslint格式检查 关闭语法格式检查

【MySQL03】【 Buffer Pool】

文章目录 一、前言二、缓冲池(Buffer Pool )1. 缓冲池的概念2. LRU List、Free List 和 Flush List2.1 Free 链表2.1.1 缓冲页的哈希处理 2.2 Flush 链表2.3 LRU 链表2.3.1 简单 LRU 链表2.3.2 优化后的 LRU 列表2.3.3 更进一步的优化 3. 脏页的刷新4. 多…

B端产品无爆款,说有的都是忽悠和外行!

前言:网上经常有人讲运营,把C端那一套硬搬到B端,讲的自我陶醉,稍微有点常识的人就知道不能这么玩。 一、什么是B端和C端 B端(Business-to-Business)是指面向企业客户的市场和产品。B端产品或服务主要是为…

Elastic Connectors:增量同步对性能的影响

作者:Artem Shelkovnikov Elastic 连接器是一种 Elastic 集成,可将数据从原始数据源同步到 Elasticsearch 索引。连接器使你能够创建可搜索的只读数据源副本。 有许多连接器支持各种第三方,例如: MongoDB各种 SQL DBMS&#xff…

行列视的产品定位

行列视(RCV)的产品定位主要是解决生产领域的指标治理、指标整合及报表可视化工作问题,所面向的业务范围是生产企业所必需的,虽然各企业中生产类报表工具建设普遍,但能够得到充分利用的较少,功能有限&#x…

【大学物理实验】速通双语版

0首先,我们要学什么?outlook! 1measurement 2system error&random error 3significant figures 4uncertainty of direct measurement and indirect measurement 5data processing 1 measurement Important points to remember&#…

从Multisim到Proteus,再到SmartEDA:电子设计软件的进化之旅

在电子设计领域,软件工具的演进犹如一条璀璨的轨迹,记录着科技进步的每一个步伐。从Multisim的初创,到Proteus的崛起,再到如今SmartEDA的崭露头角,这些电子设计软件不仅极大地提升了设计效率,更推动了整个行…

sed文本处理工具的用法:

用法1:前置命令 | sed [选项] 条件指令用法2:sed [选项] 条件指令 文件.. .. 步骤一:认识sed工具 sed命令的常用选项如下: -n(屏蔽默认输出,默认sed会输出读取文档的全部内容) -r&#xff0…

fly-barrage 前端弹幕库(6):实现人像免遮挡

项目官网地址:https://fly-barrage.netlify.app/; 👑🐋🎉如果感觉项目还不错的话,还请点下 star 🌟🌟🌟。 Gitee:https://gitee.com/fei_fei27/fly-barrage&a…

壁仞科技BR100-GPU的性能及应用

性能 算力领先:壁仞科技发布的GPU产品,如系列,具有超高的算力。据壁仞科技公布的数据,BR100的峰值算力超过了英伟达目前在售的旗舰计算产品A100 GPU的三倍,并创造了全球通用GPU的算力记录。晶体管数量:BR1…

hadoop 之 libhdfs

Hadoop 3.2.2 libhdfs/hdfs.c struct hdfsFile_internal {void* file;enum hdfsStreamType type;int flags; };以上数据结构中的 flags 是由以下接口赋值 hdfsFile hdfsOpenFile(hdfsFS fs, const char *path, int flags,int bufferSize, short replication, tSize blockSiz…

vue3+vant4 二次封装IndexBar城市列表组件以及性能优化

前言 二次封装城市列表以及对静态资源的引入做异步引入优化。 版本号: vue3.3 vant4 效果图 数据源 城市列表 city.json 永久网盘链接 链接:https://pan.baidu.com/s/10E-b441-4P7mjvomlJhm0g 提取码:m92c 字段大致讲解 indexList :每个字…

开窗函数!

开窗函数(Window Function)是SQL中的一种高级功能,允许你在一组相关行(一个“窗口”)上执行聚合操作,而不像传统聚合函数(如SUM(), AVG(), COUNT())那样将所有匹配行合并成单个汇总行…

数据库的设计,为什么那么重要?#PostgreSQL培训

良好的数据库设计能够确保数据的完整性和准确性。 通过减少冗余、优化查询和确保数据一致性,可以降低系统出现故障的可能性,从而减少修复和维护的时间和成本。 良好的数据库设计可以确保数据的合规性,并降低因违反法规而面临的罚款和诉讼风险…

人机交互中的阴差阳错

人机交互是一门研究系统与用户之间的交互关系的学问。它旨在设计和实现使人们能够与计算机系统进行有效交互的方法和技术。人机交互领域研究的热门话题之一就是人工智能。另一个热门话题就是增强现实(Augmented Reality)和虚拟现实(Virtual R…

算法训练 | 回溯算法Part3 | 39.组合总和、40.组合总和II、131.分割回文串

目录 39.组合总和 回溯法 40.组合总和II 回溯法 131.分割回文串 回溯法 39.组合总和 题目链接:39. 组合总和 - 力扣(LeetCode) 文章讲解:programmercarl.com 回溯法 解题思路 本题没有数量要求,可以无限重复…

【java11】java11新特性之局部变量类型推断升级

局部变量类型推断是java10开始新增的新特性,java11中对局部变量推断进行了升级,var支持添加注解的语法格式,Java10中是无法实现的,在Java11中加入了这样的语法。 Lambda中使用var修饰符 Java11允许在lambda表达式中使用var&…