I'm using Xamarin.Android to development application in my project. When I build app on all version bellow Android 7, no problem happens. But when running on Android 7. It happens error: Detected problem with app native libraries (please consult log for detail): libmonosgen-2.0.so: unauthorized access to "/system/lib/libsqlite.so".
How to fix it? Please help me!!!
Many thanks.
Changes have been made in regards to native linking which SQLite unfortunately is affected by as read here.
The the reason your application crashes is due to the fact, that Android Nougat now no longer allows to dynamically linking against non-NDK libraries; something which SQLite did previously. By updating SQLite, the issue should be resolved. Although, do note that other libraries that you use could be affected by this change as well.
You will also have to inspect every PInvoke that you do yourself.
If that's the case, then you also have to option of decreasing the targetSdkVersion in the manifest for your given Android project to 23. Doing so will simply write a warning to the console instead of throwing a runtime error.
Related
On running a Xamarin Android application in debug mode, I am getting the below error:
System.MissingMethodException: bool
System.Collections.Generic.Stack`1.TryPop(!0&)
And it is happening at the below call in the application for the Unity based dependency injection code:
this.Container.Resolve<T>();
There is no more stack trace data is also coming out for this issue.
Surprising thing is that the same project is working fine in VS 2017 (15.7.4) and not in a machine I have with VS 2017 (15.8.8).
Any possible solutions or leads for solving this will be helpful.
UPDATE:
I just downgraded my VS 2017 to 15.7.6 now and I am getting the same error still with that too.
WORK AROUND:
Once I changed targeted Android version of my Xamarin Android csproj in the Application Manifest to 5.1, I am able to get through my app in debug bypassing this issue. But, not sure what exactly solved by that. But, still it does not work in any targeted version above 5.1.
It will be great if a permanent solution can be identified for this issue even in higher Android target versions.
I'm working on a Xamarin Forms app for Android and iOS. We use a third-party SDK that comes as an .aar package, build action set to LibraryProjectZip. Then, we have calls from the forms, the iOS, and the Android parts of the code. Linking works just fine in debug mode if I remember correctly.
I'm failing to get the Linker+ProGuard work together. I've read for days and experimented with numerous solutions. I was having java codes 1 and 2 - so I updated ProGuard and it started working. Then Linking was producing errors - UnauthorizedAccessException so I had to go to the respective folder and remove the ReadOnly permission. Then the project is built successfully but the app functionality is lost even though it runs and in Device Log I can see that some classes are missing.
To fix that, I created a ProGuard.cfg and added most of the assemblies that were crashing with the "-keep" command. However, I can't seem to find a way to preserve the functionality from this .aar package
Any suggestions?
I'm using VS 2017 and Xamarin 7.4 on Windows 10 with JDK 1.8, running as Administrator. Tried linking Sdk Assemblies / User&Sdk Assemblies. Multidex is on. I've tried putting the names of the assemblies of all the projects in the Skip Linking Assemblies field, no results. In the device log, I get a package name for the call that is failing so I tried adding this to ProGuard too but it didn't help. (it looked like "-keep class com.something.something")
I can't comment, but this blog post may be of use.
"The Linker Analyzer is a command line tool that analyzes dependencies which are recorded during the LinkAssemblies step. It will show you what items were marked and resulted in the linked assembly."
https://www.jon-douglas.com/2017/09/22/linker-analyzer/
When adding the following lines to the gradle, at runtime the application does not start, only an error occurs and stops, this happens with android version 4.4 and less, from version 5 up does not occur this error.
multiDexEnabled true;
compile 'com.google.android.gms:play-services:10.0.1'
Could you help me please. Thank you
Just clean your project and run the application again. For reference Check this link.
https://developers.google.com/android/guides/setup
Multidex support was added in API 21. So your devices are probably getting confused because of a command they don't understand. I would suspect that you should be able to see the runtime crash error in the logcat no?
Basically, you are going to have to find a work around for the lower API devices. One approach that people can take is to do the design in newer apis and only push the production version to older devices. The production should get rid of a lot of the function overhead that is compiled specifically for debug purposes.
My app is targeted to run on android 6 which doesn't allow to load shared libraries as I understand.
Have anyone encountered this problem and was able to successfully solve it?
java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.XXX.XXX-2/lib/arm/libiconv.so: has text relocations
Android 6 no longer supports dynamic linking of shared objects. Static linking still works. However, your problem is unrelated to that.
The library is not even loaded because of its text relocations.
This is due to an old bug in the Android NDK, back in 2012. Google believed it to be solved with Lollipop, then ignored user warnings that it wasn't. The bug resurfaced in later NDKs, all API versions >=22 are considered broken. Instead of fixing the issue, apps with text relocations are now simply forbidden to deploy.
First report:
https://code.google.com/p/android/issues/detail?id=23203
To avoid the problem, try compiling your app with API 21. Refer to your IDE documentation on how to target various OS versions.
I have a problem running my android project through eclipse. It gives following error when I try to run it:
trouble processing "javax/net/SocketFactory.class": ... Conversion to
Dalvik format failed with error 1
I am using Android 2.3.1 API level 9. The android.jar that is downloaded from AVD Manager has the javax/net package inside it.
I have searched on this issue and it seems to be the issue related to conversion of classes into Dalvik. But "javax/net/SocketFactory.class" is part of the android.jar. Any suggestions ?
The problem is resolved. I was mistakenly adding two android libraries at a time. One is added by default and other is added via Maven dependency. Removing the android dependency from pom.xml works. But now it is not working on terminal through mvn install command. This is a separate issue now.
As you know android sdk comes complete with java sdk build in. This sdk is light weight and customized for use by the dalvik engine. Now, if we also add java jar’s along with the android app, obviously the android system will have trouble converting that java jar to dalvik. Hence the “conversion to dalvik” issue.
So now that you know what happens, lets figure out why it happens.
In my case it was the barcode, zxing framework that caused the problem. You have to find out what is causing the issue in your setup.