I'm currently building an app which has target and source compatibility set to java 1.8, compiledSdkVersion 27, targetSdkVersion 27 and minSdkVersion 16.
Whenever I run my app on newer devices, everything works just fine. But I recently got a hold of old crappy lg device (LG-E430) which has android 4.1.2 (API16) and if I try to run the app on it I get the following error:
java.lang.NoClassDefFoundError: com.sample.app.-$$Lambda$Application$UEhM22H-x38DdLAimT-WuD_uUWc
From android documentation I see that lamdas are supported on all android versions. But exception says otherwise.
How to solve this issue?
See You Have Build Virtual Device On Android Studio And Then Try To Run Your Project I think it will work. If It Still Not Works Then open Build.gradle and sync your project and then Run it then it will work
Related
This is all in the build.gradle for android.
So if I set the minSdkVersion to 13 Android Studio says it's too low, but it seems to be happy if I set it to 14. Is it safe to assume that it will work on sdkVersion 14? Unfortunately I do not have a phone with sdkVersion 14, and I haven't been able to get the emulator working for that version.
My buildToolsVersion is set to 28.0.3
compileSdkVersion is set to 27
targetSdkVersion is set to 27
Also I tried setting up a virtual device of Nexus 4 with API 15 in the android studio AVD manager, but it just has a black screen on the virtual phone and never seems to start up. Anyone had the same problem when trying an emulator with low API ?
As long as you aren't doing any tricky stuff in your Android module, you'll be fine. There are many games released with LibGDX installed on every version of Android. If there were a problem with specific Android versions, it would have turned up in the LibGDX issue tracker.
By tricky stuff, I mean customizing permissions in the manifest, calling Android code by reflection, etc. Things that have behavior changes across different versions of Android. When you target Android SDK 27, all the Android behavior changes in the various versions between minSdkVersion and targetSdkVersion take effect.
OpenGL ES 2.0 is unsupported in old versions of the Android emulator, which is why you get the black screen.
I need to develop a test application for an old Samsung smartphone that has Android 2.3.6
I'm using Android Studio 3.1 and I've installed needed several old SDK from 2.1 to 2.3.3 including google api (that are showed as obsolete in sdk manager)
The problem is that when I create a new project, in the list where I can choose the SDK the lowest API available is 14; it seems that android studio is not showing me obsolete api and I cannot find where to set that I want to see all installed SDK.
Newer versions of Android Studio have minimum API level set to 14. I would suggest you look for android studio 2.3.3 which allows lower level APIs. Download link below:
https://developer.android.com/studio/archive
I face the same error while developing for the API 11. That was minimum of 14. But yes android studio never shows minimum then API 14. This is due to some Appcompat library.
Because when I dug out deeper then I found out that This Library was using minimum of 14 SDK. and due to manifest merging problem I think android studio is not showing minimum then that. At that time I was using 25.+ version of Appcompat library and I was using android studio 3.0.
You can find out more by selecting API 14 and then go into build.gradle file. now here you can change minSdkVersion to 11 or at any api level you want.
Then you can notice that while building you will get manifestMerger error with following proposed solutions
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : uses-sdk:minSdkVersion 11 cannot be smaller than version 14 declared in library [com.android.support:appcompat-v7:26.1.0] \9fe0f18d3439e3d6185e96eddd3ec321\AndroidManifest.xml as the library might be using APIs not available in 11
Suggestion: use a compatible library with a minSdk of at most 11,
or increase this project's minSdk version to at least 14,
or use tools:overrideLibrary="android.support.v7.appcompat" to force usage (may lead to runtime failures)
So here is the problem and here you got the reason. May be some one can help you in bypassing it. I just thought to share my findings.
I am currently using Android Studio 3.0.1 and I have also experienced not being able to select api versions below 14 in the new project window, however I am unsure how to fix this issue directly. I have been successful as changing minSdkVersion (or using a project which had it already set) and haven't had a build issue. The same build issue appears to have solutions here, if you are experiencing this: Manifest merger failed : uses-sdk:minSdkVersion 14
I had a issue running the application on the emulator, as it was constantly waiting for the emulation to finish starting and this was fixed by updating the gradle as suggested by some notifications.
Otherwise I can only suggest trying the older ide version, especially if you are natively debugging using 32-bit windows, as it appears to not be supported in Android Studio 3. However after reading the release log it doesn't appear to mention excluding api below 14.
Native debugging with Android Studio no longer supports 32-bit Windows. We've chosen to focus on other platforms because very few developers are using this platform. If you are using 32-bit Windows and you plan to debug native code, you should keep using Android Studio 2.3.
[Source: https://developer.android.com/studio/releases/index.html]
Link to older ide version from the same source: https://developer.android.com/studio/archive.html#android-studio-2-3-3
I am an android beginner, I have developed one app, it was working kitkat version, but it's not supported in lollipop version (nexus 5). When I run the app in nexus 5 the app get force stop. This problem arrives development side or lollipop side Any one can help me
For your reference I have used android version as below
Min sdk is 14
Taget Sdk is 21
It may be because of some libraries you have used.I got the same issue when I was having simonvtmenudrawer in my app which was not supported in lolipop.I replaced the same and it is now working fine.
I have been trying to test my app it works which works fine with 4.4.4 and lower, but when I try to compile it with targetSdkVersion 'L', I am unable to run it on lower version, is there a work around to do achieve this on Eclipse. I am unable to copmile for lower sdk version of Android if I set the targetSdkVersion to 'L'. I have seen some work around using Android Studio but I still don't feel comfortable with the Android Studio.
L is a preview release of the SDK, and you can't use it to build apps that will run on previous, released versions of the Android platform. It's intended for testing your code against the L APIs and L emulator, not for building shipping apps. If you want to run on non-L devices, use a released version of the SDK (API 19 or 20).
I've been testing an Android app on a device that had API version 15 installed. I now have to switch to a different device (a Samsung Galaxy Nexus, if it matters) that has version 14. Even though I changed "project build target" from Google APIs 15 to 14, I still get the following message when I try to execute the app on the new device:
ERROR: Application requires API version 15. Device API version is 14 (Android 4.0.2).
Cleaning all projects did not help. Restarting Eclipse did not help. I created a simple new test app with target=14 and it worked fine.
Why changes to the old project are not taking effect?
Thanks!
You have to change the minSdkVersion in your AndrodManifest.xml. See this post and the blog entry it is based on for details.