1.当Iam导入现有项目或创建显示错误的新项目时:
            R无法解析为变量,
            导入R后,似乎无法访问xml布局文件
            尝试解决此问题

        http://stackoverflow.com/questions/5143369/main-cannot-be-resolved-or-is-not-a-field


2.同时在另一台机器上
            运行我的应用程序时,正在创建“ .apk文件”,但无法在模拟器上反映输出

      [2012-10-04 15:24:29 - HelloAndroid] Android Launch!
[2012-10-04 15:24:29 - HelloAndroid] adb is running normally.
[2012-10-04 15:24:29 - HelloAndroid] No Launcher activity found!
[2012-10-04 15:24:29 - HelloAndroid] The launch will only sync the application package on the device!
[2012-10-04 15:24:29 - HelloAndroid] Performing sync
[2012-10-04 15:24:29 - HelloAndroid] Automatic Target Mode: launching new emulator with compatible AVD 'android2.1'
[2012-10-04 15:24:29 - HelloAndroid] Launching a new emulator with Virtual Device 'android2.1'
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] Failed to create Context 0x3005
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] could not get wglGetExtensionsStringARB
[2012-10-04 15:24:37 - Emulator] emulator: WARNING: Could not initialize OpenglES emulation, using software renderer.
[2012-10-04 15:24:37 - Emulator] emulator: warning: opening audio input failed
[2012-10-04 15:24:37 - Emulator]


主屏幕->

package com.example.new_xyz_fertilizer;

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


public class Home extends Activity {

    public void onCreate(Bundle HomeBundle){
        super.onCreate(HomeBundle);
        setContentView(R.layout.home);

    }


}


并在xml布局文件中-> home.xml

?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal"
    android:background="@drawable/BG01"
    >


    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:gravity="bottom"
        >
        <ImageView
            android:id="@+id/home"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/home_s"/>
        <ImageView
            android:id="@+id/nc"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/nc_s"
            />
        <ImageView
            android:id="@+id/locncon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/locncon_s"
           />
        <ImageView
            android:id="@+id/ft"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/ft_s"
            />

          <ImageView
            android:id="@+id/csf"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:background="@drawable/csf_s"
            />
    </LinearLayout>



</LinearLayout>


Thanks in advance

最佳答案

从其他项目导入R.java可能会产生问题。

尝试以下操作:右键单击项目-> Android工具->修复项目属性。

比检查问题是否解决。

据我所知,还有一件事,GPS大部分可以在物理设备上运行,而不能在仿真器/模拟器上运行。

关于android - android应用程序中的错误(无法解析main或不是在Android Emulator中运行map应用程序的field/wglGetExtensionsStringARB'错误),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/12721704/

10-10 01:13
查看更多