8
votes

I'm having difficulty getting IronPython running in a Xamarin.Android app. Xamarin states they have limited DLR support.

I installed the latest version of Iron Python on my PC. In my Xamarin.Android project in Xamarin Studio, I added references to <IPY Install Dir>\Platforms\Android*.dll.

When I compile, I get...

    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(2,2): Error: Exception while loading assemblies: System.IO.FileNotFoundException: Could not load assembly 'Microsoft.Scripting, Version=1.1.0.20, Culture=neutral, PublicKeyToken=7f709c5b713576e1'. Perhaps it doesn't exist in the Mono for Android profile?

File name: 'Microsoft.Scripting.dll'

   at Monodroid.Tuner.MonoDroidResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)

   at Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(List`1 assemblies, AssemblyDefinition assembly)

   at Xamarin.Android.Tasks.ResolveAssemblies.Execute() (IPYScripter)

If Xamarin.Android has Iron Python support, how do I go about implementing it? The goal for my app is for the user to be able to create and run IPY scripts.

1
Assemblies built against Mono for Android are not compatible with Xamarin.Android because of changes to assembly strong names: forums.xamarin.com/discussion/1476/… - Cheesebaron
On top of that, IronPython's Android support is very experimental. It needs quite a bit of work to be really useful. - Jeff Hardy
@Cheesebaron Okay, so that implies that I should be able to build IronPython against the Xamarin.Android binaries, right? I tried that, but I've never really built such a complex project before. Any tips/directions for doing that? - msm8bball
@JeffHardy Can you clarify further what you mean? It appears Xamarin.Android has pretty good DLR support. So therefore IPY shouldn't be too hard I would think. - msm8bball
It compiles, and you can run a very simple app with it, but beyond that I haven't tested. It isn't so much the DLR support as it is everything else. If you want more detailed help, ask on the IronPython mailing list - these text boxes are too small. :) - Jeff Hardy

1 Answers

2
votes

Assemblies built against Mono for Android are not compatible with Xamarin.Android because of changes to assembly strong names:

https://forums.xamarin.com/discussion/1476/

On top of that, IronPython's Android support is very experimental. It needs quite a bit of work to be really useful. It compiles, and you can run a very simple app with it, but beyond that I haven't tested. It isn't so much the DLR support as it is everything else. If you want more detailed help, ask on the IronPython mailing list - these text boxes are too small. :)

First paragraph from : Cheesebaron

Second paragraph from : Jeff Hardy