AD-Hoc option is not coming in my project in xamarin - xamarin

I added it manually in app.iOS.csproj file in tag and in the main solution file. Now it is showing and I am successfully able to archive my project and iPA file is made. But the problem is that I am unable to install my app on device when installing through diawi.

I solved the problem by adding "aps-environment" key with value as
"production" in Entitlements.plist in my iOS project
Previously there was "development" as value. I changed it to "production"

Related

Missing assets in IPA when building Xamarin iOS app using msbuild on jenkins

When building the same app (on Mac VS2019) from the same prepared zip archive with removed bin and obj folders and cleaned solution right before build I get different IPA "archives".
The one from jenkins is missing Assets.car and app icons so the app doesn't show home screen icon and splash during loading. During the _CopyResourcesToBundle target that should copy all required assets it gives:
Building target "_CopyResourcesToBundle" partially, because some output files are out of date with respect to their input files.
Because it runs into partial state it probably doesn't copy all the required files.
When building on the local machine with the same VS2019 (8.4.2) for Mac and the same Xcode (11.0) no matter when using IDE or the terminal it gives correct IPA file.
Building target "_CopyResourcesToBundle" completely.
...
Output file "bin/iPhone/Release/RssReader.app/AppIcon60x60#2x.png" does not exist.
Output file "bin/iPhone/Release/RssReader.app/AppIcon76x76#2x~ipad.png" does not exist.
Output file "bin/iPhone/Release/RssReader.app/Assets.car" does not exist.
...
bin/iPhone/Release/RssReader.app/AppIcon60x60#2x.png
LogicalName=AppIcon60x60#2x.png
Optimize=false
OriginalItemSpec=obj/iPhone/Release/actool/bundle/AppIcon60x60#2x.png
OutputPath=bin/iPhone/Release/RssReader.app/AppIcon60x60#2x.png
bin/iPhone/Release/RssReader.app/AppIcon76x76#2x~ipad.png
LogicalName=AppIcon76x76#2x~ipad.png
Optimize=false
OriginalItemSpec=obj/iPhone/Release/actool/bundle/AppIcon76x76#2x~ipad.png
OutputPath=bin/iPhone/Release/RssReader.app/AppIcon76x76#2x~ipad.png
bin/iPhone/Release/RssReader.app/Assets.car
LogicalName=Assets.car
Optimize=false
OriginalItemSpec=obj/iPhone/Release/actool/bundle/Assets.car
OutputPath=bin/iPhone/Release/RssReader.app/Assets.car
The above part is obviously not present when building on jenkins.
This looks like several other threads when others were struggling with missing assets and they were clearing some misty Xamarin cache folders, adding and removing assets to the project with rebuild, cleaning and removing bin/obj folders.
This is not the same case as app is always built on the cleared workspace in the tmp location with removed bin and obj folders and cleaned before the build. Adding/removing and moving the location of the resource also doesn't help.
Apps cannot be built on symlink locations due to msbuild internal issue.
See: https://github.com/xamarin/xamarin-macios/issues/7759

Teamcity buildpath change nativescript project name

Teamcity create a path BuildAgent/work/d455sdffs654... and change my nativescript project name and app name, i try make a new folder and change to this new folder but the project name not change.
npm install --save-dev nativescript-dev-webpack
tns platform remove android
tns platform add android
tns build android --bundle
If you like your project name to be independent of its folder name, you may update the value for CFBundleDisplayName key in App_Resources/iOS/info.plist for iOS.
<key>CFBundleDisplayName</key>
<string>YourAppName</string>
For Android you may modify the value of app_name and title_activity_kimera keys in App_Resources/Android/src/main/res/values/strings.xml.

Remove a package via script in xamarin forms

I have a build build script(MyBuild.sh) set up for creating the Android apk for a xamarin forms application.
My requirement is when i give the internal test builds i want the microsoft app center crashes and analytics in the the project csproj but when i take the PROD builds i don't want the microsoft app center crashes and analytics in the project
so in the build script i check whether its a PROD build and tried to remove the app center packages from the csproj.
if [ $Env == 'PROD' ]
then
dotnet remove ./Sample/Sample.csproj package Microsoft.AppCenter.Analytics
dotnet remove ./Droid/Sample.Droid.csproj package Microsoft.AppCenter.Crashes
fi
My problem is when the script is executed it correctly removes the package from the Shared Code but not from the Droid.csproj and while trying to remove the package it throws
info : Removing PackageReference for package 'Microsoft.AppCenter.Crashes' from project './Droid/Sample.Droid.csproj'.
error: The imported project "/usr/local/share/dotnet/sdk/2.1.4/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. /Users/george.thomas/Documents/Nov/Candidate/Droid/Sample.Droid.csproj
Now if i remove the MSBuildExtensionsPath from the Droid.csproj and run the script it correctly removes the packages but the project cant be built
throwning The target "Build" does not exist in the project
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />

Error when building application using cordova

I am using cordova 6.5.0 and when I run "cordova build ios" the build failed with error "No profile for team **** matching ***** found"
but when I open the project in Xcode I am able to build and archive using the same provision profile
How do I solve this?
1) Do you have any Embedded Frameworks in your project?
Go to Build Phases > Under Embed Frameworks
Tick the checkbox for Code Sign On Copy
And try to build again
2) Try to double check your certificate and your provisioning profile if it is selected correctly
Hope it helps!

Xcode 7 - Unable to validate your application

When i upload my app to app store, i've had a problem:
Unable to validate your application:
The path '/var/folders/hm/.../MyApp.ipa' does not contain a file
I have another error:
Couldn't find platform family in Info.plist CFBundleSupportedPlatforms or Mach-O LC_VERSION_MIN for sfnt2woff
I've added:
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
in my plist file but it doesn't work.
Any solution?
Thanks !
Have the same problem. Just delete some .bundle resource from "Bundle Resources" in Build Phases in Xcode project. See here:
Setting "Enable bit code" to NO worked for me
Also:
Clean build folder
rm -rf ~/Library/Developer/Xcode/DerivedData
Restart xcode.
If you do not wish to rebuild, you can untick theses checkbox:
I've found a solution. In my application, a library called "ionicons" has been used. I just simply remove the sfnt2woff file in lib/ionicons/builder/scripts/ and the validation works.
For me, I was asked for permission to access something in my Keychain. I mistakenly clicked 'deny'. Once I re-archived the app again and granted it the permission, it works.
For the benefit of others like me: I had a similar problem with an old version of sparkle that didn't include the info.plist in the framework.
Check all your frameworks; They now also need an info.plist with these settings.

Resources