drawables not in app directory and not adressable - android

i recently started the android tutorial from android.com, after downloading and installing Android Studio and the sdk. I made the first app and all, working directory is on a Flashdrive, Android Studio and sdk are on the HDD.
I'm currently stuck at the "Adding action bar buttons" tutorial, as android studio doesnt find "#drawable/ic_action_search".
I understand that it should be in the MyfirstApp/app/src/res/drawable- folders, but those are practically empty (see picture below).
I did find an answer on here that states to simply copy the required drawables from sdk/platforms/android-/data/res/drawables-.
Another one states, I can adress "standard" pictures (like the search action icon in my case) by using "#android:drawable/ic_action_search", but that doesnt work at all.
Is there a good workaround, easier then putting every icon in every corresponding folder, every time i need one? The tutorial doesnt have that, it seems the guy writing the tutorial relied on the icons just being there?
(May solve itself with 1.)
In that other folder, there are many, many drawables, but the one folder I searched (drawable-hdpi) doesnt even have an icon called ic_action_search.png so...where do I usually get that?
Thanks for helping, I'm still hoping this is a common mistake so there's an easy solution here^^
Edit: manually starting the gradle build task doesn't work either, same problem.
()

Does your project build? Try running the gradle build task manually.
screenshot

Related

Can't find my app's full home page in Android Studio Layout Editor

Prerequisites: Got a working app from a friend who needs some changes made. They were outsourcing and now want to internally manage it.
I come from a web and game dev background, so Android/IOS development is new to me, but a lot of the principles seem to be the same.
I got the project onto my device, installed all of the dependencies, and fixed all of the file paths.
The app successfully builds, and I have my virtual Android device running it great!
However, my buddy wants some really simple layout changes, and for the life of me, I can't find where to just edit the home screen layout. I was trying to solve my issue from a web dev approach, by grepping where the logo screen is used in the app, but those files seem to just load a white "background" layer, and not the entire composed page?
I'm missing something really silly here, and I just want to ask a real person on here, instead of digging through documentation and trying to word a condensed question in a Google search.
Here are my condensed questions: How can I just edit the home screen of my app in Android Studio? Where can I find the full home page file to view the entire layout, and not just a fragment?
Edit: The app also utilizes the Flutter SDK, which may explain why I have been having trouble with layout edits. I'm going to look at it again after work today, and hopefully answer my own question. I appreciate the help so far!
Edit 2: After going back to the app with a different approach, I found out my project had defaulted to the "android" sub folder of my master, and wasn't showing any of the Flutter .dart documents. After going up one folder directory, I was finally able to access that Main.Dart file with the display information.
I was able to mount it for inspection, but its saying my emulated device isn't supported. I need to look at it when I have time tonight, and may need to ask a separate question for it. I have my project sdk set to Android 33, and my virtual device is set to Android version 33. I searched around Stack, with a few people with reporting similar issues. I tried following their solutions, but it didn't seem to work.

Build failed with an exception - I have tons of questions

After being kicked off of reddit and told to come here, I have some massive questions.
I just started to code, I am trying to release my first app. However, right as I went to submit it, I messed up and everything is crazy now! So I will start at the beginning:
I am making an app that lets you shuffle between ideas on what to build in minecraft. Each tap brings up a new random idea - that is all. It is super simple, I am keeping it that way since it is my first ever app. Now, I had it working, I have every drawing I need for the app. But as I went to submit the app to actually publish it, my .apk file was invalid. I was using the test version, which wasn't allowed to be used in the submission.
I then followed a guide that instructed me to delete my Gradle and .Gradle folders, and apparently android studio was supposed to regenerate them and fix it. Well, that did not happen. What happened was that my 'Android' folder in Android Studio became empty - there is now an app folder with nothing in it, and a Gradle Scripts section with various files that I had not seen before. The majority of my file names are red or orange.
Now, most of if not all of my code is still here. However, it says that the Gradle project sync failed, and I don't know what that means. I can no longer find out the source of these files, as in, there is no manifests or java folder located within my 'Android' heading. I don't know what to do to get it back. I had almost everything taken care of, and I am certain there is a simple way to get it all back. I did not make a VCS at the time, since nobody ever told me I should. Like I said, I am new at making apps. I still have the folder with what appears to be every single bit of code I have made so far.
If you can help me I will be extremely grateful. I have spent almost three weeks working on this, and it would be horrible to see it all go down the drain over one simple mistake.
What about creating a new project and adding your source files, dependencies and resources to it?

can't change action menu icon in android app

It's less than I can't change it, (Since I already did), and more and issue that I can't change it BACK.
So I'm using eclipse to learn android app development. In one of the tuts on the android developer website, it says you have to add your own ic_action_search.png file for the action bar to find. (Else it won't compile). So I made my own goofy looking icon. I added it, and it's there. Ok.
So Afterwards, I found the Android Design Icon pack from google. It looks much better and decided to plug that back in. I thought that would be easy. I took the new file, (With the EXACT same names), and plugged them back into the source folder where the others were. It OVERWROTE the other files and I have confirmed that the correct icons are now in there.
When I run the program using USB debugging on my phone though, the OLD icon is still there.
I tried refreshing the folders inside eclipse. I tried uninstalling the app from my phone and then re-installing fresh using USB debugging in eclipse. Still no go.
I'm worried that my device stored those images somewhere in my phone and isn't overriding them on the new install. Really need help with this here.
Any ideas?
Refresh your project F5
Go to
Project > Clean
if that doesn't work delete /gen and /bin folders of your project to recreate all the references of your resources.
probably you are uploading an .apk file with the old resources

Replaced image in Android project, but won't update in project

I have an Android project, and I wanted to replace two of the images I use in it with updated ones. So, with Eclipse closed, I replaced the two images with two of the same dimensions. When I re-opened eclipse, it updated one of the images, but the other one is an old version of the image. I can't figure out for the life of me how to get it to see the new one. I have run Project->Clean , and refreshed the project, but it still references that old image for one of them. The old image is definitely nowhere to be found in the project directory.
What am I missing here? Keep in mind I'm not a very experienced Android dev at all.
If you haven't found the solution yet go to menu project->clean... That should be enough.
Cheers!

IntelliJ Android cache build with drawables ignores changes

I have a minor issue with the way IntelliJ caches files or builds (not sure about terminology here).
Situation Abstract:
Library module
DrawableA
DrawableB
App module
DrawableA
Assume library images are black and white, App ones are color.
The app shows (correctly) the colorful A.
The app shows (correctly) the black and white B (means its missing).
Now I add an image to App project, Drawable B, in color.
If you simply press "run" he will keep using black and white B
If you "rebuild project" he will use the correct one
If you try "Make" and "Compile" manually on Lib and App NO EFFECT
To clarify, this issue is really special. It only occurs if the DrawableB is NOT present in the App module. If you have it, but the WRONG one, and you update it, it works. I assume its an internal caching of IntelliJ, and he does not recognize that I added a drawable (and he has to use it from the App now, not the LIB). Perhaps its something in the google build of Android projects, not enough info about the internal here...
I know, the obvious tip is "do a rebuild of the whole project" - that said, I have 18 App modules, each for one App. The rebuild takes forever (on one of our machines without SSD), and its not neccessary. If I change something in e.g. AppX, I only need to rebuild AppX and the Library. But there seems to be no option for it.
Does anyone know a workaround, like deleting BIN or other cache folders via script? Cant split up the modules in different "projects", would loose refactoring capabilities.
Crosspost here, check before wasting time to answer (this site here is more frequented and faster, but this issue is so specific, cant hurt to ask the developers too)
http://devnet.jetbrains.net/message/5446674
Try to rebuild project. Smtm i have same problem and it helps me.
Can you try it with the new IntelliJ Idea version 12? It seems to handle cached resources pretty well.

Categories

Resources