gpt4 book ai didi

Android 应用程序错误 unknownpackageerror

转载 作者:行者123 更新时间:2023-11-29 00:23:36 25 4
gpt4 key购买 nike

我正在打印 hello world 的 android 中创建简单的 android 应用程序并得到一个 -- 错误描述

Resource    Path    Location    Type Error generating final archive: java.lang.ArrayIndexOutOfBoundsException: 13   Demo_ABC        Unknown Android Packaging Problem 

代码是:

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity
{

@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}


}

最佳答案

其他人有 the same problem with eclipse .解决方案是选中“创建测试项目”框:

Your project is getting associated with some Test Project which you are not mapping with your newly created project. When you are creating any new project check carefully whether you are including the "Create Test Project" option or not.

另一个猜测:由于错误似乎与包有关,而您的代码不包含该错误,因此请在代码中插入正确的 package yourpackage.tld;。 (你说“代码是:”)。

也许缺少 Android 默认情况下期望它并给出奇怪的错误,因为这完全是 Google Android 开发人员无法预料的。

关于Android 应用程序错误 unknownpackageerror,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21437783/

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