Resource error in Android Studio - android

At the beginning of a new project organization, everything is going well. But after writing a bit of code, I encounter a Resource error. Please look at the picture, the red R.

Try to restart Android Studio. If that doesnt work import "package.name.R" and if that doesnt work change "AppCompatActivity" to "Activity"

Related

What could be the reason for "attribute layout_constraintstop_totopof not found" when I build my project in android studio? I am a beginner

I am designing a UI from a tutorial online.
The code doesn't underline any errors, the error pops up only when I try to build and test the app on my device.
you need to use the right attribute sometimes android studio did not show you the suggestion therefore you need to know the lower and upper cases use in XML. Below is the code that will solve your problem.
layout_constraintTop_toTopOf=""
Spelling mistake:
layout_constraintstop_totopof=""
instead of layout_constraintTop_toTopOf=""

MyEclipse: Changing Android codes takes no effect

I know this is a rare question. Even if there are people using MyEclipse for Android development is doubted :(
The annoying thing is that after I modified my Android project (like an Activity class of a xml file), the project remained the same as it was when I imported it.
I thought there is an important feature that demonstrates this error: When I run my Android project and the console reported that "Activity not started, its current task has been brought to the front". This line occurs because the project didnt changed while as a matter of fact I did change the project and saved it.
Is there anyone has the same problem like me?
-------------add in Oct. 28-------------------
This was what I did: first, I modified one of my activities by commenting out the Toast functions; and then, I ran it however the Toast line still showed on my Genymotion emulator

"Cannot create extension" in Eclipse (Android)

I recently started using eclipse to compile my Android code (which I'm also pretty new at) and I tried to download another eclipse.exe that was supposed to be for C++. Anyways, I don't know if that would be the cause of my problems but I noticed that after I tried to give myself the option of compiling C++, just the main file in my Android project gave me the error "cannot create extension." Anyone know how I can fix this? Again, it's just in the one file so i wouldn't think it's a setting issue but I'm not really sure.
This is what my window looks like
TIA

Android Studio "Cannot resolve symbol XXX" on basic Android tutorial

I'm doing the entry level tutorial on the official Android docs. I'm currently at this step where I'm creating the second activity:
http://developer.android.com/training/basics/firstapp/starting-activity.html
The problem I'm seeing is in creating the new activity when I have to give it a hierarchical parent in the New Activities popup. I enter the name of the parent (com.juannerito.montaigne.MainActivity) but the popup doesn't recognize it and wont't let me create the new actvity.
Added to that I'm seeing a lot of "cannot resolve symbol" errors in the MainActivity class file. I'm not sure that these errors are having any material difference on the build (though I can't be really sure, as I'm a total noob), but i feel like I have to resolve these issues first before i can fix the real issue I'm having.
I'm using Android Studio 0.26 on MacOS X 10.8.4.
any help gratefully appreciated!
I just did an update to 0.26 and had the same problem. CLosing the project, and restarting Android studio and then opening the project seems to have cleared whatever it was that was causing this.
so, it turns out that Studio is (understandibly) buggy, and that these errors are false negatives...
I can also add the hierarchical parent by hand in the code so the question about the popup is moot too :/

R.java's values not recognized

I downloaded a an android project folder from a friend (the app works). In eclipse, I created a new Android project from existing code. However, there are errors at the lines calling the layouts/ids from R.java. Example: R.layout.my_layout
I tried cleaning the project, and deleting the project and creating it again. The code should be working. I checked R.java to make the sure the name matches. Note that I am an advanced-beginner at Android, so I know the basics. Please help, thanks.
if you downloaded the project from a friend, you shouldn't be creating a completely new project, but choose "new project from existing source".
try looking in the project properties under Android, many times, the import screws up the properties and moves the target SDK to the lowest possible and you'll need to change that"
it sounds stupid- but try clearing you project, make a simple change in code, save and rebuild.
i hope that'll fix your problem,
another thing- make sure u didnt imported any android.R.### class - if u did erase those lines.
Wops.
What errors are you getting in console from eclipse? Error messages are usually need to help. My only suggestion without seeing the build errors is to check your import statements. Sometimes eclipse inserts bogus import to the R classes.

Categories

Resources