可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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.
回答1:
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.
回答2:
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.
回答3:
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>
====
回答4:
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.
回答5:
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.
回答6:
Delete the /bin and /obj folders in your Android and shared projects then try again.
回答7:
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.
回答8:
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.
回答9:
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
回答10:
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