Visual Studio 2017 - Android Emulator not working - xamarin

I've updated Xamarin on Visual Studio 2017 and when I go to build an new Android App I created, it has the following error:
Starting runtime checks
Starting emulator Android_Accelerated_Nougat ...
1>------ Build started: Project: Phoneworld, Configuration: Debug Any CPU ------
C:\Program Files (x86)\Android\android-sdk\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd Android_Accelerated_Nougat -prop monodroid.avdname=Android_Accelerated_Nougat
Could not launch 'C:\Program Files (x86)\Android\android-sdk\emulator/qemu/windows-x86_64/qemu-system-x86_64.exe': No such file or directory
The selected emulator couldn't be started. This can be caused by the process not having enough permissions. Please try to start VS as administrator, which can help to avoid it.
Emulator Android_Accelerated_Nougat cannot be started.
Runtime checks failed

To run an emulator in normal account that was created as administrator.
2 Steps:
Move 1 folder and 1 .ini file
Change paths values in 2 config files
First, move your emulator's .ini file and folder from admin's account.
Source - C:\Users\{admin account}.android\avd
Destination - C:\Users\{YOUR account}.android\avd
Second, change the emulator paths in 2 config files
Config file 1 - {emulator name}.ini
(1 key-value)
path
Config file 2 - {emulator folder}\hardware-qemu.ini
(4 key-value)
hw.sdCard.path
disk.cachePartition.path
disk.dataPartition.path
disk.encryptionKeyPartition.path

I suggest going doing the following in VS.
Navigate to: Tools > Android > Android SDK Manager and check that you have the correct tools installed for the Nougat android emulator you want to run.
I would say install the following under Android 7.0 - Nougat if not already installed.
Google APIs Intel x86 Atom System Image
Google APIs Intel x86 Atom _64 System Image
Once you have those installed, navigate to: Tools > Android > Android Device Manager.
Select the emulator in question and check what CPU/ABI you target and update it to use the new ones you installed in the previous step.
You should also try running your VS as Administrator, it could also help.

Related

not able to install visual studio 2022 using visual studio installer

I have downloaded visual studio installer from "https://visualstudio.microsoft.com/downloads/"
once its downloaded the installer file, when I click on install it says "Getting visual studio installer ready" and nothing happens after that. my internet connection is good and able to browse and download other files.
Tried this solution as well https://learn.microsoft.com/en-us/answers/questions/216897/visual-studio-2019-error-unable-to-download-instal.html and also tried after restarting machine. still having the same problem. you can find the screenshot for more information.
can anyone suggest what could be the issue. thanks
I could find the following log
[5/11/2022, 16:53:28] === Logging started: 2022/05/11 16:53:28 ===
[5/11/2022, 16:53:28] Executable: C:\Users{username}\Downloads\vs_Community.exe v15.9.28307.1974
[5/11/2022, 16:53:28] --- logging level: standard ---
[5/11/2022, 16:53:28] Directory 'C:\Users{username}\AppData\Local\Temp\481074b13093fff3a2' has been selected for file extraction
[5/11/2022, 16:53:28] Extracting files to: C:\Users{username}\AppData\Local\Temp\481074b13093fff3a2
[5/11/2022, 16:53:28] Extraction took 265 milliseconds
[5/11/2022, 16:53:28] Executing extracted package: 'vs_bootstrapper_d15\vs_setup_bootstrapper.exe ' with commandline ' --env "_SFX_CAB_EXE_PACKAGE:C:\Users{username}\Downloads\vs_Community.exe _SFX_CAB_EXE_ORIGINALWORKINGDIR:C:\Users{username}\Downloads"'
[5/11/2022, 16:55:43] The entire Box execution exiting with result code: 0x0
[5/11/2022, 16:55:43] Launched extracted application exiting with result code: 0x138c
[5/11/2022, 16:55:43] === Logging stopped: 2022/05/11 16:55:43 ===
in your host file(C:\Windows\System32\drivers\etc\hosts) insert this line and enjoy
93.184.215.201 download.visualstudio.microsoft.com
There is currently an issue with Microsoft's Installer Backend.
Have a look here for the Microsoft ticket.
I had this problem when trying to install VS 2022 in a virtual machine. Later on ended up in getting an offline layout of the whole installer into a folder in host machine.
Try the below command to create an offline installer in the disk.
VisualStudioSetup.exe --layout C:\VSLayout --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.ManagedDesktop --includeRecommended --includeOptional
You will get the whole installer in a folder such as shown below.
Refer this link for more options.
Try to turn off windows firewall and relaunch the visual studio installer, it works for me.

