Xamarin - AOT:图像'System.Net.Http.dll.so'未找到

时间:2018-03-01 16:22:28

标签: android xamarin xamarin.android

我有一个.NET标准库,用于我的Xamarin Android应用程序的数据访问层。

我添加了对库的引用,但是当尝试使用System.Net.Http进行Web请求的部分库时,应用程序挂起并得到以下输出。

03-01 16:13:22.914 D/Mono    ( 1874): Image addref 
System.Net.Http[0x7e2f1c7180] -> System.Net.Http.dll[0x7e2f4a2000]: 2
03-01 16:13:22.914 D/Mono    ( 1874): Prepared to set up assembly  
System.Net.Http' (System.Net.Http.dll)
03-01 16:13:22.914 D/Mono    ( 1874): Assembly System.Net.Http[0x7e2f1c7180] 
added to domain RootDomain, ref_count=1
03-01 16:13:22.917 D/Mono    ( 1874): AOT: image 'System.Net.Http.dll.so' 
not found: dlopen failed: library "/data/app/TestRecipeApp.TestRecipeApp-
1/lib/arm64/libaot-System.Net.Http.dll.so" not found
03-01 16:13:22.919 D/Mono    ( 1874): AOT: image '/usr/local/lib/mono/aot-
cache/arm64/System.Net.Http.dll.so' not found: dlopen failed: library 
"/data/app/TestRecipeApp.TestRecipeApp-1/lib/arm64/libaot-
System.Net.Http.dll.so" not found
03-01 16:13:22.920 D/Mono    ( 1874): Config attempting to parse: 
'System.Net.Http.dll.config'.
03-01 16:13:22.920 D/Mono    ( 1874): Config attempting to parse: 
'/usr/local/etc/mono/assemblies/System.Net.Http/System.Net.Http.config'.
03-01 16:13:22.920 D/Mono    ( 1874): Assembly Ref addref 
netstandard[0x7e2f594c00] -> System.Net.Http[0x7e2f1c7180]: 2
03-01 16:13:22.920 D/Mono    ( 1874): Assembly Ref addref 
System.Net.Http[0x7e2f1c7180] -> mscorlib[0x7e46b94000]: 14
Loaded assembly: System.Net.Http.dll [External]

由于这需要一整天的开发时间,而且我仍然没有找到解决方案,所以任何建议都会有很多建议。

在下面调用db.createUser时。该应用程序挂起,并且不会继续进行,直到它最终崩溃。我在控制台应用程序中测试了createUser函数,它工作正常,所以问题似乎不在类库本身。

  class UserPresenter 
   {
     ILoginView loginView;
     DatabaseApi db;
     public UserPresenter(ILoginView view)
    {
        this.loginView = view;
        db = new DatabaseApi();
    }

    public void createUser(string email, string password)
    {

        Android.Util.Log.Error("myError", "In create user");
        bool success = db.createUser(email, password);

        Console.WriteLine("Success: " + success);

    }

  }

干杯。

0 个答案:

没有答案