Xbuild can't recognize SignAndroidPackage when using bamboo - apk

I am trying to create a .APK file in Bamboo using the xbuild executable in a command task. The way I thought it should work is like this:
CusomterApp.sln /t:SignAndroidPackage /p:Configuration=Release
This however when I run the build will give this error. Target named 'SignAndroidPackage' not found in the project. I have tried to build it without it but I am getting other errors instead. I have tried changing the order of it and changing the target but it doesn't seem to create the apk file doing this.
I have seen in another question that someone created an apk file using this(not on Bamboo):
xbuild $ANDROID_PROJECT_FILE /t:SignAndroidPackage /p:Configuration=Release
So I thought I should have no problems with using this on Bamboo but the executable doesn't seem to recognize the SignAndroidPackage and doesn't work, any ideas on how to fix this?
I create a .IPA file for an IPhone app using mdtool, with this command -v build -t:Build "c:Release|iPhone" CustomerApp.sln and this works fine for creating the .IPA file so I would have thought that the .APK would be fine too.
I think that the problem is to do with using the solution file for the Android apk file, The bamboo will create a solution folder which has both iOS and Android files in it. The iOS worked and built the IPA file when I used the CustomerApp.sln file. The apk file does not build when I use the CustomerApp.sln. If I use this CustomerApp.Droid/CustomerApp.Droid.csproj file I get a list of error's Are you missing an assembly reference?
When I was doing the IPA I got this error using the CustomerApp.iOS/CustomerApp.iOS.csproj file which I fixed by using the CustomerApp.sln file instead. How can I fix this as the whole folder contains information that is necessary for the creation of the APK file?
I have found a problem that when I try to build the apk file using this: /p:Configuration=Release CustomerApp.sln it gives me the error PCL assemblies not installed and it also has this warning : Unable to find framework corresponding to the target moniker '.NetPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behaviour. I don't know why this is happening as I looked for the profile in the folder specified and it was there.
I had this problem before when trying to use xbuild to create the IPA file but then I used mdtool and it worked fine, I think I need to use xbuild to build the apk file but I can't see how to fix it. I also tried to run it in the terminal of the mac and I got the same error. Why is this happening?

The reason this happens is because you have to specify a .csproj, not a .sln. If you give it a solution file, you'll get an error complaining that it can't find the "SignAndroidPackage" target.

Related

Bamboo unable to find framework corresponding to the target framework moniker?

I am trying to implement Bamboo into creating an IPA file or APK file using Xbuild but I am getting 1 warning and 1 error:
The warning is the following:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: warning : Unable to find framework corresponding to the target framework moniker '.NETPortable,Version=v4.5,Profile=Profile78'. Framework assembly references will be resolved from the GAC, which might not be the intended behavior.
The error is this:
/usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/Microsoft.Common.targets: error : PCL Reference Assemblies not installed.
I am unsure why this is happening because when I open the project in Xamarin studio and build it, it will be successful, and when I run it the app is fully functional with no problems at all. I have located the file location of the profile 78 in the version 4.5 and it exists, I have the latest installed version of Mono Development Kit (MDK). How can it build correctly in Xamarin but not in Bamboo, is it do with how I locate the files?
I have also tried to create the APK file on the terminal but got the same error as well. I have tried a lot of fixes like uninstalling mono and reinstalling, I added .NETPortable from windows to Mac but that didn't work, why can't my mac find the profile 78 it is located on my mac.
The file /usr/local/Cellar/mono/4.6.2.7/lib/mono/xbuild/14.0/bin/microsoft.common.targets seems to be looking for the .NetPortable,Version=v4.5,Profile=78 but I have that in this location: Library/Frameworks/Mono.framework/Versions/4.6.2/lib/mono/xbuild.frameworks/.NetPortable/v4.5/Profile/Profile78 and I have pasted the .NetPortable folder in multiple locations to try and fix this error. Where am I going wrong?
Although I have not touched Bamboo for quite some time(3+ years), one thing I personally do is to ensure your xbuild command works like a charm in a local environment with a similar setup. Seeing that you tried to create an .apk through the terminal and got the same error sounds like an installation error. The PCL Reference Assemblies should be apart of the MDK on MacOS. Seeing that you have it installed, it sounds like a potential issue with file permissions of the Bamboo user account.
To create an .apk file, you need to use the /t:PackageForAndroid target against your Android project when invoking xbuild.
EX:
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:PackageForAndroid
You can also use the SignAndroidPackage target given the notes here:
https://developer.xamarin.com/guides/android/under_the_hood/build_process/#Build_Targets
xbuild XamarinAndroidApplication.csproj /p:Configuration=Release /t:SignAndroidPackage
If you wanted to use the MSBuild equivalents, it would look like this:
msbuild MyAndroidApp.sln
msbuild /t:SignAndroidPackage MyAndroidApp.csproj