How to convince Visual Studio to use ADB for android dev over TCP/IP

So this might be a bit of an edge case, but I'm using visual studio on a VM, and I have my phone in my hand. I'd like to set things up that when I press "play" in visual studio, it compiles my cordova app, and pushes it to my phone next to me, so I can test and debug etc.
My phone is 'rooted' and I have installed ADB wifi. I am able to connect to it from Visual Studio's adb version and also adb devices lists it.
(output from cmd.exe running as Admin in the solution folder)
C:\Stuff\Code\svn\myapp\MyApp>adb connect 10.10.10.6
already connected to 10.10.10.6:5555
C:\Stuff\Code\svn\myapp\MyApp>adb devices
List of devices attached
10.10.10.6:5555 device
When I press Play in Visual Studio it compiles and gets to the point where it needs to deploy to the phone and then it comes up with the following error: The system cannot find the file specified
(output from "output" tab in visual studio)
C:/Stuff/Code/svn/myapp/myApp/platforms/android/build/outputs /apk/android-debug.apk
No scripts found for hook "after_build".
No scripts found for hook "after_compile".
------ Copying back to project: android
2>------ Deploy started: Project: MyApp, Configuration: Debug Android ------
2> Querying ADB for attached devices...
2>The system cannot find the file specified
2>The system cannot find the file specified
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
I had a similar issue and this worked for me...
adb kill-server
adb tcpip 5555
adb connect 10.10.10.6
adb devices - should show your device
Open Visual Studio as Admin
Type: ALT+B, R (ALT+B then R) to rebuild your solution
Run your app

VS2015+Xamarin Does not recognize that emulator started

my Visual Studio 2015 with Xamarin is not recognizing that my android emulator started, it was working just fine in the last days, and it just stopped after I restarted the computer today.
Here is the Output log:
1>Starting deploy API19-Intel_Atom ...
1>Starting emulator API19-Intel_Atom ...
1>C:\Users\Kyore\AppData\Local\Android\ANDROI~1\tools\emulator.EXE -partition-size 512 -no-boot-anim -avd API19-Intel_Atom -prop monodroid.avdname=API19-Intel_Atom
1>Hax is enabled
1>Hax ram_size 0x20000000
1>HAX is working and emulator runs in fast virt mode.
1>emulator: Listening for console connections on port: 5554
1>emulator: Serial number of this emulator (for ADB): emulator-5554
It just get stuck in that line, the emulator starts normally, it is fast and I can open/close things without problems, so I have to press CTRL+BREAK to stop it:
1>Process was cancelled
1>Start emulator API19-Intel_Atom was cancelled.
1>Process was cancelled
Build has been canceled.
I tried to restart the computer, restarted VS, restarted ADB server, decreased emulator RAM and HAXM RAM, it always happen.
Try run Visual Studio with Administrator privilege.
"Run as Administrator"
If that's not working, try
Clear AVD cache, Xamarin cache.
Clean the project right click on solution in VS -> Clean Solution.
Delete bin/obj folders in you project folder manually for e.g.
../MyXamarinProject/bin, ../MyXamarinProject/obj
Create new Android Virtual Device

How to correctly use WDK 8.1 Devfund_IOAttack_ERT_Basic test for fuzzing windows driver

