2016-05-17 17 views
0

誰でも以下のエラーの原因を教えてください。クラスの名前はHomePage.csで、正しいディレクトリにあります。Android ClassNotFoundExceptionを解決できません

Java.Lang.RuntimeException:活動ComponentInfo {App2.App2/App2.App2.HomePage}をインスタンス化できません:にjava.lang.ClassNotFoundException:クラス "App2.App2.HomePage"

を見つけることができませんでした

HomePage.cs

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 


using Android.App; 
using Android.Content; 
using Android.OS; 
using Android.Runtime; 
using Android.Views; 
using Android.Widget; 

namespace App2 
{ 
    [Activity(Label = "HomePage")] 
    public class HomePage : Activity 
    { 
     protected override void OnCreate(Bundle savedInstanceState) 
     { 
      base.OnCreate(savedInstanceState); 
      SetContentView(Resource.Layout.home_page); 
     } 
} 

マニフェスト

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="App2.App2" android:versionCode="1" android:versionName="1.0"> 
    <uses-sdk android:minSdkVersion="16" /> 
    <application android:label="App2" android:debuggable="true"> 
     <activity android:name=".HomePage"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

答えて

0

お試しください:

マニフェストファイルにアクティビティの完全な名前(パッケージとともに)を記入してください。

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="App2.App2" android:versionCode="1" android:versionName="1.0"> 
<uses-sdk android:minSdkVersion="16" /> 
<application android:label="App2" android:debuggable="true"> 
    <activity android:name="App2.App2.HomePage"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 
      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

関連する問題