There is no is build for my phonegap project on build.phonegap.com - phonegap-build

I have built a Cordova project, and I have uploaded it to a Phonegap build, Android build appears on build tab but there is no Windows or iOS.
Below is the picture I get from build.phonegap.com
So how can I add iOS support to the project?
I have tried the following command in Cordova cli in my local machine
cordova platform -add ios
It runs successfully and adds iOS to the platform project. I uploaded files again to build.phonegap.com, but again no success in getting an iOS build tab.
Any suggestions?

PhoneGap applications are configured using a config.xml file. This should be at the root of your application.
You can have zero or more of these elements present in your config.xml. Set the name attribute to one of ios, android, or windows. If you specify none, all platforms will be built. Example usage:
<platform name="ios" />
<platform name="android" />
<platform name="winphone" />
so i had to add below line to config.xml
<platform name="ios" />

Related

Can't add images to new .NET MAUI project on Mac without getting: The name 'Resources' is reserved and cannot be used

I just started a brand new template .NET MAUI project on my Mac and I am able to build and run the startup project with no problems.
When I add any image to the "Resources/Images" folder and then try to build the project I get the error:
Error Description:
The name 'Resources' is reserved and cannot be used.
Error Path:
Resources/Images/icon_notes.png
SPECS
Visual Studio for Mac 17.4 Preview (17.4 build 2326)
I have tried cleaning and rebuilding the project but that does not help.
Steps to reproduce:
Install Visual Studio for Mac 17.4 Preview
Create new .NET MAUI project from startup template offered by the IDE
Build and run to make sure it runs properly (It will).
Add any image to the "Resources/Images" folder and then try to rebuild.
Please help me understand what is wrong here and how to fix it.
Here is my csproj file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net6.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>Notes</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<!-- Display name -->
<ApplicationTitle>Notes</ApplicationTitle>
<!-- App Identifier -->
<ApplicationId>com.companyname.notes</ApplicationId>
<ApplicationIdGuid>2cc957c4-bc4d-4867-9002-8475070561fa</ApplicationIdGuid>
<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>
<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />
<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />
<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiFont Include="Resources\Fonts\*" />
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
</Project>
Here is the properties on the image that is causing this:
Thanks to Liqun Shen for the direction to the solution.
The issue is that when you add an image to the Resources/Images folder and check your csproj file you will see that each image is added as an ItemGroup to the csproj file. This must be some sort of bug and the solution was to manually delete these from the csproj file after which the code builds and runs properly.
I know that in my csproj file I listed about these ItemGroups for each image added wasn't showing but checking again they were there and removing them fixed my issue. I must have copied my csproj file from one of my attempts at erasing my project and retrying again and before I added the image.
<ItemGroup>
<None Remove="Resources\Images\icon_notes.png" />
</ItemGroup>
Here is the link that Liqun Shen posted that describes this:
https://github.com/dotnet/maui/issues/10531
I have the same error from new MAUI project (No Razor) on VS for Mac v17.4.4: The name 'Resources' is reserved and cannot be used.
What I did was:
Edit "ProjectName.csproj" and change all references to folder "Resources" and renamed to "ResourcesNet"
Change the folder name from "Resources" to "ResourcesNet"
Change in App.xaml all references to "Resources" to "ResourcesNet"

When writing a cordova plugin for ios, how do I set the minimum ios platform in my podfile?

