安卓开发——Android Studio常见报错与解决方法

1. No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-android

这个错误是由于较新版本的NDK的./toolchains目录中没有arm-linux-androideabi文件,解决办法是从旧的NDK版本里面把相关的lib复制到要使用的NDK的版本里面,重新编译运行。
打开Andrid SDK配置界面:

  1. 下载旧版本的NDK(NDK 21是包含了需要的LIB,新测可行)
  2. 然后打开SDK所在的目录:
    在这里插入图片描述

把NDK 21里面的toolchains目录下除了llvm的所有文件移动到NDk 25 toolchains里面,重新编译运行。
在这里插入图片描述

2. Please select Android SDK

Android Studio开发环境界面上边用于编译的小锤子旁边的app上打了一个小红叉(×),无论如何也点击不了运行,同时也无法选择真机设备。点击File->Project Structure就会出现报错。
解决方法:

  1. 点Android SDk,然后点Edit

在这里插入图片描述
2. 进行下面这个界面,对着前面的勾点一下(点的时候没有任何反应),之后选择下一步,完成后就可以执行了。
在这里插入图片描述

3. Unsupported Java. Your build is currently configured to use Java 17.0.6 and Gradle xxx

版本不匹配,Gradle 版本和 Java 版本之间的对应关系并不是直接的一对一关系。通常情况下,Gradle 版本并不限制特定的 Java 版本,但是 Gradle 和 Java 需要保持兼容性。

Android Studio 和 Gradle 支持的 Java 版本与操作系统和所安装的 JDK 版本有关。以下是一些常见的对应关系:

  • 对于较新的 Android Studio 和 Gradle 版本,可以使用较新的 JDK 版本(比如 Java 11、Java 12、Java 13、Java 14、Java 15、Java 16、Java 17 等)。建议使用最新的 LTS(Long-Term Support)版本,比如 Java 11 或 Java 17。

如果项目或团队使用较旧的 Gradle 版本,可能需要使用较旧版本的 JDK。例如,某些旧版本的 Gradle 可能对较新的 JDK 不完全兼容,因此可能需要使用较旧的 JDK 版本,比如 Java 8。

解决方法:
找到Gradle的设置界面,如果没有旧版本的JDK,就选择下载,如果已下载过旧的版本,选择旧版的NDK。
在这里插入图片描述
在这里插入图片描述

4. Android Studio Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Android studio 使用gradlew命令打包时,出现Could not initialize class org.codehaus.groovy.runtime.InvokerHelper错误。

解决方法:

  • 安装Java SDK版本: 14或更高版本。
  • 在gradle-wrapper.properties请使用级版本6.3或以上:

distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip

5. Out of memory. Java heap space

报错信息:

  • What went wrong:
    Out of memory. Java heap space

Possible solution:

  • Check the JVM memory arguments defined for the gradle process in:
    gradle.properties in project root directory
    gradle.properties in GRADLE_USER_HOME directory

解决方法:
把512改成1024或者2048就,重新编译运行
在这里插入图片描述
在这里插入图片描述

6.Algorithm HmacPBESHA256 not available

在这里插入图片描述

在这里插入图片描述
选择jdk16或18版本
在这里插入图片描述

  • 18
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
Over 40 recipes for creating cloud-ready Java web applications with Spring MVC About This Book Configure Spring MVC to build logic-less controllers that transparently support the most advanced web techniques Build an amazing social and financial application that applies microservices patterns on deployment, self-testability, interoperability, cloud architectures, and scalability Fast-paced, practical guide to learn how to set up Spring MVC to produce REST resources and templates as required by the latest front-end best practices Who This Book Is For If you are an experienced Java developer, with prior experience in web technologies, and want to step up in your career and stay up-to-date or learn more about Spring Web scalability, this book is for you. What You Will Learn Structure your project with Maven and create self-tested, domain-specific deployable web archives Generate templates for a responsive and powerful frontend with AngularJS and Bootstrap Build a high performance stateless RESTful and hypermedia application to support your multiple customer experiences Authenticate over REST with a BASIC authentication scheme and OAuth2; handle roles and permissions Document and publish your REST API using Swagger and Swagger UI Scale your Spring web application Communicate through WebSocket and STOMP messages Provide support to your application and efficiently maintain its business features with a relevant test stack In Detail Spring MVC is a lightweight application framework that comes with a great configuration by default. Being part of the Spring Framework, it naturally extended and supported it with an amazing set of recognizable annotations. External libraries can be plugged in and plugged out. It also possesses a request flow. Complete support of REST web services makes the Spring architecture an extremely consistent choice to support your front-end needs and Internet transformations. From the design of your Maven modules, you will achieve an Enterprise-standard for a stateless REST application based on Spring and Spring MVC with this book. This guide is unique in its style as it features a massive overview of practical development techniques brought together from the Spring ecosystem, the new JEE standards, the JavaScript revolution and Internet of Things. You will begin with the very first steps of Spring MVC's product design. Focused on deployment, viability, and maintainability, you will learn the use of Eclipse, Maven, and Git. You will walk through the separation of concerns driven by the microservices principles. Using Bootstrap and AngularJS, you will develop a responsive front-end, capable of interacting autonomously with a REST API. Later in the book, you will setup the Java Persistence API (JPA) within Spring; learn how to configure your Entities to reflect your domain needs, and discover Spring Data repositories. You will analyze how Spring MVC responds to complex HTTP requests. You will implement Hypermedia and HATEOAS to guide your customer's stateless conversation with the product and see how a messaging-service based on WebSocket can be configured. Finally you will learn how to set up and organize different levels of automated-tests, including logging and monitoring. Style and approach A comprehensive, recipe-based guide to creating stunning Java apps with Spring MVC as a result of learning and implementing pro-level practices, techniques, and solutions. Table of Contents Chapter 1: Setup Routine for an Enterprise Spring Application Chapter 2: Designing a Microservice Architecture with Spring MVC Chapter 3: Working with Java Persistence and Entities Chapter 4: Building a REST API for a Stateless Architecture Chapter 5: Authenticating with Spring MVC Chapter 6: Implementing HATEOAS Chapter 7: Developing CRUD Operations and Validations Chapter 8: Communicating Through WebSockets and STOMP Chapter 9: Testing and Troubleshooting

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

知来者逆

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值