メッセージの例
error XA1048: 'obj/Debug/net11.0-android/android/AndroidManifest.xml' does not contain an <instrumentation> element. Add an Android.App.Instrumentation subclass to the application, or set the $(AndroidInstrumentation) MSBuild property to the name of one.
Issue
このアプリケーションは、以下のいずれかの方法で設定されたため、Android.App.Instrumentation 経由での起動を有効にしました
$(AndroidUseInstrumentation) または
$(EnableMSTestRunner)をtrueしようとしましたが、<instrumentation>内でAndroidManifest.xml要素が見つかりませんでした。
これは XA1043 とは異なり、アプリケーションに起動可能な <activity> も <instrumentation>もない場合に報告されます。
ソリューション
アプリケーションでインストルメンテーションを宣言します。
[Instrumentation (Name = "com.companyname.myapp.MyInstrumentation")]
public class MyInstrumentation : Instrumentation
{
protected MyInstrumentation (IntPtr handle, JniHandleOwnership ownership)
: base (handle, ownership) { }
}
を使用して、起動するクラスを明示的に指定することもできます。
$(AndroidInstrumentation) MSBuild プロパティを使用するか、 $(AndroidUseInstrumentation) を false に設定して、代わりにアプリケーションのアクティビティを起動します。