1
votes

I downloaded the MonoDroid development environment. If I create a new 'Mono for Android Application' project or if I import a sample project in MonoDevelop, I get emediately the two following error messages popping up in the message log (and can't build/run the project):

Error - 16:49:38 - Error running resgen
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. 
   at System.Convert.FromBase64String(String s)
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.GetProjectBuilder(TargetRuntime runtime, String toolsVersion, String file)
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.GetProjectBuilder()
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.RunTarget(IProgressMonitor monitor, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.SolutionItem.OnRunTarget(IProgressMonitor monitor, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.SolutionEntityItem.OnRunTarget(IProgressMonitor monitor, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.DefaultProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.ProjectServiceExtension.RunTarget(IProgressMonitor monitor, IBuildTarget item, String target, ConfigurationSelector configuration)
   at MonoDevelop.Projects.SolutionItem.RunTarget(IProgressMonitor monitor, String target, ConfigurationSelector configuration)
   at MonoDevelop.MonoDroid.MonoDroidProject.<RunResgen>b__13(Object )

Error - 16:49:38 - Parser database for project 'MonoA3 could not be loaded
System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or a non-white space character among the padding characters. 
   at System.Convert.FromBase64String(String s)
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectService.GetProjectBuilder(TargetRuntime runtime, String toolsVersion, String file)
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.GetProjectBuilder()
   at MonoDevelop.Projects.Formats.MSBuild.MSBuildProjectHandler.<MonoDevelop.Projects.Extensions.IAssemblyReferenceHandler.GetAssemblyReferences>d__2.MoveNext()
   at MonoDevelop.Projects.DotNetProject.<GetReferencedAssemblies>d__f.MoveNext()
   at MonoDevelop.Projects.Dom.Serialization.ProjectCodeCompletionDatabase.UpdateFromProject()
   at MonoDevelop.Projects.Dom.Serialization.ProjectCodeCompletionDatabase..ctor(Project project, ParserDatabase pdb)
   at MonoDevelop.Projects.Dom.Serialization.ParserDatabase.LoadProjectDom(Project project)
   at MonoDevelop.Projects.Dom.Parser.ProjectDomService.Load(Project project)

I deinstalled and reinstalled MonoDevelop (V2.8.8.4, automatically installed in German version) and MonoDroid (4.0.6) several times, but still get the same error message (OS is Win 7 Sp1). In a VM (Win Vista, English version) I could get it run. My problem is, that I can't see the String that causes the problem. The block of code that causes this exception I found here:

Process p = null;
try {
    p = runtime.ExecuteAssembly (pinfo);
    p.StandardInput.WriteLine (Process.GetCurrentProcess ().Id.ToString ());
    string sref = p.StandardError.ReadLine ();
    byte[] data = Convert.FromBase64String (sref);
    MemoryStream ms = new MemoryStream (data);
    BinaryFormatter bf = new BinaryFormatter ();
    builder = new RemoteBuildEngine (p, (IBuildEngine) bf.Deserialize (ms));
} catch {
    if (p != null) {
        try {
            p.Kill ();
        } catch { }
    }
    throw;
}

With TargetRuntime runtime, ProcessStartInfo pinfo. It looks as the Process returns a StandardError that is not a correct Base64 String. How can I access the StandardError output of this Process? I come from the Java-World, I am quite new to Mono/.NET.

1
Why do you think that p.StandardError.ReadLine() returns a base64 string?Steve
The routine wants to decode it from Base64, that's what Convert.FromBase64String() does, according to the documentation. So apparently it expects a Base64 String?CodeOrion

1 Answers

0
votes

I'm just investigating this bug now. Just to confirm, you're saying that it works fine on the English version of Windows Vista but an exception is thrown if you use the German version of Windows 7? I will test on an english version of Windows 7 using the same software versions you have to see if I can trigger the same issue.