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

2024-05-28 05:36

本文主要是介绍安装 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.

其他

//更改 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"}
}

 

这篇关于安装 Android Studio 2024.1.1.6(Koala SDK35)和过程问题解决的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



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

相关文章

解决IDEA报错:编码GBK的不可映射字符问题

《解决IDEA报错:编码GBK的不可映射字符问题》:本文主要介绍解决IDEA报错:编码GBK的不可映射字符问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录IDEA报错:编码GBK的不可映射字符终端软件问题描述原因分析解决方案方法1:将命令改为方法2:右下jav

MyBatis模糊查询报错:ParserException: not supported.pos 问题解决

《MyBatis模糊查询报错:ParserException:notsupported.pos问题解决》本文主要介绍了MyBatis模糊查询报错:ParserException:notsuppo... 目录问题描述问题根源错误SQL解析逻辑深层原因分析三种解决方案方案一:使用CONCAT函数(推荐)方案二:

Win安装MySQL8全过程

《Win安装MySQL8全过程》:本文主要介绍Win安装MySQL8全过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Win安装mysql81、下载MySQL2、解压文件3、新建文件夹data,用于保存数据库数据文件4、在mysql根目录下新建文件my.ini

Redis 热 key 和大 key 问题小结

《Redis热key和大key问题小结》:本文主要介绍Redis热key和大key问题小结,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录一、什么是 Redis 热 key?热 key(Hot Key)定义: 热 key 常见表现:热 key 的风险:二、

IntelliJ IDEA 中配置 Spring MVC 环境的详细步骤及问题解决

《IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决》:本文主要介绍IntelliJIDEA中配置SpringMVC环境的详细步骤及问题解决,本文分步骤结合实例给大... 目录步骤 1:创建 Maven Web 项目步骤 2:添加 Spring MVC 依赖1、保存后执行2、将新的依赖

Android使用ImageView.ScaleType实现图片的缩放与裁剪功能

《Android使用ImageView.ScaleType实现图片的缩放与裁剪功能》ImageView是最常用的控件之一,它用于展示各种类型的图片,为了能够根据需求调整图片的显示效果,Android提... 目录什么是 ImageView.ScaleType?FIT_XYFIT_STARTFIT_CENTE

Spring 中的循环引用问题解决方法

《Spring中的循环引用问题解决方法》:本文主要介绍Spring中的循环引用问题解决方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友参考下吧... 目录什么是循环引用?循环依赖三级缓存解决循环依赖二级缓存三级缓存本章来聊聊Spring 中的循环引用问题该如何解决。这里聊

Spring Boot中JSON数值溢出问题从报错到优雅解决办法

《SpringBoot中JSON数值溢出问题从报错到优雅解决办法》:本文主要介绍SpringBoot中JSON数值溢出问题从报错到优雅的解决办法,通过修改字段类型为Long、添加全局异常处理和... 目录一、问题背景:为什么我的接口突然报错了?二、为什么会发生这个错误?1. Java 数据类型的“容量”限制

关于MongoDB图片URL存储异常问题以及解决

《关于MongoDB图片URL存储异常问题以及解决》:本文主要介绍关于MongoDB图片URL存储异常问题以及解决方案,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录MongoDB图片URL存储异常问题项目场景问题描述原因分析解决方案预防措施js总结MongoDB图

SpringBoot项目中报错The field screenShot exceeds its maximum permitted size of 1048576 bytes.的问题及解决

《SpringBoot项目中报错ThefieldscreenShotexceedsitsmaximumpermittedsizeof1048576bytes.的问题及解决》这篇文章... 目录项目场景问题描述原因分析解决方案总结项目场景javascript提示:项目相关背景:项目场景:基于Spring