gpt4 book ai didi

android - 尝试运行演示手机间隙应用程序时出现运行时错误

转载 作者:行者123 更新时间:2023-11-29 18:13:40 24 4
gpt4 key购买 nike

我想使用 phonegap 运行 Android 应用程序。我只想运行一个在 this link 上给出的简单演示应用程序.

我已将 phonegap-1.4.1.jar 放入 libs 文件夹,将 www 放入 asset 文件夹。

但我在以下代码行中遇到编译时错误:

import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
public class PhonegapActivity extends DroidGap
{
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}

我在 list 文件中也遇到以下代码的运行时错误:

<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:xlargeScreens="true"
android:resizeable="true"
android:anyDensity="true"
/>

错误是:错误:在“android”包中找不到属性“xlargeScreens”的资源标识符

Android 环境已正确安装在我的系统上。正常的 android 应用程序运行正常,但是当我尝试运行上面的手机间隙应用程序时,出现此错误。对于 phonegap,是否需要安装任何其他插件才能使我的应用程序正常运行?

最佳答案

xlargeScreens 已在 API 级别 9 中引入。

http://developer.android.com/guide/topics/manifest/supports-screens-element.html#xlarge

为此,您至少需要为 android:xlargeScreens 使用 android API Level 9 才能在您的 AndroidManifest.xml 中被识别。

请确保您至少在 android 2.3.3 SDK 上构建项目。

关于android - 尝试运行演示手机间隙应用程序时出现运行时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9356584/

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