Cannot install app to iPhone

I am new to coding and have been following Chris’ tutorial on youtube on coding with xcode and have successfully built the War Card Game. However when I try to run it on my device (IPhone XR) it says 'unable to install war card game" and gives me this error:

Unable to install “WarCardGame”
Code: -402620383

The maximum number of apps for free development profiles has been reached.
Code: -402620383
User Info: {
DVTRadarComponentKey = 487925;
MobileDeviceErrorCode = “(0xE8008021)”;
“” = (
0 DTDeviceKitBase 0x0000000119da981a DTDKCreateNSErrorFromAMDErrorCode + 233
1 DTDeviceKitBase 0x0000000119deaf70 90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
2 DVTFoundation 0x00000001009d1155 DVTInvokeWithStrongOwnership + 73
3 DTDeviceKitBase 0x0000000119deaca8 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1654
4 IDEiOSSupportCore 0x0000000119c61e91 118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4165
5 DVTFoundation 0x0000000100b047f4 DVT_CALLING_CLIENT_BLOCK + 7
6 DVTFoundation 0x0000000100b06436 DVTDispatchAsync_block_invoke + 1194
7 libdispatch.dylib 0x00007fff676896c4 dispatchcall_block_and_release + 12
8 libdispatch.dylib 0x00007fff6768a658 dispatchclient_callout + 8
9 libdispatch.dylib 0x00007fff6768fc44 dispatchlane_serial_drain + 597
10 libdispatch.dylib 0x00007fff676905d6 dispatchlane_invoke + 363
11 libdispatch.dylib 0x00007fff67699c09 dispatchworkloop_worker_thread + 596
12 libsystem_pthread.dylib 0x00007fff678e4a3d pthreadwqthread + 290
13 libsystem_pthread.dylib 0x00007fff678e3b77 start_wqthread + 15

System Information
macOS Version 10.15.4 (Build 19E287)
Xcode 11.4.1 (16137)

I have tried using a different apple ID but the same error comes up, I have not exported any other apps to this phone from xcode and have tried to disconnect and reconnect the device, any idea why i keep getting this message? Any help will be much appreciated.

Hello, maybe try the solutions on this thread

i also read that you can try changing to a different usb port, or check firewall

Hi, I have tried a different port with no luck, i’ll have a look at the forums.

Thank you.