This happens if you use Resources from a Library project. In that case, the the ids in the R class are not really constants and thus cannot be used in a switch statement.
1:39 you type in your code in this arrangement : android:layout_gravity="center" android:textStyle="bold" android:textSize="30sp" It should be in that order ? Or we can put it in randomly ? And, does this code work for Android Studio Giraffe ?
idk why i am having error in switch case, errors are coming in all line which contain case. The error is Constant Expression required. Can anybody help me out pls
I am getting error Constant expression required 4 times because of cases you used how can i fix it i think we need to import something can i get the import code
hello sir thanks for sharing the education, i have question for you, why you use linear layout instead use constraint layout? imo constraint layout more option for layout, thanks for answer
You can use constraint layout, for this a constraint layout will be a better option too. It's just easier for beginners to understand with linear layout
Sir I am getting gradle sync error in Android studio how can I fix it pls tell I want to do Android development Also tell if I can do Android development in intellij idea pls
This week we will be publishing a complete food delivery app (restaurant dashboard, customer app, delivery executive app). So the complete android studio course will be most probably by the end of February.
which version of android studio are you using?
Its very nice, but please don't rush the teaching, it's better to thoroughly explain each step for what and how it works. ❤
Ok, thank you
thank you so much, Everything was clear and simple,
(I had a problem with the switch but it worked with if)
Sir it is showing error running app no target device found when I am running the mainactivity... What to do??
How to resolve the error "Constant expression required" on case R.id.btn_add:?
This happens if you use Resources from a Library project. In that case, the the ids in the R class are not really constants and thus cannot be used in a switch statement.
@@CodesEasy and how can I fix it?
@@xdgogo5231 Well, I also got that error so I converted the switch statements into if-else statements instead.
How to change switch to if statement
@@tnspeedy6444 right click on "switch" and use the context menu to translate the switch to if statements
1:39
you type in your code in this arrangement :
android:layout_gravity="center"
android:textStyle="bold"
android:textSize="30sp"
It should be in that order ? Or we can put it in randomly ?
And, does this code work for Android Studio Giraffe ?
You can put it to the element you want to apply these properties, any order is fine
How to remove error
Case R.id.btn
Constant expression required
What is the error message.
I also get the same error. Anyone who knows to solve this without using if else, please reply!!
same error. how to fix it?
Same error!!
I was getting the same error but then I switched to the if structure, it's working now.
I was trying to divide with a floting number(1.67) but my app crashed what should I do
check you logcat to see that causing the error
idk why i am having error in switch case, errors are coming in all line which contain case. The error is Constant Expression required. Can anybody help me out pls
change switch to if else
sir i cant allign the buttons , am having them vertically any solutions ?
Sir i got constant expression required error in swicth case what to do sir?
Me too :(
I am getting error Constant expression required 4 times because of cases you used how can i fix it i think we need to import something can i get the import code
same i ve problem if you solved just reply me back
same error!! you resolved?
Sir i need to make a app having 4 custom put values arithmetic answers
Ok. You can ask if you have any doubts on our discord or WhatsApp group
hello sir thanks for sharing the education, i have question for you, why you use linear layout instead use constraint layout?
imo constraint layout more option for layout, thanks for answer
You can use constraint layout, for this a constraint layout will be a better option too. It's just easier for beginners to understand with linear layout
i see, thank you very much for answer.
it's nice tutorial, keep it work!
2 errors its saying "Touch target size too small" for enter the number text both
EditText height might be less than minimum required one, set it above 50dp or above.
@@CodesEasy if i do that the layouts for my project is going wrong and it's not stop throwing errors even after changing
@CodesEasy i am getting error like Constant expression required in the place of swith case
Use if else
sorry but my answers is not showing up in the textview
Check the code, you should have made a mistake
Hello sir, how can we export these apps into realtime??
You mean how to generate apk files. Go to menu, build and click generate apk
sir i'm facing an error regarding switch statement it shows the constraint expression of R.id... is incorrect
Yeah mee too
Change the switch to an if else statement - use chatgpt for help if needed
Such a great tutorial for beginner. Really appreciate.
I am unable to download source code ,kindly help to get code for practice.
Check the description for source code
@@CodesEasy the link to the source code is not working.
Hello Sir I Have A Error And it is a constant expression required error on case R.id.button . how to solve it sir .?
I have the same issue
Res > Layout is missing in my laptop
While creating the project, select empty view layout
Same here
how to show . 33 after divided
2 decimal place code pls
You can format it
i use it for my homework thanks❤
You're welcome 😊
can i get thee complete code ??
front end and back end bothj ??
Check the description
Thanks sir for this video
Most welcome
please how do i add square root and power
You can add 2 more buttons and get the inputs and do the calculation in a function. Try chatgpt for help, you can also join our groups
It is showing constant expression requires
is this gradle or kotlin?
Android Studio uses Gradle as a build tool. Kotlin is a language that you can use in Android Studio but this video appears to use Java
Sir I am getting gradle sync error in Android studio how can I fix it pls tell I want to do Android development Also tell if I can do Android development in intellij idea pls
Need more details to help you with this error. Also you can use any ide but android studio makes your life a lot easier
took me 1 week to fix the gradle sync problem.
Hello sir I'm having an error at the end saying constant expression expected 😢😢
Where did you see this error, check the error message for details
Mera to answer ka ho error aarha wo call out nahi huab
?
@@CodesEasy text view py jh py answer likha tha wh py hi run k time error aarha
Plz answer kardy mery question ka
which langauge is this
Java
sir mere pass error aa rha hai kase fix hoga plz btao
What is the error message?
@@CodesEasy sir android studio ka video aache se bnao pura smj me aaye
Yes, we will soon be releasing a complete course in android soon.
@@CodesEasy kab tak aayega
This week we will be publishing a complete food delivery app (restaurant dashboard, customer app, delivery executive app). So the complete android studio course will be most probably by the end of February.
Getid() showing error?
Check the code
which app
What's it ?
great work
Thanks!
please remake for kotlin
im having with the case step...
Try converting switch to if condition
10 months later and somehow the formats have changed yet again. Why is Android Studio so difficult.
Yes, some layouts of android studio have changed.
Nothing about the coding part will change.