我試圖將Android Studio中的Android應用程序移植到Visual Studio 2015/Xamarin。我嘗試運行該項目,並獲得:在'RequiresPermission'類型中找不到註釋方法'anyOf()':
Android application is debugging.
The application could not be started. Ensure that the application has been installed to the target device and has a launchable activity (MainLauncher = true).
Additionally, check Build->Configuration Manager to ensure this project is set to Deploy for this configuration.
我加[Activity(MainLauncher = true)]
到主類,並檢查Build->Configuration
這似乎是正確的,但這些都沒有影響。
我得到這樣的警告:
Cannot find annotation method 'anyOf()' in type 'RequiresPermission':
class file for android.support.annotation.RequiresPermission not found
MyApplication.Native.Droid C:\Users\allelopath\AppData\Local\Xamarin\GooglePlayServices.Maps\8.4.0\embedded\classes.jar(com/google/android/gms/maps/GoogleMap.class)
我也得到這樣的警告:
Warning
Found conflicts between different versions of the same dependent assembly.
In Visual Studio, double-click this warning (or select it and press Enter) to fix the conflicts;
otherwise, add the following binding redirects to the "runtime" node in the application configuration file:
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly><assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" /></dependentAssembly></assemblyBinding>
Acquaint.Native.Droid
我雙擊因爲它表明,它問:
Do you want to fix these conflicts by adding binding redirrect records in the application configuration file?
我單擊是。這最終沒有效果,重建並嘗試運行後,警告再次出現。
我解鎖了設備上的應用程序,該應用程序曾在Android Studio上運行過,但這也沒有影響。
你能提出什麼建議?