I'm writing a cordova plugin and I have a framework I'm adding with cocoapod. The framework has a minimum ios requirement of version 13.0. When my pod file is generated it is defaulting to ios 10.0. How do I set the required IOS version in my plugin.xml?
plugin.xml snippets:
<engines>
<engine name="cordova" version=">=6.0.0" />
<engine name="cordova-android" version=">=9.0.0" />
<engine name="cordova-ios" version=">=5.1.0" />
</engines>
<platform name="ios">
...
<podspec>
<config>
<source url="https://cdn.cocoapods.org/"/>
</config>
<pods use-frameworks="true">
<pod name="ArcGIS-Runtime-SDK-iOS" spec="100.10" />
</pods>
</podspec>
</platform>
podfile created:
source 'https://cdn.cocoapods.org/'
platform :ios, '10.0'
use_frameworks!
target 'testPluginApp' do
project 'testPluginApp.xdodeproj'
prod 'ArcGIS-Runtime-SDK-iOS', '100.10'
end
My guess is that the iOS 10.0 platform is coming from the Cordova plugin.xml. Perhaps tied to the 5.1.0 version of cordova-ios?
I am not a Cordova developer, but you could try setting the deployment-target in your config.xml. See here (scroll down to deployment-target).
A quick Google search would indicate that this is the expected way to resolve this, but that it is a bit touchy.
Setting the deployment-target in the config.xml is correct.
<preference name="deployment-target" value="13.0" />
However, the pod file will only be updated if you add the ios platform again before calling cordova prepare or cordova build.
My final working solution:
cordova platform add ios && cordova prepare ios && cordova build ios
which results into
platform :ios, '13.0'

Xamarin iOS building on windows with mac connected. Is there a way to access mac files during the build?

I am building iOS project using Windows that is connected to Mac.
I need to add a target that will copy some libraries from ${DEVELOPER_DIR}/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos/
into app bundle
how to access them from *.targets file?
<Target Name="_CopySwiftLibraries">
<ItemGroup>
<_SwiftLibsDevice Include="[How to specify a path properly to access the files by path above?]" />
</ItemGroup>
<Copy SessionId="$(BuildSessionId)" SourceFiles="#(_SwiftLibsDevice)" DestinationFolder="$(_AppBundlePath)Frameworks" />
</Target>
Turns out once it connected to the mac it works in the scope of mac and normal path will work
$(_SdkDevPath)\Toolchains\XcodeDefault.xctoolchain\usr\lib\swift\iphoneos\libswiftCore.dylib

Why is Ionic ios cordova build failing

When creating an ios build with the ionic command:
ionic cordova build ios --prod --buildFlag='-UseModernBuildSystem=0'
I keep getting the following code signing error:
Code Signing Error: No profiles for 'mybundleid' were found: Xcode
couldn't find any iOS App Development provisioning profiles matching 'mybundleid'.
Automatic signing is disabled and unable to generate a profile.
To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
While there are plenty of good answers (e.g. https://stackoverflow.com/a/44102979/4553162), my issue was actually because of an incorrect entry in my config.xml file where I was configuring the cordova branch plugin:
<branch-config>
<branch-key value="my-live-key" />
<uri-scheme value="my-scheme" />
<link-domain value="myapp.app.link" />
<ios-team-release value="INCORRECT_APP_PREFIX" />
</branch-config>
The INCORRECT_APP_PREFIX actually overwrites what you had in your build.json and is the source of the code signing error.
By changing it to the correct app prefix, the build completed correctly

Xcode / Cordova build: how to automate the population of "Linked Frameworks and Libraries"

After I cordova platform rm ios and cordova platform add ios, once I prepare my app I have to go into Xcode and manually relink all of the required frameworks and libraries.
Is there a way to automate this or at the very least, save this list so I can add it easily?
As far as I know, you can't specify frameworks within the config.xml.
You can specify them within a plugin's plugin.xml,
so one workaround would be to create a barebones dummy plugin consisting of just a plugin.xml with a list of all the frameworks your app needs; something like this:
<?xml version="1.0" encoding="UTF-8"?>
<plugin
xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="my-custom-frameworks-plugin"
version="0.0.1">
<engines>
<engine name="cordova" version=">=3.0.0" />
</engines>
<platform name="ios">
<framework src="MapKit.framework" />
<framework src="Social.framework" />
</platform>
</plugin>
You'd then add the plugin to your app using it's local path: cordova plugin add /path/to/my/plugin
And then specify it using a <plugin> element in your config.xml:
<plugin name="my-custom-frameworks-plugin" version="0"/>
Each time you remove then add the platform, the plugin will be re-added and the referenced frameworks added to the XCode .plist file.
Alternatively, you could write a custom after_platform_add hook to read <framework> elements directly from the config.xml and update the .plist file.

Resources