2017-02-09 26 views
2

私はVS2015でXamarinを使ってPhoneWordチュートリアルAndroidアプリを実行しようとしています。私はすべてをC#でコード化してあり、うまく構築されています。しかし、エミュレータで実行すると、何も起こりません。既存のNexus5とNexus6の定義からAVDを作成し、APIレベル21(5.0 Lollipop)を使用してGalaxy S7の定義を追加しました。私のアプリはAPIレベル21(5.0 Lollipop)をターゲットにしており、最低限必要なもので、5.0(Lollipop)でコンパイルされています。XamarinでVisual Studio 2015でAndroidエミュレータを起動できません

デバッグを開始すると、エミュレータの画面にコントロールがポップアップ表示されますが、何も起こりません。画面の中央に表示されるように「Android」のテキストを表示することもありますが、それ以外のときは黒い画面になります。以下のいくつかのログファイルの出力をコピーしましたが、Android開発に全く新しいので、他のログ/デバッグ情報が利用可能かどうか、インストール、アプリ、エミュレータ設定、私のハードウェア、または他の何か。

VSでデバッグする前にエミュレータを起動するか、最初にデバッグしてエミュレータを起動させようとしました。私は1時間以上座っていて、何も変わらないようにしました。

私はVT-xとIntel HAXMについて言及していますが、変更はありません。私のエミュレータはすべてARM(armeabi/armeabi-v7a)です。 logcat

Xamarin IDEログから

出力:

 
    Xamarin.VisualStudio.UnhandledExceptionsManager Error: 0 : [2017-02-09 15:31:41.9755] An unhandled error occurred. Details: Error type 2 
android.util.AndroidException: Can't connect to activity manager; is the system running? 
    at com.android.commands.am.Am.onRun(Am.java:298) 
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) 
    at com.android.commands.am.Am.main(Am.java:99) 
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) 
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) 


