could anyone please help me with this?
I opened an existing project and I get this error in the screenshot.
The problem is that you are using a style which require API 21. You are referencing a style called Widget.Material.ActionButton. So you need to put this reference in a v21 directory to use the CompatLibrary which I would recommend.
The real cause seems to be that you have a very low target SDK (like you wrote in the comments API 8). You should set it to the most newest one, it cannot break anything. So set the target SDK to API 21 or newer and it should work fine.
Related
I've noticed after the update to Android Studio 3 (but it could be happened also before and I didn't noticed) that some deprecated methods are not marked any more with a line-through. For example:
I'm on Ubuntu, Android Studio 3.0.1 just updated. I checked inspections in the settings, and it's all enabled. I also checked that the code style/formatting is correctly set-up for deprecations (but it had to be, given the last line of the example is correctly marked). It's not something project-related, since I tried on a freshly created project.
What can cause this?
I finally discovered that this is (strangely) the intended behaviour: https://issuetracker.google.com/65793314
What's your minSdkVersion? It's a feature that we now only show deprecated method calls as deprecated if they're deprecated for all the versions you're trying to target
So, getColor() and isAnimationCacheEnabled() are not marked in my example because I'm targeting API 15+, and instead they're deprecated as of API 23. I confirmed this raising my app's minSdkVersion to 23, and they are all marked now.
Anyway I find this behaviour confusing and unnecessary, like I said in the bug report. If someone read this and agrees, please leave a comment there.
Whenever I create a blank activity layout file assigned to be rendered at API level 22, following error message is generated
The solution to this is to change the API level by changing it to API 21 or less.
What is the reason behind this?.
This was very common for me when a new API SDK version was released and yes like you mention we have to change the Android version to use when rendering layout in the IDE.
But this time i have installed all the elements described in the Android SDK Manager for this API 22 and I have no problems with the rendering.
You can just change "AppTheme" to another theme and keep the API level as you desire.
Many users are reporting this problem and it happens only in the Layout files that uses support libraries and not the normal ones.
I want to use circular-progress-button on android 2.2 or above. But there is a error on Property class that say minimum sdk must be 14.
I don't want to check sdk version and then use or not.
Or even is there any alternative library like this?
If you want to remove that error maybe you need to increase android:minSdkVersion to 14, which means you cant support bellow Android 4.0.
But there is another library with android:minSdkVersion=11. You can use that library too. Here is the link:
FABProgressCircle
I have made a programm based on SDK 7. Now I want to add an Actionbar to it. I changed the minSDK to 11 in the Manifest. Isn't that supposed to change the design of the layouts I already have?
Problem is, that I get returned "null" by getActionbar(). I read, that I have to activate the title bar in the OnCreate of the mainactivity. But that does'nt change anything, still "null".
I can see the titlebar, but on SDK 7 it's smaller than on SDK 11. Can't really describe my problem. I just want to use Actionbar on my old written App. But the Layout still looks like in the pic below (left).!
LayoutProblems
Hope someone can help me.
Thanks!
You should also replace the old android.jar with the new one from SDK 11 to get the new GUI. If you are using eclipse for development, just check different Project buid target under Project - Properties - Android.
If you want to use ActionBar in older devices you must use actionbar support library which is provided with the sdk.
I want to call the Method setLayerType of the View Class in a Mono for Android application. Unfortunatley I cannot access (or even see) the method. According to Mono Documentation everything should be there.
Can somebody help me with this?
Thanks,
faiko
I had the same problem. You can fix this under your project settings choose "Minimum Framework Version to Target" of Android 3.1 or higher. This has nothing to do with your minimum/target API level in your manifest.
After changing that, you will have to restart Visual Studio (or reload the project in question) and you'll notice it now references the v3.1 assembly of Mono which has some new APIs exposed.
You'll still want to wrap the call to this API around a version check like:
if (Build.VERSION.SdkInt >= BuildVersionCodes.Honeycomb) if your minApiLevel is less than 11.