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
Related
I need to set the target SDK version of an Android project to API 14. But I do not have the same version available to compile the project. I know that the project can be compiled with a different version but I need to know whether it will cause any issue.
I received the error "Android manifest file is missing" even though it exists. When I cleaned and then built the project it was compiled but the application crashed. What am I doing wrong here?
These were my settings.
There should be no issues introduced when compiling with a higher version, it is even encouraged to do so. You can find more on that topic in this Medium article.
I would also like to bring your attention to the following blog, which contains some important information regarding SDK targeting in the near future.
Unfortunately I do not use Eclipse so I fear cannot provide any verified insight on that matter. However the suggestions I have found so far include:
Cleaning the project
Getting rid of characters such as ö,ë, etc.
Deleting the file and recreating it
The manifest issue was probably due to creating a project with the same name over and over again. However clean -> build the project helped me get rid of it.
Yeah. Android compile version can be higher than the target version.
Android compile version and target version do not have to be the same.
compileSdkVersion
The compileSdkVersion is the version of the API the app is compiled against. This means you can use Android API features included in that version of the API (as well as all previous versions, obviously). If you try and use API 16 features but set compileSdkVersion to 15, you will get a compilation error. If you set compileSdkVersion to 16 you can still run the app on a API 15 device as long as your app's execution paths do not attempt to invoke any APIs specific to API 16.
targetSdkVersion
The targetSdkVersion has nothing to do with how your app is compiled or what APIs you can utilize. The targetSdkVersion is supposed to indicate that you have tested your app on (presumably up to and including) the version you specify. This is more like a certification or sign off you are giving the Android OS as a hint to how it should handle your app in terms of OS features.
As for the manifest error, you could try (if you are using android studio) clicking File > Invalidate Caches / Restart or force a gradle sync
Thank you for your answers.
I think the manifest issue was due to creating a project with the same name over and over again. However clean -> build the project helped me get rid of it.
Yeah. Android compile version can be higher than the target version. Those two do not have to be the same.
I use the following play services library in my android project. play-services-location,play-services-auth and play-services-gcm. The library are in version 9.2.0.I have the minSdkVersion as 9.
I recently added the VerifyApps API into the project and in order to use that library properly I had to add a new dependency com.google.android.gms:play-services-safetynet:11.6.0. When I added it, android studio asked to enter some class paths in myAndroidManifest file or else I had to improve my minSdkVersion to 14. After adding it some of the functionalities provided by the authAPI started acting up throwing some runtime exceptions in devices running Android 5.0 and above.
I upgraded my Auth and GCM API to version 11.6.0. Android studio again asked me to enter some more class paths in AndroidManifest file. After this the app is working fine but I came across this doc. According to this doc if I am using a play-service version greater than 10.2, my app will not work on devices below 4.0 (Correct me if I am wrong, But a careful look at the wordings lead me to believe that only the support is stopped but existing API calls will work just fine). But I am not using the full play-service dependency in my project I am just the aforementioned 4 libraries, so by adding the suggested entries in the AndroidManifest files should let my app to work just fine in devices below version 4.0 right?
If the functionalities are not fully supported then, is there a list of functionalities that will be affected by upgrading to this version?
You can create a special flavor for older platforms, and use it with an older version of gms. You will deploy the two flavors as split APKs to Play Store.
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.
I have older version of the android studio and I am happy from that. I think in newer version of the android studio, the proguard has been updated also.
Now, I want to have the updated version of proguard in my android studio. Is it possible?
You could download a zip distribution of a newer Android release and replace files manually. However this might not work at all because of incompabilities.
I recommend you to update to the latest Version. It has improved a lot since 1.0, but it hasn't changed much (instead added) so you will be able to use it without problems. To use the newer proguard you just have to change one line per gradle script once, which is really no big deal.
Android SDK Manager does not have different proguard feature available as they have like Android support library , Android support reposatory , Google play services and many more but not proguard.
so according to me it is not possible to update only proguard in android studio.
I want to create a Java library like SLF4J which can run since certain Android version (e.g. Froyo/2.2).
The thing is, I can't be sure if some methods I use are already available on that Android version. For example, "String".isEmpty() is not available in Froyo. How should I know this, unless I create the library project as Android Library project?
Making the project as an Android library project is not easy to test. Robolectric is also tricky with Gradle.
I'm expecting something like simple Java Maven project which uses subset of Java API available in certain Android version. Is it possible? Like, I create a new SLF4J library without involving non-existent methods in Android.
Thanks
It's possible that there are differences between the Android SDK and other Java APIs, so if you build and test your code as anything other than an Android library, you may miss problems. For example, just the other day I found a bug in API 19 (Android 4.4) where DecimalFormat produces BigDecimals differently than it does in J2SE SDKs.
But if you must do this, the easiest way is probably to create it as an Android library project and build it against the Froyo SDK to ensure all the methods are available. Then take the same code and create different build files to build it for your preferred test framework.