I want test my storage driver using fuzzing techniques and I choosed Microsoft tool called IoAttack that is represent as test case in WDK 8.1 and not standalone application like in previous versions of WDK. This tool work with IoSpy tool that gather all IOCTLs and WMI command that are send to the driver. IoSpy attach to driver stack as filter driver and record all traffic. Problem occurs after I successfull attach IoSpy, record all data than remove IoSpy and run IoAttack. Because IoAttack do not see my device that is created by my storage driver I cannot fuzz my driver. Below are steps and configurations that I use.
Any tip or solution will be very welcome :)
[Setup steps for test machine:]
Install driver that created storage device
Install package "WDK Test Target Setup"
default location: C:\Program Files (x86)\Windows Kits\8.1\Remote\x64
default location on machine that has WDK 8.1 component installed
installation command: msiexec /i "WDK Test Target Setup x64-x64_en-us.msi"
2.1 If your target computer is running Windows Server, find the DriverTest folder that was just created by WDK Test Target Setup MSI. (Example: c:\DriverTest). Right click the DriverTest folder, and choose Properties. On the Security tab, give Modify permission to the Authenticated Users group.
Install package Test Authoring and Execution Framework (TAEF)"
default location: C:\Program Files (x86)\Windows Kits\8.1\Testing\Runtimes
default location on machine that has WDK 8.1 component installed
installation command: msiexec /i "Test Authoring and Execution Framework x64-x64_en-us.msi"
Install package "WDTF runtime library"
default location: C:\Program Files (x86)\Windows Kits\8.1\Testing\Runtimes
default location on machine that has WDK 8.1 component installed
installation command: msiexec /i "Windows Driver Testing Framework (WDTF) Runtime Libraries-x64_en-us.msi"
installation verification:
Open a Command Prompt window on the test computer.
Run %WDTFDir%\Tools\CheckWDTFInstall.cmd
default location: C:\Program Files (x86)\Windows Kits\8.1\Testing\Runtimes\WDTF
Open the log file CheckWDTFInstall.log and examine the results which contains information on all installed WDTF components
Setting mode "kernel debugging"
steps:
Open a Command Prompt window as Administrator. Enter bcdedit /debug on
If the computer is not already configured as the target of a debug transport, enter bcdedit /dbgsettings local
Reboot the computer.
[Test procedure that uses IoSpy and IoAttack:]
Enable IoSpy using WDK test "EnableIoSpy" and application "TAEF"
command:
Te.exe "%SystemDrive%\Tests\Additional
Tests\DeviceFundamentals\ERT\Basic\Devfund_IOSpy_EnableSupport_ERT_Basic.wsc"
/select:"#Name='Devfund::EnableIoSpy'"
/p:"DQ=INF::OriginalInfFileName='my_storage_driver.inf'"
/p:"DFD=%systemdrive%\DriverTest\IoSpy"
/rebootStateFile:%SystemDrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Logs\Enable_I_O_Spy_(Quick)_(possible_reboot)_00000.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated
Reboot operating system
Use IOCTL commands for public and private IOCTLs
Verify that IoSpy data file that records the data sent throught IOCTL and WMI requests to drivers for devices enabled for fuzz tests is larger that initial 1 KB size (if not data acquiring failed for specific driver)
default location for IoSpy data file: %SystemDrive%\DriverTest\IoSpy
Disable IoSpy using WDK test "DisableIoSpy" and application "TAEF"
command:
te.exe "%SystemDrive%\Tests\Additional
Tests\DeviceFundamentals\ERT\Basic\Devfund_IOSpy_DisableSupport_ERT_Basic.wsc"
/select:"#Name='Devfund::DisableIoSpy'"
/rebootStateFile:%systemdrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%systemdrive%\DriverTest\Logs\Disable_I_O_Spy_(Quick)_(possible_reboot)_00000.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated
Reboot operating system
Run I/O Attack (Quick) fuzzer using WDK test "RunIoAttack" and application "TAEF"
command:
te.exe "%SystemDrive%\DATA\Tests\Additional
Tests\DeviceFundamentals\ERT\Basic\Devfund_IOAttack_ERT_Basic.wsc"
/select:"#Name='Devfund::RunIoAttack'"
/p:"DQ=DeviceID=’my_device_id_that_was_created_by_my_storage_driver"
/rebootStateFile:%SystemDrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Logs\Run_I_O_Attack_(Quick)_00001.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated
[Issue:]
Microsoft fuzzer IoAttack that is ran as test from WDK does not see my_storage_driver. Test pass because no devices we found for testing. Output from test:
*
StartGroup: Devfund::RunIoAttack Property: TAEF: Description [Runs I/O
Attack. ] WDTF_TARGETS: - Query("IsDevice AND IoSpy::") WDTF_TEST: No
devices were found for testing EndGroup: Devfund::RunIoAttack [Passed]
Summary: Total=1, Passed=1, Failed=0, Blocked=0, Not Run=0, Skipped=0
*
Command that was used to run test using WDK application "TAEF" (te.exe)
te.exe "%SystemDrive%\Tests\Additional
Tests\DeviceFundamentals\ERT\Basic\Devfund_IOAttack_ERT_Basic.wsc"
/select:"#Name='Devfund::RunIoAttack'"
/p:"DQ=DeviceID=’my_device_id_that_was_created_by_my_storage_driver’"
/rebootStateFile:%SystemDrive%\DriverTest\Logs\DriverTestReboot.xml
/enableWttLogging
/wttDeviceString:$LogFile:file="%SystemDrive%\DriverTest\Logs\Run_I_O_Attack_(Quick)_00001.wtl",writemode=append,encoding=unicode,nofscache=true,EnableLvl="WexStartTest|WexEndTest|WexXml|WexProperty|WexCreateContext|WexCloseContext|*"
/runas:Elevated
[Additional information:]
I tried to address my driver / storage device for fuzzing test using DQ=DeviceID, DQ=INF::OriginalInfFileName (like in IoSpy case) but in the end doesn't work.
Procedure source for usage of IoSpy and IoAttack is from https://msdn.microsoft.com/en-us/library/windows/hardware/ff547271
[Test machine setup:]
- Windows Server 2012 R2 Standard Build 9600 (x64)
[Software setup:]
- WDK 8.1 installed on Windows 7 Professional (x64)