Multiple build commands for output file in Xcode

My xCode project for an OSX app gives me the following error.
Warning: Multiple build commands for output file
/Users/myusername/Library/Developer/Xcode/DerivedData/Flui-dpvozbfxcmsipwfrrannskcofgit/Build/Products/Debug/appname.app/Contents/Resources/Icons
Is this something I should be worried about or fix immediately?
Also is there a way to make this go away?
Open the Copy Bundle Resources from the Build Phase in your project. Find the duplicate files in that list and delete their references.

Crashlytics Won't Pass "Add a Run Script Build Phase"

After installing Crashlytics and checking out the source code for the project I am helping out with, I add a build phase script and add the following code:
./Crashlytics.framework/run <api_key>
This initially worked until I blew away my changes. I then tried to build and was missing my Crashlytics.h file. I then tried to reconnect the app but I get stuck at the "Add a Run Script Build Phase".
I have tried removing Crashlytics and reinstalling it without success. Does anyone have insight into how I can get things running again?
Thanks in advance!
Check Debug Information Format for Debug, and Release. They should be DWARF with dSYM File.
dSYM file is in order to show debug symbols. The Run Script will upload dSYM file.
Make sure that you have pasted Run command bellow the Shell /bin/sh field:
I was able to fix this by manually grabbing the Crashlytics files that are generated and import them into the project. They are generated in the Crashlytics folder when you add the run script build phase, but not imported.

Native plugin with Unity3d Mac OSX Dll notfoundexception

I am trying to integrate a 3rd party native plugin with unity3D. In order to use it i made a c# plugin as a wrapper dll. The plugin works fine with PC standalone when i copy the plugin binaries manually to build folder along with my EXE file.I have used debug configuration for the plugin build process.
Problem is :
when i make a mac OS X build, i am getting DllNotFoundException. My c# plugin file is in the app located at "\Contents\Data\Managed" along with other unity related plugins which means unity is recognizing my wrapper plugin but not copying the native plugins.
Things already tried :
I copied the native plugins also in the Assets/Plugins/ folder so as they are also included in build, but unity didn't include them in build.
I tried putting my native plugin in "\Contents\Data\Managed" folder and also in other folders in the app,still it was not able to find the dll.
I tried putting the dylib file which came with the native plugin, also along with my wrapper plugin but it didn't work.
I tried to do a dllmap in the config file at "\Contents\Data\Managed\etc\mono" using
also, but it didn't work.
I am out of ideas. Any help is appreciated.
It worked for me to add a dll map to the mono config file found here:
Your.app/Contents/Data/Managed/etc/mono/config
I added the following :
<dllmap dll="phidget21.dll" target="/Library/Frameworks/Phidget21.framework/Versions/Current/Phidget21" />
Make sure that the Phidget21.framework exists in /Library/Frameworks..

xcodebuild header files not found in ReskIt

I am pretty new to Xcode development. We are using command line tools to build the iOS project. We kep on getting the RestKit/RestKit.h file not found error while using command line build. If we use the normal XCode utility build it build without any issues.. There are few more thrid party code being used which may also have the same issue.
The folder struture of the project is like this.
--Project.xcodeproject
-- RestKit
----RestKit.xcodeproject
--SDWebImageKit
-----SDWebImageKit.xcodeproject
-----SDWebImage
---- .h and .m files
What path should we set in header search paths to properly build this in xcodebuild command line utility.
I resolved all the issues by creating a workspace, adding a scheme and building hte workspace using xcodebuild. I didnt have to chnage any of the header settings as being set in XCode GUI.

Resources