Office Hours — Today, October 20

Yesterday, October 19

Mark M.
has entered the room
Mark M.
turned on guest access
Oct 20
3:55 PM
HighwayRob
has entered the room
Mark M.
hi, Rob!
how can I help you today?
HighwayRob
4:00 PM
Mark M.
um, OK
could you explain your issue?
HighwayRob
Good afternoon Mark. The project I am workingon does not display the bottom half of the layout I uploaded. The TextView and ListView does not get displayed. Prety sure the data is getting set.
Mark M.
wrap_content is not a good choice for height for ListView or TextureView
in the case of TextureView, to a very real extent, there *is* no "content" on which to measure height
in the case of ListView, the content is not determined until the adapter is attached, and that gets weird
the TextureView width of wrap_content will have a similar issue
so, my guess is that these widgets have a height and width of 0 pixels when you run this code
wrap_content is fine for TextView (and children, like Button), ImageView, CheckBox, etc.
but for other widgets -- ListView, TextureView, RecyclerView, etc. -- wrap_content won't work for height or width especially well
instead, you either use match_parent, a specific dimension, or use other layout rules to size things
HighwayRob
Let me try match_parent to see if anything get displayed.
Mark M.
at most, the first ListView might
4:05 PM
Mark M.
that would take up all the rest of the space on the screen
leaving no room for the TextureView or second ListView
HighwayRob
First listview does get displayed, then nothing.
Mark M.
since your root view is LinearLayout, you could use layout_weight to allocate space proportionally
that link is to a layout from the book's chapter on the classic containers, like LinearLayout
it has three buttons, vertically stacked
the buttons take up 50%, 30%, and 20% of the space, respectively from the top
that's because I set their height to be 0dp and set their weights to be 50, 30, and 20
each button gets space allocated based on its weight compared to the total weight, so the first button gets 50/(50+30+20) = 50/100 = 50% of the space, and so forth
HighwayRob
Cool, let me give that a quick whirl.
Mark M.
if you were using ConstraintLayout as the root container, you could use guidelines or percentage-based constraints to achieve a similar effect
4:15 PM
HighwayRob
Mark M.
OK, what do you not like?
HighwayRob
ok....list shows, the Textview appears black. I had a String set for "Your Favorite Drinks" in the string file, but it does not display.
Mark M.
you don't have a TextView in that layout
you have a TextureView in that layout
HighwayRob
LOL
Mark M.
TextureView is for displaying things like videos, OpenGL animations, etc.
HighwayRob
OK..works now. I am laughing. I looked at that for hours and never saw that. If I had saw that, it probably would of worked.
Mark M.
it's easy to make that sort of mistake, particularly if you are using code-completion assistance in the IDE
4:20 PM
HighwayRob
View paste
Yup...dang IDE jumped on me.   Thanks!
Would you like to try another issue since I am the only one around this afternoon?
Mark M.
go right ahead
HighwayRob
View paste
Another project I am working on stopped compiling when I migrated it from Android Studio 2 to 3.
This line lights up in red and I get error message:
D:\DroidStructSysV216\DroidStructSysV216\hilightsTechMan\hilightsTechMan\build\intermediates\res\merged\debug\values\com_crashlytics_build_id.xml: error: uncompiled XML file passed as argument. Must be compiled first into .flat file..
Mark M.
the file you have up in the editor is from the build/ directory
HighwayRob
Three layout files reference http://schemas.android.com/tools
Mark M.
error messages that you see in in the IDE for build/ files are sometimes meaningless
in this case, the "URI is not registered" message is benign
you always get that when looking at build/ output, and I don't know why
it's not indicative of a problem
4:25 PM
Mark M.
the error message "Must be compiled first into .flat file" is coming from your build output (Gradle console), right?
HighwayRob
yes
View paste
Information:Gradle tasks [:hilightsTechMan:generateDebugSources, :hilightsTechMan:generateDebugAndroidTestSources, :hilightsTechMan:mockableAndroidJar]
D:\DroidStructSysV216\DroidStructSysV216\hilightsTechMan\hilightsTechMan\build\intermediates\res\merged\debug\values\com_crashlytics_build_id.xml
Error:error: uncompiled XML file passed as argument. Must be compiled first into .flat file..
Error:failed parsing overlays.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':hilightsTechMan:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 1s
Information:6 errors
Information:0 warnings
Information:See complete output in console
Mark M.
try that and see if it helps
HighwayRob
in gradle-wrapper.properties ?
Mark M.
no, there should be a gradle.properties file in your project root directory
if not, create one there and put that line in it
4:30 PM
HighwayRob
At what level does it go?
Mark M.
as a peer of settings.gradle, local.properties, etc.
4:35 PM
HighwayRob
well...it compiled but did not run in emulator, I will try attaching my phone (production APP, hope it works).
4:40 PM
HighwayRob
View paste
well maybe it did not compile, still getting err.
This is a deep environment issue, I will try to get a hold of the co-developer I was working with Monday and try to get his attention.  Very hard to get a hold off. I am confident you could resolve this one, but it would be difficult to address is this forum.
Mark M.
well, FWIW, I haven't used Crashlytics
you're still getting that same error message, though?
HighwayRob
yup
cleaned, rebuid, etc. same err.
Mark M.
ummm... you may also need to stop the Gradle daemon for that change we made to take effect
quoting from https://developer.android.com/studio/build/grad..., " If you are experiencing issues while using AAPT2, you can disable it by setting android.enableAapt2=false in your gradle.properties file and restarting the Gradle daemon by running ./gradlew --stop from the command line."
completely closing and reopening Android Studio may also be sufficient to restart the Gradle daemon
HighwayRob
ok, easier.
4:45 PM
HighwayRob
Same error come up automatically and the Gradle COnsole also says
View paste
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':hilightsTechMan:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Mark M.
"...and the Gradle COnsole also says" what? the FAILURE message above that statement?
HighwayRob
View paste (83 more lines)
Executing tasks: [:hilightsTechMan:generateDebugSources, :hilightsTechMan:generateDebugAndroidTestSources, :hilightsTechMan:mockableAndroidJar]

Configuration on demand is an incubating feature.
Configuration 'compile' in project ':hilightsTechMan' is deprecated. Use 'implementation' instead.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
:hilightsTechMan:preBuild UP-TO-DATE
:hilightsTechMan:preDebugBuild UP-TO-DATE
:hilightsTechMan:compileDebugAidl UP-TO-DATE
:hilightsTechMan:compileDebugRenderscript UP-TO-DATE
:hilightsTechMan:checkDebugManifest UP-TO-DATE
:hilightsTechMan:generateDebugBuildConfig UP-TO-DATE
:hilightsTechMan:mergeDebugShaders UP-TO-DATE
:hilightsTechMan:compileDebugShaders UP-TO-DATE
:hilightsTechMan:generateDebugAssets UP-TO-DATE
:hilightsTechMan:mergeDebugAssets UP-TO-DATE
...
Mark M.
Caused by: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
so, our change did not yet take effect
Option #1: open up a command prompt, navigate to your project root directory, and run ./gradlew --stop
Option #2: reboot
4:50 PM
Mark M.
the Gradle daemon does eventually shut down when you stop Android Studio AFAIK, but I haven't examined the timing in detail
4:50 PM
HighwayRob
View paste
I will reboot and try.  I will send email with results.  Otherwise, calling it a week.
Thank you for your support.
I will be in touch next week.
Rob
Mark M.
OK
HighwayRob
has left the room
5:00 PM
Mark M.
turned off guest access

Yesterday, October 19

 

Office Hours

People in this transcript

  • HighwayRob
  • Mark Murphy