Error running when adding google services - android

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.

Related

How do you get compile time SDK compatibility warnings from Gradle?

Was recently doing a project and mid-way we had to lower the minimum supported SDK supported in the Android manifest. Some Android API's we use are not compatible the new lower minimum SDK. We only discovered these as run time crashes. Why wouldn't the Gradle and/or the Android IDE pick up these as warnings ? Normally, I see the warnings as I code it, but for code already written, I am not warned during compilation.
I would like to be able to re-compile my project, and get all the API warnings about the minimum supported SDK. I had done some research on Lint, and it testing with it, has not yielded any results beyond warning me about XML style incompatibilities. So, I can't seem to find it for Gradle, and Android IDE is not running through the existing code already written, and raising warnings. Is this possible ? If it is, can someone provide a solution.

MissingMethodException on Unity Based Dependency Resolution in Xamarin Android

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.

Xamarin.Android happens error on Android 7

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.

Android libraries must use the exact same version

Why Am I getting this error in my gradle?
It works fine if I run it,
But I just don't want to get in trouble once I release my application.
As error itself says everything Android libraries must use the exact same version
Use the same version for each support library, you might have used different versions for different support libraries.
compileSdkVersion and support libraries version should be same. otherwise that could be the cause of runtime crash. but it'll still compile your project

Is using Proguard with Android worth the effort?

I am about to finish my first Android application and I am trying to work out how to protect it with ProGuard. My apps minimum API is 7 (Android 2.1). I believe using Proguard would be easy if I set my minimum API to 9 (Android 2.3) but as a lot of devices use 2.1 and 2.2 I don't want to exclude them.
Everything I have read about using Proguard with Android seems confusing and difficult (I dont know anything about Ant scripts) Does anyone know of a step-by-step guide for using Proguard for Android with Eclipse?
Is Proguard even worth bothering with?
ProGuard has nothing to do with the API level of your app. Newer versions of the Eclipse ADT have it integrated, so using it is just a matter of adding a single line to a configuration file, you don't need to use Ant. You might get some problems if ProGurad removes methods/classes you are actually using, and you will have to work around those by tweaking the ProGurad config file.
If you find it difficult to use, you can always launch your app without obfuscating it, and add ProGuard in a later version. If it is your first app, the chances of someone decompiling it to steal your super-secret code are pretty low :)

Categories

Resources