SonarQube installation failing to start service

I'm installing sonarqube on Windows Server 2012.
I have followed the following steps:
Downloaded sonarqube4.4 and extracted to C:\Sonarqube
Downloaded Java JDK 1.7.0_60 and jre 1.7.0_67 as well as jre7
Installed Windows SDK 7 and .NET Framework 4
Navigated to C:\sonar\bin\windows x86-64 and ran StartSonar.bat as an administrator, this ran ok with no output and Ihad to hot ctrl- Z to break
I then ran \windows-x86-64\InstallNTService.bat as an administrator and I am seeing the sonarQube services was launched, but failed to start.
Not sure what the problem is.
I believe you first ran \windows-x86-64\InstallNTService.bat successfully and then StartSonar.bat unsuccessfully (the inverse order of what you describe).
You probably have [this problem]: http://qualilogy.com/fr/wp-content/uploads/sites/2/2013/09/Sonar_ServiceLaunchError2.jpg
Windows could not start the Sonar service on Local Computer.
Error 1067: The process terminated unexpectedly.
In that case, the solution is to change the user/rights to launch the Sonar service: https://qualilogy.com/en/migrate-sonarqube-tomcat-to-windows-service/
Go to the Services window, find the Sonar service, and open the Properties windows to change the user it logs on as to one with sufficient permissions.
I was able to solve this problem by creating a new folder named “Temp” in C:\Windows\System32\config\systemprofile\AppData\Local\
The Log-File will show only
--> Wrapper Started as Service
Cleaning or creating >temp directory C:\Program Files (x86)\SonarQube\sonarqube\temp
<-- Wrapper Stopped
The SonarQube service was launched, but failed to start.
After a long search, I came up to this site http://zen-and-art-of-programming.blogspot.de/2013/03/installing-and-running-sonar-source.html.
Solution:
Navigate to C:\Windows\system32\config\systemprofile\AppData\Local\ and create the directory Temp
2: Set the user rights to full access
3: Run the StartNTService.bat

Resources