Xamarin build error referencing monotouch.dll

I recently manually added my SQLCipher reference to my existing project. When I attempt to build my project, I now get the following error:

myProject/iOS/MTOUCH: Error MT0034: Cannot reference ‘monotouch.dll’ in a Xamarin.iOS project - it is implicitly referenced by ‘SQLite.Net.Platform.SQLCipher.XamarinIOS, Version=4.1.1.0, Culture=neutral, PublicKeyToken=null’. (MT0034) (myProject.iOS)

I’m not sure how to fix this, I have tried deleting the sqlcipher package and adding again, rebuilding, and restarting Xamarin but no luck. Thanks for any help

Hi @Tyler_Kelly

Have you recently converted your project to Xamarin Unified API? The older monotouch integration is still included, but you will likely want to move over to the new unified version which is also included in the component package. You may want to close Xamarin Studio and review the project file within a text editor to see what is being included.

I did not recently convert, but after checking with this, my project is in fact the unified version.

After reviewing my csproj file I only have one instance of monotouch and that is here:

<Reference Include="SQLite.Net">
  <HintPath>..\packages\SQLite.Net.Core-PCL.3.1.1\lib\portable-win8+net45+wp8+wpa81+MonoAndroid1+MonoTouch1\SQLite.Net.dll</HintPath>
</Reference>

also, I’d like to clarify that I manually added the SQLCipher dll to my references folder after adding the 4.1.1 iOS folder to my project’s root folder. I did not go through the component store. Not sure if that matters

That is the SQLite.NET PCL Core assembly, it does not reference the monotouch.dll.

What do you mean when you say that you did it manually? How did you receive the package?

I replied to your previous post just recently about how I manually added it. Here it is again

also, I’d like to clarify that I manually added the SQLCipher dll to my references folder after adding the 4.1.1 iOS folder to my project’s root folder. I did not go through the component store. Not sure if that matters

I think this is where my error lies, I just tried with the trial version of sqlcipher through the component store and my project was able to build.

I work for a company that acquired the license and I was sent a folder that has the following structure:

->sqlcipher-for-xamarin-ios-4.1.1.0
—>sqlcipher-for-xamarin-ios-4.1.1.0
-------->component
-------->lib
-------->samples

and i added that folder to my project root, and then reference the dll in the lib folder.

This method worked effortlessly in the android version, but causing headaches in iOS

FIXED: There were two SQLCipher dlls in the folder, I should have been using the unified dll but instead was just using the one named iOS

Hi @Tyler_Kelly

I’m glad to hear you have resolved the issue. In the future, you may want to use the xamarin-component.exe tool from Xamarin to directly install the .xam package within Xamarin Studio/Visual Studio. You would execute the following:

mono xamarin-component.exe install /path/to/sqlcipher-for-xamarin-ios.xam