Mono.AndroidTools.AdbException: Error type 2 
android.util.AndroidException: Can't connect to activity manager; is the system running? 
    at com.android.commands.am.Am.onRun(Am.java:298) 
    at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) 
    at com.android.commands.am.Am.main(Am.java:99) 
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) 
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249) 

    at Mono.AndroidTools.AndroidDevice.c__DisplayClass77_0.b__0(Task`1 t) 
    at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
    at System.Threading.Tasks.Task.Execute() 
Xamarin.VisualStudio.Devices.DeviceManager Error: 0 : [2017-02-09 15:34:22.9377] System.Runtime.InteropServices.COMException (0x80004005): Project unavailable. 
    at EnvDTE.Project.get_FullName() 
    at Clide.Solution.Adapters.MsBuildAdapter.Adapt(ProjectNode from) 
    at lambda_method(Closure , IAdapter , Object) 
    at Clide.Patterns.Adapter.AdapterService.Adapt[TSource,TTarget](TSource source) 
    at Clide.Patterns.Adapter.AdapterService.Adaptable`1.As[T]() 
    at Clide.Sdk.Solution.ProjectNode.As[T]() 
    at Clide.Solution.Implementation.UserProjectProperties..ctor(ProjectNode project) 
    at Clide.Sdk.Solution.ProjectNode.get_UserProperties() 
    at Xamarin.VisualStudio.Devices.DeviceManager.GetBestDeviceFor(IProjectNode projectNode, IEnumerable`1 availableDevices) in C:\data\lanes\3513\00fa5cc4\source\xamarinvs\src\Core\VisualStudio.Devices\DeviceManager.cs:line 128 

Xamarinはログインmonodroid:

 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.3451] [I:sdk]:     Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidSdkDirectory found: 
    Path contains adb in \platform-tools (C:\Program Files (x86)\Android\android-sdk). 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.3521] [I:sdk]:     Key HKCU\SOFTWARE\Novell\Mono for Android\AndroidNdkDirectory found: 
    Path contains ndk-stack in \. (C:\ProgramData\Microsoft\AndroidNDK\android-ndk-r11c\). 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.3601] [I:sdk]:     Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.3751] [I:sdk]:     Key HKCU\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.3942] [I:sdk]:     Key HKLM\SOFTWARE\Novell\Mono for Android\JavaSdkDirectory not found. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4042] [I:sdk]:     Looking for Java 6 SDK.. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4112] [I:sdk]:     Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\CurrentVersion found. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4192] [I:sdk]:     Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.6\JavaHome not found. 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4322] [I:sdk]:     Key HKLM\SOFTWARE\JavaSoft\Java Development Kit\1.7\JavaHome found: 
    Path contains jarsigner.exe in \bin (C:\Program Files (x86)\Java\jdk1.7.0_55). 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4662] [I:Unknown]:    Found Xamarin.Android 7.0.2 
MonoDroidLog Information: 0 : [2017-02-09 15:35:06.4772] [I:Unknown]:    Found Android SDK. API levels: 21, 22, 23 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6236] [I:]:      Tracking android devices started 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6446] [D:]:      Tracking avd started 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6626] [D:]:      avd watcher *.ini path: 'C:\Users\Mark\.android\avd' 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6746] [D:]:      TrackDeviceTask got: 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6846] [I:]:      Got new device list from adb with 0 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:35:14.6956] [D:]:      avd watcher android path: 'C:\PROGRA~2\Android\ANDROI~1\tools\android.BAT' 
MonoDroidLog Information: 0 : [2017-02-09 15:35:16.8547] [D:]:      avd watcher: got device list from avd with 2 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:36:08.1347] [D:]:      TrackDeviceTask got: emulator-5554 offline 
MonoDroidLog Information: 0 : [2017-02-09 15:36:08.1457] [I:]:      Got new device list from adb with 1 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:36:27.8368] [D:]:      TrackDeviceTask got: emulator-5554 device 
MonoDroidLog Information: 0 : [2017-02-09 15:36:27.8458] [I:]:      Got new device list from adb with 1 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:36:27.8598] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:36:27.8748] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:36:49.6961] [I:Unknown]:    Found Android SDK. API levels: 21, 22, 23 
MonoDroidLog Information: 0 : [2017-02-09 15:36:49.7461] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:36:50.7321] [D:RunShellCommand]:  emulator-5554 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_21,HelloAndroid2.HelloAndroid2" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions" 
MonoDroidLog Information: 0 : [2017-02-09 15:36:58.2065] [D:RunShellCommand]:  emulator-5554 cat /data/system/packages.xml 
MonoDroidLog Information: 0 : [2017-02-09 15:37:18.2327] [D:RunShellCommand]:  emulator-5554 pm install "/data/local/tmp/HelloAndroid2.HelloAndroid2-Signed.apk" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:23.6120] [D:RunShellCommand]:  emulator-5554 rm "/data/local/tmp/HelloAndroid2.HelloAndroid2-Signed.apk" 
MonoDroidLog Error: 0 : [2017-02-09 15:37:24.1470] [E:]:      Deployment failed 
Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running? 

    at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 
    at Mono.AndroidTools.AndroidDevice.c__DisplayClass91_0.b__0(Task`1 t) 
    at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
    at System.Threading.Tasks.Task.Execute() 
MonoDroidLog Information: 0 : [2017-02-09 15:37:24.8721] [D:RunShellCommand]:  emulator-5554 date +%s 
MonoDroidLog Information: 0 : [2017-02-09 15:37:25.2461] [D:RunShellCommand]:  emulator-5554 setprop "debug.mono.extra" "debug=127.0.0.1:8947:8948,timeout=1486676275,loglevel=0,server=y" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:25.5571] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:37:25.8891] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EMULATED_STORAGE_SOURCE}" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:26.0201] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EMULATED_STORAGE_TARGET}" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:26.1601] [D:RunShellCommand]:  emulator-5554 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:31.4024] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EXTERNAL_STORAGE}" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:31.5895] [D:RunShellCommand]:  emulator-5554 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "HelloAndroid2.HelloAndroid2/md5c35c20f10c18d97cfa5803a7c4a6812a.MainActivity" 
MonoDroidLog Information: 0 : [2017-02-09 15:37:41.6850] [D:RunShellCommand]:  emulator-5554 ps 
MonoDroidLog Information: 0 : [2017-02-09 15:37:42.2211] [D:RunShellCommand]:  emulator-5554 am force-stop HelloAndroid2.HelloAndroid2 
MonoDroidLog Information: 0 : [2017-02-09 15:37:42.2461] [D:RunShellCommand]:  emulator-5554 setprop "debug.mono.connect" "" 
MonoDroidLog Information: 0 : [2017-02-09 15:38:43.8396] [D:]:      TrackDeviceTask got: 
MonoDroidLog Information: 0 : [2017-02-09 15:38:43.8556] [I:]:      Got new device list from adb with 0 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:39:05.9028] [D:]:      TrackDeviceTask got: emulator-5554 offline 
MonoDroidLog Information: 0 : [2017-02-09 15:39:05.9149] [I:]:      Got new device list from adb with 1 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:39:24.8799] [D:]:      TrackDeviceTask got: emulator-5554 device 
MonoDroidLog Information: 0 : [2017-02-09 15:39:24.8919] [I:]:      Got new device list from adb with 1 devices 
MonoDroidLog Information: 0 : [2017-02-09 15:39:24.9049] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:39:24.9209] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:39:44.6171] [I:Unknown]:    Found Android SDK. API levels: 21, 22, 23 
MonoDroidLog Information: 0 : [2017-02-09 15:39:44.6371] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:39:45.2531] [D:RunShellCommand]:  emulator-5554 am broadcast -a "mono.android.intent.action.PACKAGE_VERSIONS" -e "packages" "Mono.Android.DebugRuntime,Mono.Android.Platform.ApiLevel_21,HelloAndroid2.HelloAndroid2" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.PackageVersions" 
MonoDroidLog Information: 0 : [2017-02-09 15:39:53.1496] [D:RunShellCommand]:  emulator-5554 cat /data/system/packages.xml 
MonoDroidLog Information: 0 : [2017-02-09 15:40:10.3725] [D:RunShellCommand]:  emulator-5554 pm install "/data/local/tmp/HelloAndroid2.HelloAndroid2-Signed.apk" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:15.9999] [D:RunShellCommand]:  emulator-5554 rm "/data/local/tmp/HelloAndroid2.HelloAndroid2-Signed.apk" 
MonoDroidLog Error: 0 : [2017-02-09 15:40:16.4479] [E:]:      Deployment failed 
Mono.AndroidTools.InstallFailedException: Unexpected install output: Error: Could not access the Package Manager. Is the system running? 

    at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 
    at Mono.AndroidTools.AndroidDevice.c__DisplayClass91_0.b__0(Task`1 t) 
    at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
    at System.Threading.Tasks.Task.Execute() 
MonoDroidLog Information: 0 : [2017-02-09 15:40:16.7279] [D:RunShellCommand]:  emulator-5554 date +%s 
MonoDroidLog Information: 0 : [2017-02-09 15:40:17.1079] [D:RunShellCommand]:  emulator-5554 setprop "debug.mono.extra" "debug=127.0.0.1:8949:8950,timeout=1486676447,loglevel=0,server=y" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:17.4169] [D:RunShellCommand]:  emulator-5554 getprop 
MonoDroidLog Information: 0 : [2017-02-09 15:40:17.8090] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EMULATED_STORAGE_SOURCE}" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:18.0240] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EMULATED_STORAGE_TARGET}" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:18.1630] [D:RunShellCommand]:  emulator-5554 am broadcast -a "mono.android.intent.action.EXTERNAL_STORAGE_DIRECTORY" -n "Mono.Android.DebugRuntime/com.xamarin.mono.android.ExternalStorageDirectory" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:23.6083] [D:RunShellCommand]:  emulator-5554 "echo" "-n" "${EXTERNAL_STORAGE}" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:23.8193] [D:RunShellCommand]:  emulator-5554 am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "HelloAndroid2.HelloAndroid2/md5c35c20f10c18d97cfa5803a7c4a6812a.MainActivity" 
MonoDroidLog Information: 0 : [2017-02-09 15:40:33.7989] [D:RunShellCommand]:  emulator-5554 ps 
MonoDroidLog Information: 0 : [2017-02-09 15:40:34.3339] [D:RunShellCommand]:  emulator-5554 am force-stop HelloAndroid2.HelloAndroid2 
MonoDroidLog Information: 0 : [2017-02-09 15:40:34.3509] [D:RunShellCommand]:  emulator-5554 setprop "debug.mono.connect" "" 
MonoDroidLog Information: 0 : [2017-02-09 15:42:05.8061] [D:]:      TrackDeviceTask got: 
MonoDroidLog Information: 0 : [2017-02-09 15:42:05.8201] [I:]:      Got new device list from adb with 0 devices 

答えて

0

私はそれがあったかはわからないが、私は、それを動作させることができました私がやったステップの1つだけ、あるいはそれらの組み合わせ。

私は2つのレイアウト(Main.axmlとListLayout.axml)をプロジェクト内に持っていました。おそらく別のチュートリアルからでしたが、そのうちの1つだけが記入されました。私のMainActivityが空のレイアウトを呼び出していました。私はそれを正しいレイアウトと呼ぶように変更しました。

私のプロジェクト設定にも、サポートされているアーキテクチャ(Project-> Properties-> Android Options-> Advanced)がありませんでしたので、armeabiarmeabi-v7aをチェックしました。また、オプション([パッケージ]タブ)でアーキテクチャごとに1つのパッケージを生成し、共有ランタイムと高速デプロイメントを使用するオプションのチェックを外しました。

これをすべて実行すると、Phonewordアプリを実行してテストすることができました。

BIOSで仮想化を有効にし、x86アーキテクチャでチェックし、Intel x86 CPUを搭載した新しいエミュレータデバイスを定義しました。これで、より速くエミュレータを実行できるようになりました。

関連する問題