Usman Khan
Usman Khan

Reputation: 3973

Error: Could not find class file for 'com.test ndk.Hello World'

I am working on android application in which I want to use NDK, for this I have downloaded latest ndk package and make the path in eclipse as well. I am using this tutorial. On the step of creating header file I am getting following errors, terminal errors are given below:

enter image description here

My Android project path is : /Users/UsmanKhan/Desktop/NewWS_Emergency/Android_NDK My NDK folder path is: Macintosh HD/Users/UsmanKhan/Desktop/Android_NDK

enter image description here

Manifest file:

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

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

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

Upvotes: 0

Views: 219

Answers (2)

sabbir
sabbir

Reputation: 438

I think you did not build your project. Please follow the step 5 first.

5) Open your .java file and write following lines of code. and build the project.

You need to build the project first which will create the class files in bin folders.

To build your project, go to Project->Build Project of your eclipse menu bar. Or you can enable automatic build by selecting Project->Build Automatically in eclipse menu bar, then your project will build automatically if you change your java file.

Upvotes: 1

EpicPandaForce
EpicPandaForce

Reputation: 81568

Why are you trying to run Android code with the java virtual machine? Android doesn't run Java Bytecode. It runs Dalvik. You need to run your project on an Android emulator, not with java.

Upvotes: 1

Related Questions