Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not copy the assembly '/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll'

Every time I'm trying to deploy my project I'm getting the following error:

Compiling to native code /Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode.app/Contents/Developer" --cache "/Users/user/Desktop/Source/iOS/obj/iPhone/Release/mtouch-cache" --nomanifest --nosign -dev "/Users/user/Desktop/Source/iOS/bin/iPhone/Release/iOS.app" -r

...

-linksdkonly -sdk "7.1" -targetver "7.1" --abi=armv7 "/Users/user/Desktop/iOS/bin/iPhone/Release/iOS.exe" Xamarin.iOS 7.2.6 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk error MT1009: Could not copy the assembly '/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll' to '/Users/user/Desktop/iOS/obj/iPhone/Release/mtouch-cache/Link/monotouch.dll': Access to the path "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll.mdb" or "/Users/user/Desktop/iOS/obj/iPhone/Release/mtouch-cache/Link/monotouch.dll.mdb" is denied.

I cleaned obj folder - no luck. I reastarted the mac - no luck. I tried to go to /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll but wasn't able to access this folder - it says I have no right.

like image 504
Alexey Strakh Avatar asked Jun 20 '14 16:06

Alexey Strakh


2 Answers

Update: Xamarin verified that issue exists and provided KB article on about it with fix. All you have to do to fix that is run this in terminal:

sudo chmod 0644 /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll.mdb

Faced this problem on July 16, 2014. Found thread on Bugzilla about this issue. Unfortunately, the latest alpha build of XS I had still had this problem and, unfortunately, solution was different to what is described in the thread.

I had to run sudo chmod 777 /Developer/MonoTouch/usr/lib/mono/2.1/* to fix access rights. Fixing rights in your project's bin/debug/whatever folder doesn't help.

P.S. I know 777 is not the best choice in terms of permissions, but it's just a single Mono folder, so it's acceptable for me. P.P.S. So 0644 is the correct permission set ;)

like image 69
Alex Sorokoletov Avatar answered Nov 19 '22 10:11

Alex Sorokoletov


This did it for me:

sudo chmod 0644 /Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll.mdb

Source: http://kb.xamarin.com/customer/portal/articles/1649499-error-mt1009-could-not-copy-the-assembly

My current setup:

Xamarin Studio Version 5.2 (build 386)

Apple Developer Tools Xcode 5.1.1 (5085)

Xamarin.iOS Version: 7.2.6.28

Operating System Mac OS X 10.9.4

like image 2
j7nn7k Avatar answered Nov 19 '22 11:11

j7nn7k