NaplesDave

NaplesDave

Kotlin and Android Development featuring Jetpack:Page 44, Can't build project

@mfazio23
I am following along and I have gotten up to adding the data binding items. The project has built alright until I added the data binding stuff. I have compared the Chapter 2 solution code to mine and I can’t find any issues but Mine will not build. I get the following error:

Android resource linking failed
com.example.pennydrop.app-mergeDebugResources-46:/layout/player_list_item.xml:52: error: ‘@{switchHidden ? View.INVISIBLE : View.VISIBLE’ is incompatible with attribute visibility (attr) enum [gone=2, invisible=1, visible=0].
error: failed linking file resources.

Can you give me some pointer as to where I might look to fix this error?

PS. When I do the suggested updates (gradle) to the chapter 2 solution code that Android Studio tells me I should do, it fails and won’t build as well. Just a FYI. I’m using Chipmunk.

Android Studio Chipmunk | 2021.2.1 Patch 2
Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
Runtime version: 11.0.12+0-b1504.28-7817840 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.5.1
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 16
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.intellij.plugins.markdown (212.5457.16), com.thoughtworks.gauge (212.4746.52), com.kite.intellij (1.9.4), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46), Dart (212.5744), io.flutter (69.0.2)

Marked As Solved

mfazio23

mfazio23

Author of Kotlin and Android Development featuring Jetpack

@NaplesDave - Apologies for the late reply here, took me a bit to get back to this.

Quick answer: you’re missing a curly bracket at the end of the android:visibility property on your SwitchCompat component.

android:visibility="@{switchHidden ? View.INVISIBLE : View.VISIBLE"/>

Give that a run and see if you’re good (if you didn’t already find this)

Also Liked

NaplesDave

NaplesDave

@mfazio23 Thank you very much. Good catch!
Onward and forward.

Popular Prag Prog topics Top

jon
Some minor things in the paper edition that says “3 2020” on the title page verso, not mentioned in the book’s errata online: p. 186 But...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
HarryDeveloper
Hi @venkats, It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
New

Other popular topics Top

brentjanderson
Bought the Moonlander mechanical keyboard. Cherry Brown MX switches. Arms and wrists have been hurting enough that it’s time I did someth...
New
New
AstonJ
Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face: https://on...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
AstonJ
Seems like a lot of people caught it - just wondered whether any of you did? As far as I know I didn’t, but it wouldn’t surprise me if I...
New
AstonJ
Continuing the discussion from Thinking about learning Crystal, let’s discuss - I was wondering which languages don’t GC - maybe we can c...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight: Tammy Coron @Paradox927 Gaming, and writing games in particular, is about passion, vision, experience, and immersio...
New
New

Latest in PragProg

View all threads ❯