Xamarin Android project fails running (System.Runtime.Loader assembly is not loading)












0















I'm developing an app with my team with Xamarin in VS2017. Problem is.. one of our machine suddenly stopped building the project. Whenever i try to deploy the app in my phone. it gives an error such like below:



 Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: 
C:Users
<username>.nugetpackagessystem.runtime.loader4.3.0libMonoAndroid10_._ ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImage(Disposable`1 stream, String file_name)
at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
at Xamarin.Android.Tasks.ResolveAssemblies.ResolveRuntimeAssemblyForReferenceAssembly(LockFile lockFile, DirectoryAssemblyResolver resolver, String assemblyPath)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)


I don't know what this 0KB file (MonoAndroid10_._) does special but it comes highlited each time i try to build the project.



When i look at the BUILD OUTPUT LOG.. It shows System.Runtime.Loader assembly is not being loaded:



 D/Mono    ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 5829): This might be due to an invalid debug installation.
F/monodroid-assembly( 5829): A common cause is to 'adb install' the app directly instead of doing from the IDE.


I'm guessing the nuget package issue primarily, as recently I've updated Xamarin Android version to latest from 3.1 and it ran smoothly in other two PCS except one.



This is something I've experienced before in my PC. but eventually it got resolved anyhow.. Now, in other PC the same error is not being resolved.



P.S. I'm using Mi Note 3 to test the app.










share|improve this question























  • use old packages.config in your app, not the new style to add nuget packages

    – magicandre1981
    Nov 24 '18 at 7:36











  • can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

    – Mayur Paghdal
    Nov 24 '18 at 9:38






  • 1





    "C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

    – magicandre1981
    Nov 25 '18 at 15:45











  • this helped a lot.. Thanks man!

    – Mayur Paghdal
    Nov 26 '18 at 14:37











  • so does it work when you use the old packages.config?

    – magicandre1981
    Nov 26 '18 at 16:01
















0















I'm developing an app with my team with Xamarin in VS2017. Problem is.. one of our machine suddenly stopped building the project. Whenever i try to deploy the app in my phone. it gives an error such like below:



 Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: 
C:Users
<username>.nugetpackagessystem.runtime.loader4.3.0libMonoAndroid10_._ ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImage(Disposable`1 stream, String file_name)
at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
at Xamarin.Android.Tasks.ResolveAssemblies.ResolveRuntimeAssemblyForReferenceAssembly(LockFile lockFile, DirectoryAssemblyResolver resolver, String assemblyPath)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)


I don't know what this 0KB file (MonoAndroid10_._) does special but it comes highlited each time i try to build the project.



When i look at the BUILD OUTPUT LOG.. It shows System.Runtime.Loader assembly is not being loaded:



 D/Mono    ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 5829): This might be due to an invalid debug installation.
F/monodroid-assembly( 5829): A common cause is to 'adb install' the app directly instead of doing from the IDE.


I'm guessing the nuget package issue primarily, as recently I've updated Xamarin Android version to latest from 3.1 and it ran smoothly in other two PCS except one.



This is something I've experienced before in my PC. but eventually it got resolved anyhow.. Now, in other PC the same error is not being resolved.



P.S. I'm using Mi Note 3 to test the app.










share|improve this question























  • use old packages.config in your app, not the new style to add nuget packages

    – magicandre1981
    Nov 24 '18 at 7:36











  • can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

    – Mayur Paghdal
    Nov 24 '18 at 9:38






  • 1





    "C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

    – magicandre1981
    Nov 25 '18 at 15:45











  • this helped a lot.. Thanks man!

    – Mayur Paghdal
    Nov 26 '18 at 14:37











  • so does it work when you use the old packages.config?

    – magicandre1981
    Nov 26 '18 at 16:01














0












0








0








I'm developing an app with my team with Xamarin in VS2017. Problem is.. one of our machine suddenly stopped building the project. Whenever i try to deploy the app in my phone. it gives an error such like below:



 Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: 
