Comments (12)
Hi @lyvunny,
could you upload your repo to GitHub (or maybe Google Drive or whatever suits you) and also post the relevant part with the error message from LogCat, please?
Its easier to spot an error directly in the code than guessing from reported symptoms.
Thanks!
from headfirstandroid2ndedition.
Hi @croworc
Thanks for your reply. As you can see I'm new in Android dev, then I don't know what is LogCat. Could you elaborate please ? Otherwise I'm going to attach code and screenshots. By the way the code is exactly the same as the book. So I guess I have a problem with my Android Studio Configuration. It's so frustrating because I understand the code in the book but I don't know why it doesn't run. Cheers !
from headfirstandroid2ndedition.
Hello,
What error do you get?
DG
from headfirstandroid2ndedition.
Hi @lyvunny,
no sweat - we're all somewhat "new" to Android, just because its evolving so fast that once you've learned something, they've already come up with something new, great and shiny, like Architecture Components!
:-)
OK, Logcat
is the name for Android Studios built-in logging facility/monitor. You'll find the tab for its window panel at the bottom (by default) of the Android Studio "tool window bar":
Here you'll find all the warning-, error-, info-, debug-messages that every running app or Android itself might want to log. You'll learn somewhat later in the book how to make use of it, from within your own apps. It's a really helpful tool!
If your app encounters an error while its running, you'll typically find the stack trace that led to the error here.
In Logcat's upper right corner, you'll find a dropdown box that allows you to filter the source of these log outputs (because typically, there will be quite many, from other running apps as well as from the OS).
When you build and run your project in AS, it should default to "Show only selected application", i.e. your app.
Compile time errors, on the other hand, will be spit out by the build system (i.e. Gradle) into the Messages
window, the tab for which you'll also find by default at the bottom of the tool window bar.
Clicking on an error there will get you into the respective line right in your source code.
Good luck!
from headfirstandroid2ndedition.
Could you paste the contents of your layout file here?
from headfirstandroid2ndedition.
Hi mr Griffiths,
First, even if I'm starting your book, I like it very much. Unfortunately I'm blocked :-)
I'm going to attach here all the informations I can provide, but I'm not at home. Then I'll do it as soon as possible.
Thanks for your interest.
from headfirstandroid2ndedition.
This my folders . . .
BeerAdviser.zip
In the linearlayout.jpg we can see AS doesn't recognized LinearLayout
run message.txt
It's Strange. I don't find the logcat . . .
from headfirstandroid2ndedition.
Finally I've found the logcat
Logcat.txt
from headfirstandroid2ndedition.
Ok. Finally I have found the reason why it didn't work. I'm ashamed. I want to hide in a hole. Spinner was incorrectly written. spinner without upper case. AS didn't mention a problem with this tag. That's why I thought it was a different problem until I have discovered logcat thanks to @croworc. Thank you very much @croworc !!!
By the way, I don't understand why LinearLayout was underlined in red, and why for during one moment the urls was not accepted. . . Strange. But it's a happy end.
from headfirstandroid2ndedition.
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.spinner" in Logcat.
from headfirstandroid2ndedition.
@lyvunny
Good catch! That was certainly difficult, given that you're just starting out with Android and Android Studio! Hat Tip!
Btw: Looking at your screen prints, I noticed that you've been working with your layout in folder
BeerAdviser/app/build/intermediates/res/merged/debug/layout/activity_find_beer.xml
This, however, is a path where Gradle will generate intermediate files - this isn't the location where you will work with your layout file(s). Generated files will be re-generated upon builds and your changes there would be discarded!
Your layout file(s) are located in:
BeerAdviser/app/src/main/res/layout
On a side note: the current version of Android Studio is:
Android Studio 3.0 Beta 5
Merry coding!
:-)
from headfirstandroid2ndedition.
Glad you got it sorted :-). And thanks Ingo!
from headfirstandroid2ndedition.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from headfirstandroid2ndedition.