gpt4 book ai didi

java - 安卓应用无法安装

转载 作者:行者123 更新时间:2023-11-30 02:03:39 24 4
gpt4 key购买 nike

在 AIDE for Android 中开发应用程序时,我遇到了这个错误。该应用程序将成功编译但无法安装,并报告此错误:

Could not run the App directly as root. Consider disabling direct running in the settings.

WARNING: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /storage/sdcard/AppProjects/MyProgram/bin/MyProgram.apk
Failure [INSTALL_FAILED_DEXOPT]
exit with 0

我研究了可能导致此问题的原因,主要遇到了诸如“证书错误,尝试重新安装包”和“在 list 中设置两次权限”等原因,但均无济于事。

最佳答案

您的问题:Java 认为您定义了两个具有相同签名的方法。

Java 方法签名定义:https://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

method declarations have six components, in order:

1.Modifiers—such as public, private, and others you will learn about later.

2.The return type—the data type of the value returned by the method, or void if the method does not return a value.

3.The method name—the rules for field names apply to method names as well, but the convention is a little different.

4.The parameter list in parenthesis—a comma-delimited list of input parameters, preceded by their data types, enclosed by parentheses, ().If there are no parameters, you must use empty parentheses.

  1. An exception list—to be discussed later.
  2. The method body, enclosed between braces—the method's code, including the declaration of local variables, goes here.

正如您在上面看到的,泛型类的规范不是 java 方法签名的一部分。因此 java 检测到两个具有相同签名的添加方法。

关于java - 安卓应用无法安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31105311/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com