-1

I've got a new Android project in Eclipse, one activity and TextView, nothing else. I didn't modify anything. When I try to run the application on the usb on my phone (zte v970m with android 4.1.1), I get

In console

Installation failed due to invalid APK file!
Please check logcat output for more details.
Launch canceled!

In LogCat

09-24 12:21:01.174: D/dalvikvm(584): Not late-enabling CheckJNI (already on)
09-24 12:21:01.854: E/Trace(584): error opening trace file: No such file or directory (2)
09-24 12:21:02.684: D/gralloc_goldfish(584): Emulator without GPU emulation detected.

Pls, help me to find solution. By the way with AVD all works.

My .java

package com.example.testusbdebug;

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);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

}

my .xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context=".MainActivity" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/hello_world" />

</RelativeLayout>

and my manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.testusbdebug"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="18" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.testusbdebug.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>
    </application>

</manifest>
cherya
  • 5
  • 5

1 Answers1

0

to make it easier for you I would re-download the whole bundle in http://developer.android.com/sdk/index.html

Andy He
  • 28
  • 7