C:Users
<username>.nugetpackagessystem.runtime.loader4.3.0libMonoAndroid10_._ ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImage(Disposable`1 stream, String file_name)
at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
at Xamarin.Android.Tasks.ResolveAssemblies.ResolveRuntimeAssemblyForReferenceAssembly(LockFile lockFile, DirectoryAssemblyResolver resolver, String assemblyPath)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)


I don't know what this 0KB file (MonoAndroid10_._) does special but it comes highlited each time i try to build the project.



When i look at the BUILD OUTPUT LOG.. It shows System.Runtime.Loader assembly is not being loaded:



 D/Mono    ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 5829): This might be due to an invalid debug installation.
F/monodroid-assembly( 5829): A common cause is to 'adb install' the app directly instead of doing from the IDE.


I'm guessing the nuget package issue primarily, as recently I've updated Xamarin Android version to latest from 3.1 and it ran smoothly in other two PCS except one.



This is something I've experienced before in my PC. but eventually it got resolved anyhow.. Now, in other PC the same error is not being resolved.



P.S. I'm using Mi Note 3 to test the app.










share|improve this question














I'm developing an app with my team with Xamarin in VS2017. Problem is.. one of our machine suddenly stopped building the project. Whenever i try to deploy the app in my phone. it gives an error such like below:



 Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: 
C:Users
<username>.nugetpackagessystem.runtime.loader4.3.0libMonoAndroid10_._ ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage()
at Mono.Cecil.PE.ImageReader.ReadImage(Disposable`1 stream, String file_name)
at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters)
at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters)
at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
--- End of inner exception stack trace ---
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load(String fileName, Boolean forceLoad)
at Xamarin.Android.Tasks.ResolveAssemblies.ResolveRuntimeAssemblyForReferenceAssembly(LockFile lockFile, DirectoryAssemblyResolver resolver, String assemblyPath)
at Xamarin.Android.Tasks.ResolveAssemblies.Execute(DirectoryAssemblyResolver resolver)


I don't know what this 0KB file (MonoAndroid10_._) does special but it comes highlited each time i try to build the project.



When i look at the BUILD OUTPUT LOG.. It shows System.Runtime.Loader assembly is not being loaded:



 D/Mono    ( 5829): Assembly Loader probing location: 'System.Runtime.Loader'.
F/monodroid-assembly( 5829): Could not load assembly 'System.Runtime.Loader' during startup registration.
F/monodroid-assembly( 5829): This might be due to an invalid debug installation.
F/monodroid-assembly( 5829): A common cause is to 'adb install' the app directly instead of doing from the IDE.


I'm guessing the nuget package issue primarily, as recently I've updated Xamarin Android version to latest from 3.1 and it ran smoothly in other two PCS except one.



This is something I've experienced before in my PC. but eventually it got resolved anyhow.. Now, in other PC the same error is not being resolved.



P.S. I'm using Mi Note 3 to test the app.







android visual-studio xamarin xamarin.android nuget-package






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 24 '18 at 6:26









Mayur PaghdalMayur Paghdal

1311110




1311110













  • use old packages.config in your app, not the new style to add nuget packages

    – magicandre1981
    Nov 24 '18 at 7:36











  • can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

    – Mayur Paghdal
    Nov 24 '18 at 9:38






  • 1





    "C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

    – magicandre1981
    Nov 25 '18 at 15:45











  • this helped a lot.. Thanks man!

    – Mayur Paghdal
    Nov 26 '18 at 14:37











  • so does it work when you use the old packages.config?

    – magicandre1981
    Nov 26 '18 at 16:01



















  • use old packages.config in your app, not the new style to add nuget packages

    – magicandre1981
    Nov 24 '18 at 7:36











  • can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

    – Mayur Paghdal
    Nov 24 '18 at 9:38






  • 1





    "C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

    – magicandre1981
    Nov 25 '18 at 15:45











  • this helped a lot.. Thanks man!

    – Mayur Paghdal
    Nov 26 '18 at 14:37











  • so does it work when you use the old packages.config?

    – magicandre1981
    Nov 26 '18 at 16:01

















use old packages.config in your app, not the new style to add nuget packages

– magicandre1981
Nov 24 '18 at 7:36





use old packages.config in your app, not the new style to add nuget packages

– magicandre1981
Nov 24 '18 at 7:36













can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

– Mayur Paghdal
Nov 24 '18 at 9:38





can you please tell how to do tht (my current setting is selected to packages.config in tools > nuget) and i've face such issue for the first time so don't know this exactly, Thanks

– Mayur Paghdal
Nov 24 '18 at 9:38




1




1





"C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

– magicandre1981
Nov 25 '18 at 15:45





"C:Users<username>.nugetpackages" shows you use the new one and not the packages.config. open the csproj and Remove the "PackageReference Include" entries and install packages again

– magicandre1981
Nov 25 '18 at 15:45













this helped a lot.. Thanks man!

– Mayur Paghdal
Nov 26 '18 at 14:37





this helped a lot.. Thanks man!

– Mayur Paghdal
Nov 26 '18 at 14:37













so does it work when you use the old packages.config?

– magicandre1981
Nov 26 '18 at 16:01





so does it work when you use the old packages.config?

– magicandre1981
Nov 26 '18 at 16:01












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455742%2fxamarin-android-project-fails-running-system-runtime-loader-assembly-is-not-loa%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455742%2fxamarin-android-project-fails-running-system-runtime-loader-assembly-is-not-loa%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen