I want to start programming Android with C# but in my first program I have this error:
"C:\Program Files\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error
MSB6004: The specified task executable location "C:\Users\briluser\AppData\Local\Android\android-sdk\tools\zipalign.exe" is invalid. (MSB6004)"
I found the android-sdk directory on my system, and copied zipalign from the build-tools/19.1.0 directory to the tools directory but it doesn't work for me!
I have seen this issue before and manually copying the file doesn't seem to work. To work around this try going into the Android SDK Manager and expanding the Tools folder. In there, try installing the latest version of the Android SDK Build-tools. For me this is Rev. 20. After installing the update, this error should go away.
Related
I'm new to Mono - thought I'd give cross platform a try - my main IDE is Visual Studio and so the process of building applications through the command prompt is a bit foreign to me.
I was following the Mono Basics tutorial, and have gotten to the point where it says Winforms Hello World. I copied the code provided and saved it to a .cs file (on the Desktop).
I then opened up a command prompt and pointed it towards the Desktop directory. I ran the command:
mcs hello.cs -pkg:dotnet
And the result was:
The console told me that it was a CS8027 error but nothing else.
I have 3 environment variables that I added, with no fix:
PATH -> path to mono\bin
PATH -> path to mono\lib\pkgconfig
PKG_CONFIG_PATH -> path to mono\lib\pkgconfig
This happens whenever I try to use pkg-config.exe (tried to use pkg-config.exe --list-all but the same problem arose).
I've checked other answers/questions about the CS8027 error but the solutions did not help - it still crashes every time!
Had the same problem. I had all the proper VC++ runtimes installed, but still crashed.
pkg-config.exe references librares (.dll) that are compiled in different versions of .Net. Your PATH (or pkg-config itself) might be referencing a different version than the one the .dll uses, or not have it at all.
pkg-config is a short-hand anyway. I fixed it by explicitly including the .dll I'm referencing using the proper version of .Net for me:
mcs hello.cs -r:"C:\Program Files\Mono\lib\mono\4.5-api\System.Windows.Forms.dll"
pkg-config is built with a different version of MSVC to Mono itself. You need the 32-bit VC++12 runtime installed for it to work. That ought to be included with mono.msi, as per https://github.com/mono/release/commit/8394dcc254510977c3e654abf916a48c6c6894fb
If you check the Windows event log, under Applications, you might get more information on what didn't work.
I had this problem, could help some.
D:\Code\Mono>mcs hello.cs -pkg:dotnet
error CS8027: Error running pkg-config. Check the above output.
I needed to download the following DLL:s from https://www.dll-files.com/
libiconv-2.dll
libgcc_s_sjlj-1.dll
libintl-8.dll
libglib-2.0-0.dll
Put them in C:\Program Files\Mono\bin
All DLLs should be 32 bits even if Mono was 64 bits.
In my system the problem was the empty space inside the path of install and how that is managed inside of the pc files.
A workaround is to edit the pc files to change the prefix entry to the short path. In my system:
prefix=C:/PROGRA~1/Mono
instead of
prefix=${pcfiledir}/../..
We are running the 'Welcome to Xamarin` example on Visual Studio Enterprise, using the latest Xamarin, in a Windows 8.1 environment.
We are managing to build and run on both Windows and Apple, but we are facing problems with Android.
Error:
The referenced component System.ObjectModel could not be found.
The errors can be seen in the screen shot below:
See screenshot
We've already tried searching online for solutions, we found some, which we tried, but to no avail.
On the other hand, is Xamarin compatible with Windows 8.1? Perhaps some Android requirement actually needs a Windows 10 environment.
Any help would be appreciated.
Right click on your Android project's references and manually add the reference: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.ObjectModel.dll. And technically that's a warning, not an error.
I simply removed the reference entirely since none of my code actually used it.
In the Package manager console type: (Select the Android project)
update-package -reinstall
Is slower but is the correct method and always works
Exercise 1 from GitHub https://github.com/XamarinUniversity/XAM135/
when opening has the same problem.
Based on the above solutions I resolved by performing the following steps:
Update the Nuget Package
Save, close and abire the solution
Click on the Portable (shared) project-> Referencias-> Donet in the copy properties of the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111"
Open Windows Explorer and paste the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111", here is the System.ObjectModel.dll file
Click on the Droid Project -> Referencias and REMOVE System.ObjectModel
Right click on References and Add references
Click the Browse button and open the path = "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111"
Select System.ObjectModel.dll, and then click Add and OK
The reference was added successfully! Save, compile the project.
Here is a similiar solution
Try moving it to desktop, then add it as ref in solution. worked for me, visual studio had access to all the other ref but for some reason dident have access to that specific ref. So i moved it, and i think it gave visual studio access. simply try to move it where access wont be a problem.
Copy dll and paste to packages folder. Change reference to new location and run project. Of course it's temporary solution. You can check another location for path without white spaces in folders name.
ovee
yes, you are partially correct, it works, but after again giving to old location (C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0\Facades\System.ObjectModel.dll) missing error resolved.
I just implemented a native library, Charts (original native library), and its working on my phone and simulator. Unfortunately, when I submit it to iTunes connect, it kicks it back after processing and says:
Invalid Swift Support - The SwiftSupport folder is missing. Rebuild
your app using the current public (GM) version of Xcode and resubmit
it.
I'm using XCode to publish the archive to iTunes connect, but don't know how to do what this StackOverflow solution is saying. Since I don't use XCode to start the build process, I'm using Xamarin Studio 6, not sure how to set that setting.
So ideally, I need to "Set the flag EMBEDDED_CONTENT_CONTAINS_SWIFT to YES in the target settings".
Anybody have any ideas on how to do this? At a roadblock on releasing the beta until I can get this uploaded.
Thanks for your help!
What's your Xcode version? Make sure to be using the latest and GM one, I believe it to be 7.3. The script described on the Readme copy the files from Xcode folder.
If you unpack the IPA created after the script ran you can check for the folder's existence.
When rebuilding and binding the library the option "Set the flag EMBEDDED_CONTENT_CONTAINS_SWIFT to YES in the target settings" Didn't work for me as well.
Apple stated when trying to publish: "Invalid Frameworks folder". Xcode will embed files as in: 'Payload/YOURAPP.app/Frameworks/Charts.framework/Frameworks/libswiftCore.dylib', but in the final App it should be as in: 'Payload/YOURAPP.app/Frameworks/libswiftCore.dylib' and 'SwiftSupport/libswiftCore.dylib'.
To solve the problem the library does it in the build process. And you need the script to fix the 'SwiftSupport' folder. I didn't found a way to tamper with Xamarin Studio 'Archive for Publish' function.
Update: You can just use this script I threw together to fix your IPA so it's properly formatted, download the Auto IPA Packager on Github. It's a simplification of the IPA Packager I reference below, and handles all of the steps below too.
So, I've finally made it submit properly to the App Store, just had to hop through a few more steps than I expected. A lot of my confusion was because I didn't want to leave out other artifacts. I've decided to list the process here so it's very clear for anybody deploying an iOS app in the future that needs to use this tool.
Download the IPA Packager from GitHub.
Then go to Xamarin Studio, and Build > Archive for Publishing.
I've been using XCode to export my archives. Open XCode, Window > Organizer. Find your app archive, and click "Export" and follow the appropriate steps, then save it.
Locate the .ipa file and change it to .zip, and extract it.
Next, in the extracted files, locate the "AppNameFolder > Payload > AppName.app".
Load terminal and execute the following:
sh package_ipa.sh /AppNameFolder/Payload/AppName.app /AppNameFolder/AppName.ipa
AppName.ipa should now be created. This file should be ready to upload to the App Store. However, if your AppNameFolder has a "Symbols" directory you should follow the additional steps below...
Optional: If you have symbol files, you should change the AppName.ipa to AppName.zip and extract the files.
Drag the "AppNameFolder > Symbols" directory into the extracted AppName folder, then zip the contents of the folder and change the extension back to .ipa.
I had some issue getting #jamesbar2 solution to work. Here are my manual steps for uploading Xamarin builds with Swift packages.
Archive your app for Publishing.
When the Archives window pops up, go to it in Finder (right click on it and select "Reveal in Finder").
When Finder appears, we need to access the archive's content (right click and select "Show Package Contents").
Inside of the archive package, create a folder called "SwiftSupport".
Inside of the package navigate to "Product/Applications/YourAppName.app/Frameworks" (You will need to right click on the .app and select "Show Package Contents").
Copy all the swift ".dylib" files inside of the Frameworks directory.
Navigate back to "SwiftSupport" and paste those copied libraries.
Now Launch Xcode and load Organizer (Window -> Organizer).
Find your app in the Archives and "Upload to App Store...".
I was only able to get this to work using Xcode Organizer, using Xamarin always failed.
Note: I am using Visual Studio for Mac Community 7.3.2 (build 12).
Update:
I recently had issues with uploading, with TestFlight rejection email saying something like:
The file libswiftCore.dylib doesn’t have the correct code signature. blah, blah, blah.
To fix this problem instead of copying the Frameworks from your app Framework folder, grab them from Xcode. You can find them at:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos
Note TestFlight would reject my build if I added all the Frameworks to SwiftSupport folder. Only include the Frameworks that your app is using.
I am trying to build an app in Xamarin Studio that is synced with my Windows computer using iCloud Drive and I am getting this error when I try and build:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets:
Error: Error executing task CreateAdditionalLibraryResourceCache:
Directory '/Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/SkimurSkimmer/SkimurSkimmer/C:\Users\Edward\AppData\Local\Xamarin\Android.Support.v7.AppCompat\20.0.0\content\support\v7\appcompat' not found. (SkimurSkimmer)
...SkimurSkimmer/mmer/SkimurSkimmer/C:\Users\Edward\AppData....
The appending of the Windows path onto the OS-X path is an issue with the files that you are syncing.
Delete the bin and obj output directories in the project subdirectory:
** Actually within all your projects of the solution.
In Xamarin Studio do a Build All.
At that point, the cache directory will be created if it does not already exist and the required resource will be downloaded and inflated.
You have to watch out for sync'ing those output directories, especially the obj.
The other to watch out for is the datetime stamp issues, as differences between the machines can cause things not to get rebuilt when needed. Again deleting the obj and bin directories solve it
Hi I also got the error: “Error executing task CreateAdditionalLibraryResourceCache”, and my problem turned out to be a form of PathTooLongException. So, to fix this particular error, all you have to do is move the project to some other shorter directory such as "C:\", that is, if you're working in Windows. Btw I'm working in Visual Studio 2015.
I am trying to create a package of my UWP app and put it through a WACK test.
Windows App Certification Kit - Test Results is FAIL. I think it's because VS2015 is outputting a debug build irrespective of the settings i've chosen.
Has anyone come across this problem before?
Is visual studio ignoring my settings, or does my project include a library that's not going to pass WACK?
'Release' is selected both in the build menu and in Output Package dialogue.
JSON.net and EF7 only, both are UWP compatiable. Tasks and DataAccess are a background task and a class library.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\coreclr.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\dbgshim.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\mscordaccore.dll has failed the AppContainerCheck check.
File C:\Program Files\WindowsApps\f0679d56-bdc0-4305-837e-16b5560c7c41_1.0.14.0_x86__ade4xr40r36he\mscordbi.dll has failed the AppContainerCheck check.
i also have the same issue and it is caused due to EntityFreamework.Commands reference. When you building the code for store package or release mode just remove all references of EntityFramework.commands by uninstalling from nuget.
that should help to get rid of those errors. for more information please go here. let me know how it went.. all the best.
I am now using VS2015 preview 2 and everything is building with it just fine. I get no errors in the WACK.
Microsoft just decided to release .net native a year before it could actually compile things properly.