android.content.res.Resources $ NotFoundException:文件res / mipmap-xxhdpi-v4 / ic_launcher.png来自xml类型布局资源ID#0x7f030000错误

时间:2015-07-08 13:41:24

标签: java android xml android-resources mipmaps

我收到以下运行时错误:android.content.res.Resources $ NotFoundException:来自xml类型布局资源ID的文件res / mipmap-xxhdpi-v4 / ic_launcher.png#0x7f030000

根据我的理解,这是一个无法访问ic_launcher的问题,但我解压缩已编译的apk,我可以在正确的文件夹中看到图像,所以这让我相信它是由另一个问题引起的。

AndroidManifext:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.will.inspiredemo">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme"
    >

    <meta-data
        android:name="com.dji.sdk.API_KEY"
        android:value="API-KEY"
        />
    <activity
        android:name="MainActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <service
        android:name="org.connectbot.service.TerminalManager"
        android:configChanges="keyboardHidden|orientation" />
</application>

错误发生在这里

爪哇:

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    DJIDrone.initWithType(this.getApplicationContext(), DJIDroneType.DJIDrone_Inspire1);
    new Thread() {
        public void run() {
            try {
                DJIDrone.checkPermission(getApplicationContext(), new DJIGerneralListener() {

                    @Override
                    public void onGetPermissionResult(int result) {
                        // TODO Auto-generated method stub

                    }
                });
            } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }.start();


        mDjiGLSurfaceView = (DjiInspireGLSurfaceView) findViewById(R.id.DjiSurfaceView);

        mDjiGLSurfaceView.start();
        try
        {
        DJIDrone.connectToDrone();
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
        mReceivedVideoDataCallBack = new DJIReceivedVideoDataCallBack() {

            @Override
            public void onResult(byte[] videoBuffer, int size) {
                // TODO Auto-generated method stub
                //recvData = true;
                mDjiGLSurfaceView.setDataToDecoder(videoBuffer, size);
            }


        };

        DJIDrone.getDjiCamera().setReceivedVideoDataCallBack(mReceivedVideoDataCallBack);


        mConnectStateTextView = (TextView) findViewById(R.id.ConnectStatePreviewTextView);

    }

对不起,我的英语不是我的第一语言

0 个答案:

没有答案