Build Failed. MonoDroid does not support running the previous version - visual-studio-2012

This is my first Xamarin android project with MVVMCross.
Started from scratch.
The project builds without any errors but when i try to debug it, i get a build failed: MonoDroid does not support running the previous version. Please ensure your solution builds before running or debugging it.
Build output says:
1>------ Deploy started: Project: Mobile.Droid, Configuration: Debug Any CPU ------
1>Error: The operation could not be completed ==========
Deploy: 0 succeeded, 1 failed, 0 skipped ==========
Ide.log: ERROR [2014-02-05 16:08:08Z]: Could not update jumplists System.InvalidOperationException: The file type is not registered with this application. at Microsoft.WindowsAPICodePack.Taskbar.JumpList.AppendCustomCategories() at Microsoft.WindowsAPICodePack.Taskbar.JumpList.Refresh() at MonoDevelop.Platform.JumpList.UpdateJumpList() at MonoDevelop.Platform.JumpList.OnUpdateTimerEllapsed(Object sender, EventArgs args)
I'm using Visual Studio 2012 (Update 4)
Windows 8
Xamarin Studio 4.2.2
Xamarin.Android 4.10.02014
Please help me cause i already spent a day trying to solve this issue.

Found the problem, i needed to set my startup project to the android app.
I could slap myself, i didn't pay attention to it cause for WP8 it's not needed.
Took me a day and half to solve this :-(
Once again this proofs that error messages are not always clear in what they mean or say.

The reason may be that you not launched any virtual devises for running or debugind your app.
Please check does you able to choose some AVD at your Start button.
In next example I have two runed android emulators: MonoForAndroid_API_10 and MonoForAndroid_API_12:
If you have not, do next steps:
Open Android Emulator Manager:
Choose device and press Start. Look at API level you selected. It is important. I recomend to select level not less than 11. Level 10 or lower may gives you error in deployment.
Launch the devise. Now you are able to start your app in Run or Debug mode.

You may have quit the emulator during the build process.
First off, this error means that there was an error somewhere in the build / deploy process. This can be for a variety of reasons (see other responses on this topic).
Another common cause of this error is simply that you exited the Android Emulator too soon.
The Android Emulator that is included with the Android SDK takes a long time to load (esp. the first time you use it). If you exit out of the emulator before it loads, you will get this error. (For some people on older machines, the emulator loading process can take up to 15 minutes)
When you click run in VS, the emulator should open. When it opens, it will have a blank black screen. If you look in the output menu in VS it will say "Waiting for device". Sometimes this seems to be the final state of the emulator while in fact it is still loading.
If your emulator is unresponsive, look at the Output > Build window and see if it says "Waiting for Device".
If it does (or has a message that is consistent with the log of a successful build below), in 2 to 15 minutes, the android home screen should come up. Then, in another 2 to 10 minutes, the app should launch.
Here is the log of a successful build/deploy of a Xamarin "Blank Android" project in Visual Studio.
1>Starting emulator: Xamarin_Android_API_15
1>Emulator is running: Xamarin_Android_API_15
1>Packaging application..
1>Build started.
1>C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;__XAMARIN_ANDROID_v1_0__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__;__ANDROID_19__;__ANDROID_20__;__ANDROID_21__ /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v5.0\Mono.Android.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\App9.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /target:library /utf8output MainActivity.cs Resources\Resource.Designer.cs Properties\AssemblyInfo.cs "C:\Users\user\AppData\Local\Temp\MonoAndroid,Version=v5.0.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
1>App9 -> c:\users\user\documents\visual studio 14\Projects\App9\App9\bin\Debug\App9.dll
1> Processing: obj\Debug\res\layout\main.xml
1> Processing: obj\Debug\res\values\strings.xml
1>C:\Program Files (x86)\Java\jdk1.6.0_39\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "C:\Users\user\AppData\Local\Xamarin\Mono for Android\debug.keystore"
1>C:\Program Files (x86)\Java\jdk1.6.0_39\\bin\jarsigner.exe -keystore "C:\Users\user\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\App9.App9-Signed-Unaligned.apk "c:\users\ user\documents\visual studio 14\Projects\App9\App9\obj\Debug\android\bin\App9.App9.apk" androiddebugkey
1>C:\Users\ user\AppData\Local\Android\android-sdk\build-tools\23.0.0\zipalign.exe 4 "c:\users\user\documents\visual studio 14\Projects\App9\App9\bin\Debug\App9.App9-Signed-Unaligned.apk" "bin\Debug\\App9.App9-Signed.apk"
1>Build succeeded.
1>Waiting for device..
1>Detecting installed packages
1>Detecting installed packages...
1>
1>Installing shared runtime
1>Target device is armeabi-v7a.
1>Installing the Mono shared runtime (armeabi-v7a - 1441837293)...
1>
1>Installing platform framework
1>Installing the API 21 platform framework..
1>
1>Installing application on device
1>Copying application to device...
1>
1>Getting installation path...
1>Using fast dev path: /mnt/sdcard/Android/data/App9.App9/files/.__override__
1>Synchronizing assemblies...
1>Synchronizing assemblies
1>
====

The "previous version" error apparently just means that there was a build error - see http://forums.xamarin.com/discussion/3410/monodroid-problem
For the jumplist problem the only links i could find were about an old version of Xamarin.Android - see Xamarin 4.0.13 Layout Renderer failed
Both of these issues seem to be related to your xamarin install. If the continue, perhaps your customer support contact in xamarin can assist.

I had the same issue. When I click on AVD button from Visual Studio, nothing happens. So, I opened Android Studio and from there I was able to open AVD manager and started Emulator. Then I was able to Run the application from Visual Studio without any issues.

Delete the /bin and /obj folders in your Android and shared projects then try again.

I had the same problem. Apparently I deployed a release version to the device and then was attempting to deploy using debug after. After uninstalling the version on the device the deployment under debug worked fine.

I had 2 deployable projects in my solution (a unit test project and an application project).
I couldn't run the unit test project even though it was marked as startup project and it was set for deployment in configuration manager.
I solved it by setting the application project as not to be deployed in configuration manager.

I find a solution!!
Same problem:"Build Failed. MonoDroid does not support running the previous version" on VS15.
I was on VS15, then i moved to Xamarin IDE, building and debugging: appears an error about the memory in my device (Samsung Galaxy Ace), so i uninstall some applications.
it had 405MB for available space before deploying
I run in Xamarin IDE and the application runs
I check my phone memory and the application installed use more than 100MB
Then i try on Visual Studio again, all OK.
Images of my app: http://1drv.ms/1PRZwV8

So I had a problem very similar to this, I was getting the error:
"Build Failed: Xamarin.Android does not support running the previous version. Please ensure your solution builds before running or debugging it."
After a few hours of trying different things and after a lot of frustration I managed to fix this and just want to share my solution.
All I did was:
- Next to the "Debug" option on Visual Studio I had the option "Any CPU";
- I clicked this option and then chose "Configuration Manager";
- I found my project name and next to it I saw "Debug" and "Any CPU";
- I clicked the "Any CPU" option opening the dropdown list;
- Chose "New..." and added the option x86 to the list;
- Then I used Debug with the option x86 active and everything went fine.
I hope this helps!
Cheers,
Ruben

Related

Android studio is giving the following error when I am trying to build a ionic project "Gradle sync failed: Sync failed: reason unknown"

I am trying to build a ionic project in Android studio on Ubuntu 20.04 . I am using the command ionic capacitor build then android studio opens up as expected then it shows this error Gradle sync failed: Sync failed: reason unknown. I am unable find a solution for this particular gradle sync error. I have reinstalled Ubuntu and other things but still the problem persists.
In my case, a fresh install of Android Studio resulted in Android 31 being the only SDK available but the project was targeting Android 30. I went to Tools > SDK Manager and made sure the appropriate version of Android SDK was installed and available. After restarting, and allowing the gradle sync to complete I was able to build/run the app on a virtual device, etc.
Here is what I found
This is the screenshot thanks for helping.
Capacitor lets you manage your own Android project. Like any IDE-backed project, sometimes things get so out of sync that the only solution is to rebuild the project.
To do this, follow these steps:
Copy any source code you created (such as Java files in app/android/src, manifest files, or resource files) into a safe location outside of app/android.
Next, make sure you are running an updated version of the Capacitor CLI:
npm install #capacitor/cli#latest
Remove the android directory:
rm -rf android/
Re-create the Android app from Capacitor:
npx cap add android
Copy your saved source files back into the project.
Check the error log. You should find something like "Module: 'mobile' platform 'android-30' not found" or something similar. Click Tools > SDK Manager and download the appropriate Android SDK Platform package.
on top right you will see option to view log file upon clicking there you will redirect to file manager and open idea file there
example :
open idea file and scroll down you will see actual issue.
In my case android sdk 31 was not installed.
I installed android sdk 31 from File>Settings>Apprearance and behaviour>system settings>android sdk and install required android sdk and rebuild the project.
accord to my observation in most cases you get this error because you have not required sdk installed in your system.

How do I run/build my app from Android Studio 4.1 64 bit Windows 10 laptop to Android 3.6 42 bit Windows 7 laptop

I've run into a problem. My previous laptop Acer Aspire R7 Windows 10 64 bit laptop crashed. This was the only laptop I had until I was given another one, but it's a Windows 7 32 bit Samsung. Anyway I was able to install an older version of Android Studio, but I've now run into problems. When I try to open my app that I created from the previous laptop it keeps telling me
"Gradle project sync failed". Basic functionality(e.g editing and debugging) will not work properly" and it says "Kotlin not configured".
There's nothing wrong with my code, so that's all I can say is the problem. I don't know what to do now, because this is app was how I made my income and now I can't work on it.
UPDATE
So I've made a bit more progress now, but i still have problems.
This is what my log shows when I try to clean or rebuild my project
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the User Manual chapter on the daemon at https://docs.gradle.org/6.1.1/userguide/gradle_daemon.html
Process command line: C:\Users\Rodney SA\Downloads\android-studio-ide-192.6241897-windows32\android-studio\jre\bin\java.exe -Xmx2048m -Dfile.encoding=windows-1252 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\Rodney SA\.gradle\wrapper\dists\gradle-6.1.1-all\cfmwm155h49vnt3hynmlrsdst\gradle-6.1.1\lib\gradle-launcher-6.1.1.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 6.1.1
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap
-----------------------
Check the JVM arguments defined for the gradle process in:
- gradle.properties in project root directory
“Gradle sync failed” is a very common error in Android studio.
It happens generally when your project is lacking some files which need to be downloaded.
First go to File>Setting>search Gradle keyword and uncheck offline work
Make sure you have enough high speed data
Goto Tools>Android>Sync Projects Gradle Files
It will automatically download the necessary file.
Android studio is a very data consuming IDE you will have to face frequent updates.

Visual Studio Doesn't Create Xamarin Bin Folder

I'm trying to build an iPad project from Visual Studio 2017 for windows, However whenever I try to debug the app I get this error
Launch failed. The app 'B2C.iPad' could not be launched on 'iPad Air
iOS 11.0'. Error: error MT0069: The app directory
'/Users/user/Library/Caches/Xamarin/mtbs/builds/B2C.iPad/acb039527d504c900b2e6c86d8d84d09/bin/iPhoneSimulator/Debug/MobiBusiness.app'
does not exist. . Please check the logs for more details.
I noticed that visual studio doesn't create bin folder on the Mac machine although it indicates the build is succeeded.
I tried building the solution without debugging and looked at the log file nothing looked suspicious and there was no error.
does anyone know what might cause this error?
Okay this is embarrassing apparently the iPad project wasn't not selected in the build configuration, so needed to select the projects from build --> Configuration Manager

error cannot open file 'kernel32.lib'

I have installed VS2013 and VS2015 on Windows 7.
I have an existing C++ Dll project that was building fine but now all of a sudden it wont build using VS2015 and gives me the error:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
From this post: fatal error LNK1104: cannot open file 'kernel32.lib' I went looking for the kernel32.lib file and it is located here:
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
When I go to my Projects Properties-->Linker-->Input and select Macros I see that this path is indeed there:
My Platform Toolset is set to Visual Studio 2013 - Windows XP (v120_xp) which is what it always has been set to.
Why has my Project all of a sudden stopped building? What could have gone wrong?
I had this similar problem today with Visual Studio 2013 when I changed my VC++ Directories:
Project->Properties->VC++ Directories:
Include Directories
If the cause is some plug-in/extension that changes your props files, it may in consequence change the "Visual C++ Directories" settings of your project.
So, the solution that worked for me is described on my own answer Can't compile 64 bits Visual Studio 2010 projects, which I fully transcribe to here:
After I asked a colleague for help, we noticed, that even getting
clean builds of the projects from TFS, with overwrite option, the
Project's Configuration Properties > VC++ Directories on my computer
were always different from other computers.
Searching more we found the solution on the last post of Reset
include/lib path, which I will fully transcribe:
use "del %HOMEPATH%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
is not always the right way.
Better use "del %USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
where the application data folder is normally placed in.
Then I've looked inside the contents of Microsoft.Cpp.x64.user.props
and I've seen that there were things added by Visual Leaks Detector.
Which is reasonable, as one month before, I did a memory leak analysis
using VLD.
So, I deleted the file and now everything compiles fine at 64bits!
I had to install the Visual C++ for Desktop Development.
Open Visual Studio Installer and go to Installed tab. Click on the Change Button on your installed Visual Studio Community Edition. -> On the Workloads Tab there should be a option Desktop Development with C++. Activate that option and modify the changes.
Afterwards it was working for me.
I had the same problem today. As it turned out somehow the SDK 10.0.15063.0 got installed on my system but without the Desktop C++ files. Selecting the SDK in the list of installed programs, doing a change install and there selecting the Desktop C++ options added the necessary files and now I can link again.
I got this error fatal error lnk1104: cannot open file 'kernel32.lib'.
this error is getting because there is no path in VC++ directories.
To solve this probelem
open visual studio 2008
go to Tools-options-Projects and Solutions-VC++ directories-*
then at right corner select Library files
here you need to add path of kernel132.lib
In my case It is C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
Thank you.
I had this following upgrade of some projects from VS2013 to VS2017.
Original project had a manual modification to the "Library Directories" item under VC++ Directories in the project settings.
This meant it did not pick up changes from the upgrade.
Using the option will reset this to something that works (assuming the SDK is installed OK) provided anything other than the default is not needed of course. In my case it was trying to point at the v7.1 SDK but that was not installed for vs2017.
in vs 2019, just run the installer, click modify, and then in the individual components tab, remove windows 10 SDK. then again run the installer and add windows 10 sdk!
I had this similar problem today with Visual Studio 2017. My cause turned out to be a bad environment setting in NETFXSDKDir, specifically:
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1
It needed to have a value of:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x86
I have a more detailed response here:
fatal error LNK1104: cannot open file 'kernel32.lib'
In VS 2022 I was trying to compile an old solution that originally ran in VS 2010 then in VS 2019. It continually gave me the "cannot find Kernel32.lib" error. I spent 8 hours trying everything, including everything on this page. What worked for me: Configuration Properties -> VC++ Directories -> Library Directories and "inherit from parent" (guessing this sets to defaults) fixed this for me. Also note: I'm using winsock and directinput.

Android Studio 2 error :app:compileDebugJavaWithJack

This is the complete error from Android Studio 2.1.1. I know this code compiles because on other PC it does, just not on this one which has Windows 10 x64. All other projects fail with similar result.
Error:Execution failed for task ':app:compileDebugJavaWithJack'.
> java.lang.RuntimeException: java.lang.AssertionError: com.android.jack.library.LibraryIOException: I/O error when accessing file 'I:\Android\KeepVidDownloader\Android\app\build\intermediates\packaged\debug\classes.zip': Failed to delete directory 'C:\Users\BCDIAC~1\AppData\Local\Temp\vfs-1464787788985-0'
For Build -> Clean Project I have used the solution from here https://stackoverflow.com/a/32924320/1958032
I think that there could be a similar solution for running/making the app.
How to solve this?
This issue is a conflict between antivirus and Android Studio.
In my case using Avira, Windows 10 and Android Studio 2.2.
I just disabled Avira for the first build and enabled it again when build was complete.
No need to do this every time- only at the first build.
I had a similar problem and solved it by File->Invalidate Caches and Restart.

Resources