here I face one problem after updating this both API level 20 (L and W). in my XML Graphical view the layout is not generated instead it is showing me this error:
Missing styles. Is the correct theme chosen for this layout?
Use the Theme combo box above the layout to choose a different layout, or fix the theme style references.
and also shows an error in res/values/styles.xml in this line
style name="AppBaseTheme" parent="Theme.AppCompat.Light
I use Eclipse juno.
To keep it simple, what you can do is select API 19 in the graphical layout and keep targetSdkVersion="19" and that should solve your problem. Basically the issue is with API20 bundles by google.
More insight about the issues with API 20L or 20W are already highlighted at below SO questions already...I've also responded with the google bug tracking link. Please have a look at those...
Many many issues, eclipse, android MediaPlayer, etc
latest 'ADT BUNDLE' open as JUNO eclipse for windows 7 64 bit
Hope this helps...
Related
I just started my first Android Studio project and I already come with a problem :)
I search on google for the answer but didn't find my problem.
So I need your help please ^^
I download the last version of Android Studio, create a project with an Empty Activity and I came up with this
As you can see my ConstraintLayout is really small and I just can't work with this.
I didn't touch anything on the project. Just to be sure I create 3 projects that have the same issue and redownload 4 time Android Studio.
On the virtual Devices, it looks correct throw: Screenshot
I put the XML code just in case it can help
xmlcode
Hope I was clear and sorry for my English ;)
EDIT: For some reason, the constraint layout fit correctly on the watch screen, but I don't want to create a watch app x) screenshot_watchview
Ok so I have finally find the problem ! I'm so happy right now :D
The problem was the AppTheme theme that I use, I switch it with the DeviceDefault theme. I don't know why this theme was causing problem but now it work and I can finally work on my first Android App !
If you are using the supportLibrary 28+ then this thing happened to me too.
and when I change the support lib version to the 27, it works.
Maybe this is a possible bug in the support library 28+.
Changing the AppTheme works like a charm if you want to stick with the support library 28+ But if you still don't want to so Try using the support library below 28.
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.
I know this may sound a trivial question, but I can't figure it out on my own. I've Googled and searched many many times. I know it may have a simple solution but I don't know where to search anymore. In general, I'm a Windows programmer, but I started programming for Android about 4 months ago. I've developed a fairly extensive application. The problem began when I started programming...my spinners are the solid gray rectangular style (unlike the newer style with the triangle in the lower right corner). When I started developing this app several months ago, I couldn't figure out why my spinners were different (after many hours) so I just ignored it. I'm at the point now of polishing my program and want the newer spinner style. So, I'm beating my head against the wall again. I went to my Android SDK Manager in Eclipse and updated my Android SDK Tools, Platform-tools, and Build-tools. I have the latest versions of all of these (22.3 and 19.0.1). When I create a new project, the newer spinner style appears. However, none of my older projects changed. They still have the same old gray, rectangular type spinners. I tried using a "android format" line command I found while Googling, but no luck with that either. I know there is probably something really simple I can do, but I can't find it. Can anyone help me with this? I'm using ADT Bundle with build v22.2.1-833290 on a Mac OSX Mavericks.
Newer spinner style works from API level 11.
So, you have to run in Android 3.0 and higher devices. If u want the same style in below 3.0 versions, then you have to customize your style. Like, take that newer style type of image and apply as a background to the spinner.
Try using ActionBarSherlock in your code. This will give you an advantage to have actionbar in lower versions of android. Also it contains ICSSpinner(An alternative to androids default spinner), which will give the newer look of spinners in lower versions of android.
Here's the link for ActionBarSherlock
http://actionbarsherlock.com/
It shows a blank screen. I then have to click the blue/gray star icon and choose App theme, only then will elements show in the palette. I then have to drag an element from the palette onto the blank screen and drop it. Then the graphical layout will appear.
It used to work fine until I started playing around with themes and ActionbarSherlock.
I tried restoring defaults on all Android and XML settings but it didnt work.
Does anyone know how to fix it so that the XML graphical editor shows up when I open a layout XML file?
(The xml I am working with are not blank.)
Every day i face this problem, especially when I add a new Andorid Project to workspace, the only solution I found is to restart Eclipse, I hope this will help you too.
I guess your issue is Eclipse related, but try to be specific next time about your IDE since it may help you get the right answer.
If you're using Eclipse i recommend that you check that your Android SDK Tools Eclipse plug-in (ADT) is up to date.
This happens with me sometimes if I haven't chosen an android version in the top-right corner of the graphical layout editor. Because the same theme might look different in different versions of Android, I guess eclipse doesn't know what to show you unless you select a specific version of android for the theme you have chosen.
It also sometimes happens with me, If I have used a Google API's version instead of Android X.X version as target build for my project. Maybe some bug in the developer tools.
Try to increase -Xms128m -Xmx1024m when launch eclipse. I had the same problem because i don't have enough memory.
Hope this helps.
Ok, so my best understanding is that you somehow overwrote or changed the default theme for that project with something other than AppTheme. You should be able to change that in the styles xml file (ProjectPath/res/values/styles.xml), assuming this is the same project.
For reference, mine works fine, and my project's styles.xml looks like this (new project):
<resources>
<style name="AppTheme" parent="android:Theme.Light" />
</resources>
In the eclipse, right click on your XML file and choose Open With and then XML Editor
At the bottom of the page, you'll see Design and Source tabs. Click on the Source to see what you desired.
mine never refreshes. So i open up another file then return back and then it refreshes. Even if i go to the palette to refresh it was not working. Also like others mentioned make sure your your api version is application to what you want rendered. So mine was set to api 20 but my project runs on api 17 so play with it. Heres a image:
notice how mines set to 17 - yours might be at 20 or something else that differs from your manifest. change it accordingly.
Solution for andoird Studio Users.
Below solution worked for me.
File --> Invalidate Caches and Restart --> Invalidate and Restart.
Hope this will work for you too.
This is the error I'm getting in my layout XML files:
error!
NotFoundException: null
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- TextView (Change to android.widget.TextView, Fix Build Path, Edit XML)
This happened after updating my SDK tools in Eclipse. However, I can still compile my code, I just can't see the graphical part of my layout.
Recently, I also added the RootTools library, could that also be the cause?
Thank you!
I had the same problem. And it turned out to be a very strange thing.
In my strings.xml file I had a line
<string name="email_seperator_char">\#</string>
And this was causing the problem. Even if I use the escape character for # sign preview was not working after SDK update.
SOLUTION:
I just added a space in front of it and voila, it worked.
<string name="email_seperator_char"> \#</string>
I know it is strange and it may not be acceptable for some apps to have an space infront of it. But that was ok for my app. Hope this helps.
And in design mode, in graphical layout, you have a new icon, (android icon), click and select 8 minimum.
I'm not sure it helps in your case, but I found out what was the problem with mine. To support older Android devices, I lowered my project build target to API level 7 (Android 2.1) from the previous value of API Level 8 (Android 2.2).
There might be an issue with the 2.1 layout renderer, it kept crashing on my TextView's property android:textAppearance="?android:attr/textAppearanceMedium". Even when I removed it, rendering was working but had a strange appearance (grey background, tiny black text). Switching the API level back fixed the layout editor straight away.
To change it, go to your project properties, select Android on the right, then tick the box next to your desired API level under Project Build Target.
I ve got the same issue just a minutes ago, try to lower the API level, press the andorid green icon in the layout editor screen and on the dropdown menu select API 7. I think it would be work out.
I've been having similar issues. After reading a number of these posts, I've found that there is probably a bug in the layout renderer for Android 4.0.3. An error message is listed (ROOT
Exception details are logged in Window > Show View > Error Log) even when all parts of the project are set to Android 4.0.3 and SDK 15.
If I set the layout renderer to Android 2.2 and leave everything else set to Android 4.0.3, SDK 15, then it all appears to work just fine.
I hope this is useful.
there is something wrong in your TextView
one time I wrote this which cause the problem
android:textAppearance="#android:attr/textAppearanceLarge"
the Eclipse can`t tell that is wrong but the design view crashes,when I realized that,I change # to ?
android:textAppearance="?android:attr/textAppearanceLarge"
then all comes to normal