 |
BOOK: Beginning Android Application Development
 | This is the forum to discuss the Wrox book Beginning Android Application Development by Wei-Meng Lee; ISBN: 978-1-1180-1711-1 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Android Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 30th, 2012, 06:04 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 5 Using Image Views...
I ran the Gallery project on eclipse indigo 3.7.1. I get back the following error:
Dialog box
Your Project contains error(s), please fix them before running your application.
The console contains the following:
[2012-01-30 14:48:29 - Gallery] ERROR: Unknown command 'crunch'
[2012-01-30 14:48:29 - Gallery] Android Asset Packaging Tool
It should be noted that I am running Android 3.2
Ken Ford
|
|

January 30th, 2012, 08:11 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
|
|
Hi Ken
Ah, there's not enough information for me to make a guess. Does eclipse show any errors? Do any of the java or xml files in the project explorer have a red X on them? If so, look there. Also search for 'crunch', sounds like a typo.
Hope this helps
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
|
|

January 31st, 2012, 09:00 AM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Main.xml has ! marker
This is the XML.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<Gallery
android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ImageView
android:id="@+id/image1"
android:layout_width="320dp"
android:layout_height="250dp"
android:scaleType="fitXY" />
</LinearLayout>
It has a yellow exclamation point next to ImageView above and
the message is "[Accerssibility] Missing contentDescription attribute on
image. This seems to be an XML coding error. It however is exactly as the
book says on page 171. Hopefully this is enough info.
|
|

January 31st, 2012, 07:48 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
|
|
Hi Ken
This is not the problem. The "!" is a warning. It will compile with warnings. We are looking for errors with a red "X". Another possibility is a file called 'main.out' or something like that. If it exist, it will be empty, delete it. Another thing is the error can be in any of the files in the package. In the package explorer there should be a red X on the package name, on the folders and file name, where the error exist.
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
|
|

February 1st, 2012, 08:10 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error has red x
I get a red X after I run it again. The same long-winded error message. Could I possibly have a problem trying to run code from a book about Android 2.3 that I am running in 3.2? In other words could it be that the code is not upwardly compatible with 3.2? I have run all the code learning a great deal from Chapters 1-4 and this is the first error I have run into that I cannot fix.
I am going to temporarily bypass this project and go on to the next one and hope someone sees what my error is. Thanks for the advice so far.
Ken
|
|

February 2nd, 2012, 07:32 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
|
|
Hi Ken
I don't think the versions have anything to do with it. I have ran some of them on the the latest version and had no problems.
Where does the red X show up? Can you post a screen shot?
Well as the US Army Armor says 'Bypass and haul ass'. Moving on may be the best thing.
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
|
|

February 2nd, 2012, 08:35 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Unexplained error.
The red x shows up at the Project name level. It Says Gallery for the project
name in the eclipse project folder and the red x is next to it
Galleryx The x is red. There are no lower level red x markers.
Grid project has exactly the same error. Baffling!!!
Somewhere there is an incompatibility. Maybe the pic1.png etc. pictures cannot be dragged and dropped into eclipse from a Microsoft directory without corrupting them. They do display correctly in the Windows viewer from inside Eclipse.
Ken
|
|

February 3rd, 2012, 07:46 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
|
|
Hi Ken
I have been thinking and I need to ask where you put the pic#.png files?
I put mine in drawable-mdpi, but if your device in the emulator has a higher or lower resolution they might be needed in drawable-hdpi or drawable-ldpi. If you don't know what the resolution of the emulated device is put them in all three and give a try.
Also are there any errors in log-cat?
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
Last edited by Cliff2310; February 3rd, 2012 at 07:48 PM..
|
|

February 3rd, 2012, 11:24 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
LOG-CAT access
How do I access log-cat so I can view it. I tried putting the .png files
in all three resolution folders, low, medium and high. Did not help.
However, i think it is on the right track. I just need to look at the
log-cat file to see a description of what happens when I run to cause the
error.
Ken
|
|

February 4th, 2012, 01:42 PM
|
|
Authorized User
|
|
Join Date: Nov 2011
Posts: 86
Thanks: 3
Thanked 5 Times in 5 Posts
|
|
Hi Ken
Oh yes LogCat is where the errors are. Where to find it. Well it hard to remember the original state of Eclipse, but I think LogCat was default in the 'debug' view. It looks like a little green 'android'. It should be on the right side. Click on it and it should open a window with the LogCat messages. This is where the system put its nasty xxx = null and other errors messages. It is also where all your
Code:
"Log.d (tag, "message");"
will show up.
To get it in the 'Java' and other views. In Eclipse open the 'Window' button and select 'Show View', when that opens, about 7 down is 'LogCat'.
Darn, I took a screen shot of the LogCat panel but I can't find a way to insert it in to this message(?). If you expand it to full size, the white square in the upper right, when you 'minimize' LogCat will drop out of sight on to menu bar on the bottom. After that when you open LogCat, it will drop back down whenever you click anywhere else in Eclipse. If you what it to stay around click the image on the fare left of that menu bar, looks like two small windows. That will bring it back to be 'sticky'.
Cliff
__________________
"Software to the Stars"
Failure is not an option. It comes bundled with your Microsoft products.
|
|
 |
|