How can I fix a missing mscorelib.dll error that occurs when trying to run a Mono for Android app? - mono

In MonoDevelop when compiling and running an app developed for Android against the simulator, the app compiles then crashes immediately in the simulator with the following application output...
E/mono ( 225): The assembly mscorlib.dll was not found or could not be loaded.
E/mono ( 225): It should have been installed in the `/home/jon/Development/xamarin/mono/BUILD/armeabi/install/lib/mono/2.0/mscorlib.dll' directory.
Keep in mind that I'm not Jon so I don't even know where it's getting the /home/jon path configuration. Though I have found that path in other similar but ultimately unrelated searches on the internet so I imagine it's a path on some other devs machine.
mscorlib.dll is indeed on my machine. located here...
/Developer/MonoTouch/usr/lib/mono/2.1/
and here...
/Developer/MonoAndroid/usr/lib/mono/2.1/
I've tried targetting various Android SDK environments (currently 2.3 and the simulator is currently running under the 2.3 SDK environment as well).
I'm on Mac OSx 10.7.2. Using the latest version of MonoDevelop, Mono and Mono for Android. I've also got the latest MonoTouch installed as well and iPhone apps compile fine if that's worth anything.
The closest thing I can find to a hint at the issue is here...
http://phonicuk.com/Forums/ViewThread.aspx?tid=401
I've tried reinstalling Mono and Mono for Android but admittedly have not tried uninstalling in entirely before a reinstall. I've searched within files for the /home/jon path thinking that it must be a configuration somewhere but haven't been able to find it anywhere.
I found this... Mono return error: mono mscorlib.dll was not found
Along with a few other things that were sort of in the same vein, but ultimately nothing that seems to be a fix.
Any ideas?
Update: From the suggestions in jonp's answer below it indeed seems like the Mono.Android.DebugRuntime package is not installed. So far I've tried a couple of MonoAndroid reinstalls and have tried removing MonoAndroid entirely beforehand. I'm trying to figure out if there is a way to add the package manually, but I'm so new to this.
Another update: Not sure why I didn't try this already, but I created a HelloWorld MonoAndroid app and it works fine. The compilation took a while longer too for that one and I could see if was setting up the required packages, so there has to be an issue with the specific solution.

When you install a Debug build of your app on the device, three .apk files are installed:
Mono.Android.DebugRuntime, which contains libmonosgen-2.0.so, mscorlib.dll, etc.
Mono.Android.Plaltform.ApiLevel_N, which contains Mono.Android.dll for API level N.
Your application.
My guess is that the Mono.Android.DebugRuntime package has not been installed. To check this, run:
adb shell pm list packages | grep Mono.Android
I'm going to guess that it's missing. :-)
Next, why is it missing? When you Run the app within MonoDevelop, all required packages are checked for and installed. It seems rather odd that it wouldn't be. Is your device low on disk space?
adb shell df /data
How are you launching the emulator? If you're launching within MonoDevelop, there should be enough free space to install all of the above packages. However, if you launch it yourself, the default /data size is 64MB, which isn't enough to support a Debug build environment. Please launch the simulator from MonoDevelop and re-Run your app, or launch the emulator so that it has enough free space:
emulator -partition-size 512 -avd YOUR_AVD_NAME

Related

Can't run xctest on macOS app - couldn’t be loaded because it is damaged or missing necessary resources

Please do help me on this scenario. I saw several post related to this, but could not able to resolve the issue with my mac App without pods.
Project is several years old, developed in macOS(Objective C). Now I am trying with XCTest for unit testing. Using Xcode 7.3.1, I am not able to run tests classes.
This project is to create frame work. Project is working fine, only issue is with the testing. We are not supposed to do Pods or some other alternatives.
Console window shows below points:
xctest[35530:345970] The bundle “BaseLibTests” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. xctest[35530:345970]dlopen_preflight(/Users/12345678/Documents/Modify/Cocoa/Projects/BaseLib/build/Debug/BaseLibTests.xctest/Contents/MacOS/BaseLibTests): Library not loaded: #executable_path/../Frameworks/FreeTDS.framework/Versions/A/FreeTDS
Referenced from: /Users/12345678/Documents/Modify/Cocoa/Projects/BaseLib/build/Debug/BaseLib.framework/Versions/Current/BaseLib
Reason: no suitable image found. Did find:
/Library/Frameworks/FreeTDS.framework/Versions/A/FreeTDS: no matching architecture in universal wrapper)
Program ended with exit code: 82
#Anand For the 3rd Point: Please check the build settings.
Please make sure its either set to Standard Architectures (64-bit Intel) (x86_64) - $(ARCHS_STANDARD) or set to represent proper architectures.
To debug this more, could you please copy paste the exact error you are facing and share the build env variables?

Unable to run app on device using android studio

I have been trying to use android studio and every time I deploy an app on a device, it gives me an error saying:
Installation failed since the device possibly has stale dexed jars that don't match the current version (dexopt error).
In order to proceed, you have to uninstall the existing application.
I have tried using Build->Clean Project and yet it seems to do no good.
I have also tried deleting the file from /data/local/tmp on device (as my phone is a rooted one), but, all in vain.
If anyone knows a way out, please, please help.
Uninstall the application from the device.
Check the storage space.
Once Restart the mobile and try to install it

Multiple Xcode Installation

After a fresh install of Lion and Xcode 4.1 from the Mac App Store, I would like to install another version of Xcode alongside.
I heard that this perfectly safe to install it in another directory (considering the first to be on /Developer). The only thing to remember is that running xcodebuild would result in launching the last one installed.
But I have another issue while installing it, even f I changed the directory it clearly says that it will upgrade Xcode Toolset, System Tools and UNIX Development and that they can only be located is /Developer and for one installation per system, here is a screenshot :
So how to have another clean instance of Xcode and SDKs without screwing up the production one ?
Thanks a lot.
It doesn't seem to be possible to install the System Tools on both versions. I've never had success with that.
One thing to note, if you install an older version of xCode side-by-side with the latest version, the "Build Archive" function in the Organizer will not function. The only remedy I found was to remove both xCodes and reinstall the one I wanted to use for building the archive. It was a painful process.
Actually you can do this (or at least I seem to be able to). At times I have had three separate instances of XCode installed - an older XCode 3.x (which I've subsequently gotten rid of), an XCode 4 production, an XCode 5 beta; all in separate directories.
The key thing for me was calling the command line tool to tell which system is the "primary" xcode for the purposes of running xcodebuild, instruments, agvtool and a bunch of others: xcode-select -switch /Developer (just man xcode-select ftw).
So, I have a 4.0.2 build as primary now, and keep upgrading the iOS5 betas. I try them out, but when I want to cut a production build using 4.0.2, I ensure that my system knows that /Developer is current, switching it if I need to. FWIW, there is risk that the single-set-of-System-tools could be broken when you replace them with the latest set, but that's (so far) never hit me.
Also, for reference there is another discussion along similar lines here: Install xCode 3.2.3 w/ iPhone SDK 4, get "Base SDK missing", can't see other SDKs

clang Can't find any frameworks

I've been tearing my hair out over this, and Google hasn't yielded much so my problem must be caused by my own specific brand of stupidity.
Basically, having installed Xcode 4 I removed the /Developer-old folder (properly, can't remember the command but I used the uninstall script rather than sticking it in the trash).
Xcode builds projects fine, and the latest version of all the Objective-C frameworks seem to live in /System/Library/Frameworks, but when I compile something (which built fine in the Xcode 3 days) clang complains that it can't find any headers, e.g:
fatal error: 'Cocoa/Cocoa.h' file not found
I've tried forcing the framework search path with -F to no avail- is there a common underlying issue or have I just screwed my machine?
Reinstall the developer tools. It will take a lot less time than tracking down whatever you broke.

Installing of Adobe Air file fails with "file damaged"

Adobe Air brings following exception:
The application could not be installed because the AIR file is
damaged. Try obtaining a new AIR file from the application author.
Please add the different reasons which may lead to this error.
We had the same error as this guy:
The file ~/.airappinstall contains the following error:
failed while unpackaging: [ErrorEvent type="error" bubbles=false
cancelable=false eventPhase=2 text="invalid package signature"
errorID=5022]
The actual reason was not a damaged file or something like this, but our machine had a date from the past, which was not valid for the given certificate. After correcting the date/time on the computer, the installation worked just fine.
Even I faced the same error=5022, after thinking a lot on this issue, I finally got the
solution for this problem. It is simple, before installing the air app set the correct Date & Time for the system, WALLA it installs smoothly.
No need of changing the png name or anything else.
I faced this problem yesterday because my antivirus (avast pro/silent mode) was blocking access to file until finishing scanning, looks like installer don't like to wait, so when I switched off silent mode I made antivirus ignore scanning the file and installation completed successfully.
I have a virtual drive mapped to S: so that paths are the same between my home computer and work computer. I was trying to install the AIR app from an S: path. I guess it did it like it. Moving app to my desktop and launching there, worked.
Make sure you are signing the Application distributable and distributing the certificate along with the .air file.
I ran into same problems and solved it this way.
I had this issue when using Flash Builder 4, but building a Flex 3 application.
Basically, the installed AIR SDK in the Flex 3 SDK folder was AIR 1.5.3 (if I remember correctly), but the Flex 4 SDK folder had the AIR 2.0 SDK files (I'm not completely what the problem was).
My solution was to download the AIR 2.0 SDK, and unzip it over the Flex 3 SDK folder. Once I did that, the installation file worked fine. There is actually an article on Adobe about overwriting the AIR SDK files this way, although it didn't mention anything about installations or Flash Builder 4.
Mine was failing because I had another app on my system with the same name. Not a version of the app, a completely different app--native, not AIR.
Once I removed that app it worked fine.
For odd installation errors, keep in mind that Chrome uses a version of Flash that does not support AIR badge installation.
I encountered this error when trying to install an AIR file from an external / network drive. Copied the file locally, and installation proceeded normally.