Upgraded eclipse now getting main.xml: NotFoundException: null - Saga continues - android

I looked up on getting an emulator for a tablet and noticed a suggested that on checking for updates within eclipse , the latest SDK/ADT etc would provide this. At the moment I cannot check this because I am getting the following error on my main.xml file.
error!
NotFoundException: null
Exception details are logged in Window > Show View > Error Log
The following classes could not be found:
- ToggleButton (Change to android.widget.ToggleButton, Fix Build Path, Edit XML)
I have tried the three options it offers and on choosing edit XML nothing appears to show an error.
This project runs under Android 1.6 (wanted to make it as backward compatible as possible) and trying to cope with different screen sizes and orientations . At the moment I have the following layout folders:
layout(empty folder)
layout-large
layout-normal
layout-normal-land
layout-small
layout-xlarge
These all existing before the eclipse/android updates and I never had these errors. I searching the net on these , I read one suggestion of Project->clean (done this) and I then did Project->Build.
I also a suggestion to remove r.java so I have done this and ran clean and build. Still getting the same error. Oddly the code and the xml show no signs of errors apart from the above message appears at the bottom of the designer window for the XML.
The designer is set to 1.6 (API4) so it is not that the designer thinks I am on a different version to my project.
Update 1:
Since moving onto 2.1 - I found that although the layout does not show the error straight away, it then appears if I try and make any changes to it. Also I have updated the images and these do not appear to have changed either.
Update 2:
feco has suggested a reasonable suggestion of moving the build target to 2.1 as only a small percentage of users operate with a 1.6 handset now. I have decided to do this , it is more of a get around than a solution but it will have to do right now.

I had the same problem. I solved it by changing from API4 to API10 (or more) in the "Graphical Layout" window -> upper menu -> Android logo (green robot) at the end

Related

Cannot click next in Asset Studio when creating an icon

Not sure where to post this issue I have with Android Studio IDE, I hope it can be answered here.
When I open the Asset Studio in Android Studio by right clicking on my Android Module and selecting new -> Image Asset I cannot get past the first screen. Even when I leave this default, when I try and press next the Asset Window start shaking shortly after a second or two.
I encountered this problem with a prior version of Android Stuido but an update to the latest version did not help.
I tried updating the android SDK and build tools since they are obviously related but without success.
I tried restarting Android Studio but the "bug" still remains.
Perhaps I am doing something wrong, I created a video of my workflow and the issue I am encountering.
I had the same problem.
In the Legacy tab, I set the Google Play Store Icon to No and I could pass the first screen.
I had exactly the same problem while I was trying to create adaptive icon from vector graphics.
What helped me was that I need to set Size to 108 dp x 108 dp when I imported Vector Asset (res -> right click -> New -> Vector Asset).
I have faced the same issue with vectors that had a dashed line. Android Studio doesn't support dashed-strokes by default. You can check what is not supported in this link Dashes stroke-dasharray in Android Vector. So in such cases Android Studio just doesn't show any error upfront.
In your case I see its happening even for normal vectors.
To check why its failing notice every time it fails the exclamation mark at the extreme bottom right of Android Studio turns red and flashes. Just close pop up window of Android Studio and click on the red exclamation mark. It will give you the reason why its failing. Although there was nothing much I could do about it maybe you can figure out whats wrong.
I know it's been answered but here's another thing that might fix someone else's problem when adding an asset and getting the weird shaky window error: check the asset dimensions you're importing.
I was trying to add a Vector Asset with dimensions about 23dp x 1077dp (really big height and small width), and for some reason Android Studio didn't accept it. After changing it to a dimension bigger than 170dp x 8137.3dp (it scales automatically) it worked. Then I went on the .xml file and changed it to a dimension I wanted, preserving the proportion of mostly 200dp in width or height as prompted by Lint in a warning.
I don't really know why it worked but I managed to add the asset. If anyone knows it, feel free to explain.
Steps:
1) Have you tried setting it manually through file explorer/directories etc.?
2) Maybe try a drawable importer? Like this.
3) Have a look at this answer, it might help.
4) Try completely uninstalling Android Studio, re-download and install again, if all else fails.
As per your project structure, I believe this is not a native application.
That's right, Flutter projects are not Android projects. Many Android tools are enabled only for projects that have an Android facet. Adding that to Flutter projects causes many problems, so we don't do that and this functionality available for only in native android application.
Furthermore,If you want to use may be it'll help you.
Open android studio File->Open folder->navigate to your flutter project and select the Android folder. Wait for it to sync, then navigate inside the Android studio folder and find the res folder right click on it and choose New you will see the Image asset studio.
This happened to me and the problem was that the dimensions of my source image were too small, which I think is the takeaway from all the other answers as well.
In my case the issue was caused by some unusual project structure, including some source directories added manually within the module.
The only solution was to create a new sample project in Android Studio, use the Asset Editor, generate all the assets to finally copy those to my "unusual" project.
One could also read the IDE (Android Studio) logs to see exception that are being thrown when the editor windows shakes as it's described by the Author of this thread.

Android Common XML Editor opened without graphical and source on Eclipse

I have a really wired issue.
Everything worked fine yesterday, but today when I opened the Eclipse and trying to open a layout it looks like this:
As you can see there is nothing shown(Not the name of the layout, not design and graphical tabs).
I already tried the following:
To upgrade everything in the SDK manager.
To restart everything including my computer(which in most of the time fix any problem in eclipse).
Shift+Alt+F7 doesn't work.
UPDATE:
Add to done list:
Re-Open Perspective
Window>> Reset Perspective
This is my Error Log:
right click on the layout you want to open and choose
Open with >> Android Common XML Editor,
try this as well
Window>> Reset Perspective
sometime graphical layout show. but nothing showing. only blank. this is happen because the manifest minimum sdk is not support to view the layout.to resolve that change the api level which display in the right corner of layout display area.
There are 2 solutions that found:
Convert the project to Android Studio.(I don't take it because I've a complex project)
I Re-install the Eclipse.
Hope that it will help someone to save some time.

Android Studio: My layouts are all gone. What happened?

I had several layouts for various size devices and at each orientation. Somehow, they've all disappeared and only the original layout shows again, no matter which device type or size or orientation I select in Android Studio's renderer.
I've upgraded Android Studio. I've renamed the parent folder the source project and files were in. I've upgraded the sdk. Also, Although my app is not a Gradle project, I did something the IDE kept bugging me to do... I believe I moved something from AndroidManifest to build.gradle.
I don't know which step caused me to lose my layouts, as I didn't notice as I worked on other things.
Does anyone have any idea what I might have done that would cause my layouts to disappear?
Thanks.
They have not disappeared and you have not lost them!
Click on the drop down which I have circled (It probably says Android for you) and choose "Project" view which is what you were used to before the update.

xml error in Eclipse after updating Android SDK Tools

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

Can't See Graphical Layout in eclipse

I just update my ADT and when I try to see layout in an old project I get this message
"LayoutLib is too recent. Update your tool!"
what does it mean? what is LayoutLib?
You'll need to upgrade your ADT Eclipse plugin to the latest version. You more than likely updated your SDK tools, but didn't update the plugin along with it. See these links:
Can't preview Android XML layout - LayoutLib is too recent. Update your tool?
http://code.google.com/p/android/issues/detail?id=17369
If it's still broken after you update, try this:
Right click on the layout xml file in the navigator (package explorer) and
choose open with > the "Android Layout Editor" from the list.
If it's still not working, try some of the other Editors from the list before you choose the Android Layout Editor again. this worked for me;-)
My role as the marketing man was to edit the layouts of the app screens to make them prettier, using the Graphical Layout of Eclipse. As a complete technical dodo, I was working under technical expert direction, but one day when he wasn't looking, I thought I could be clever.... I couldn't.
Like the others on this thread, I couldn't see the graphical layout tab and spent several hours in following the recommendations, updating various SDKs, ADTs etc etc. without remedy.
The solution was simple.
In being 'clever',I had moved the files I wanted to work on, from their position in res/layout to a new folder 'To be edited'. I planned to complete them there and then move them back into res/layout.
Unfortunately, I didn't realise that Eclipse is expecting to find layout files in res/layout (and why not?).
So I moved one file back into res/layout and bingo! Up came the Graphical Layout tab.
Recommendations:
1. Do not allow marketing people near Eclipse.
2. Provide an upgrade to Eclipse especially for marketing people. When run, a screen appears that says..'Make lunch for the technicians..'

Categories

Resources