android studio 2.2.3 run button disabled - java

I have a big problem with my Android studio, I followed many tutorials and it doesn't work .
I need your help...
Here are some photos to describe my problem:

Try building your project.
Make sure your project's name doesn't have any special charactrers in its name.
Try creating another project and copying everything you did into it.
Hope I helped.

click the button(below menu item Run) left of Run Button, if possible, then choose app.
or
Rebuild and Run.

Related

Android java class/symbol not found despite being placed in the same directory

I have encountered issues in my android studio regarding java classes/symbols not found, despite these classes and symbols being placed in the same directory, or under the same parent directory. I am making use of the DJI's mobile SDK for android.
Example of errors:
Cannot resolve symbol 'DJISampleApplication'
For illustration, here are 2 screenshots
First example. Clicking on "import class" causes android studio to create a brand new class instead of linking it to the existing one.
second example
However, oddly, when I go under "Build >> Make Project" , or "Run" to deploy on a real android device, the app can be installed, and there are no errors (only warnings).
Things I have tried:
Uninstalling and re-installing android studio
copying the whole project from the original files in again
Trying on another computer, which works. However, as i am only assigned this pc, i have to get this to work here as well.
Thank you in advance !
Your best bet is to invalidate caches and restart. Solves 99% of problems like this for me.
You can also try to reimport the project using the gradle tool window ...
Click the reload button here ...

Could not find xx.apk

I am a very beginer, trying to create my first Android application.
To do so, I use Eclipse and an AVD. I created my very first Class (called "Test") and when I run the project it says "Could not find Test.apk!"
I had a look at many solutions an internet:
- delete and import
- clean up my project (I have only one class so there is not much to clean
And it still does not work.
Do you have any idea about how to proceed to fix this up?
Many thank for you help.
You don't give much information to know what's wrong. What steps did you take to create this application?
Does your class Test extend the class Activity?
If it does, is it declared in your project's AndroidManifest.xml file?
Also, make sure that your project is not set up as a library project. Right click on your project's name, select Properties->Android and make sure that IsLibrary is not checked.
Possible solutions:-
Sometimes the apk file is not generated simply because there are some
android build error in your project, In this case, right click your
project, choose Android Tools -> Fix Project Properties.
Is your project termed as library, in this case, Go to
Project->Properties--> Select Android from left-hand side list -->
Uncheck the "Is Library" checkbox
Delete R.java file then clean build project or restart eclipse, this
will force the workspace to be rebuild.
what version of eclipse are you using, version of Eclipse
using(Ganymede – 3.4) is not compatible with the latest version of
the SDK. Try updating Eclipse..
Hope this helps..

Eclipse doesn't start android app in emulator

I'm right at the beginning of android programming.
I created an AVD that works just fine when launching via the AVD-manager.
I also "created" a hello-world app as a little test.
When I try to run the app as an android app, nothing happens. No output in the console, emulator doesn't start (or launchs app when already started), no message, nothing.
Can anyone help me?
Thanks a lot
I had the same problem. I think its because u created a project with a blank activity. so when the app starts it doesn't have anything to do..
to solve the issue just add an activity, intent and a category to your manifest file and run
Not sure if this will help you but, during our android lab sessions some computers had a slimier problem. How it was fixed is by doing the following:
Next to the "Run as" button, there is a small arrow, click it.
Select "Run configurations".
On the left, double click "Android Application".
There should be 3 tabs appearing on the right (Android, Target, Common)
Under "Android", browse and select the project you want to run.
Launch Action: select "Launch Default Activity".
Click on "Target" tab.
There should be an AVD table with the Android virtual devices you created through the manager. In case there isn't, hit refresh or click on "Manager" to make sure you have created it and then refresh again.
if there is an AVD, it should appear with a small check box on the left side of it, click it and then click on "Run".
This fixed the issue for most students, hopefully it will in your case as well. If not then I hope someone can answer it for you.
If you are using Windows, Give your SDK path in Eclipse as Windows->preferences ->Android->SDK Location
here you give your sdk path.

Facebook SDK import error after successful import

I'm trying to import facebook sdk libraries into my android project and I successfully imported them . Now I want to import facebook sdk classes into my project, but I can't import them. What is the problem ? What am I doing wrong ? And when I checked again that fb sdk are added or not I see This error. Please help me out if am doing any thing wrong
I don't know if this is a good way but I uploaded a video on youtube and shared the link here, sorry for video's poor quality,but it's only a 25 seconds video.
cracked it after hours of frustration....
well it goes like this.
stand on the FaceBook Project you have created by the instructions of faceBook developers.
right click and choose the properties , choose android and choose an android API from the list , press apply and ok.
clean the project and see that the error disapeard.
now it's the time to go to your project , press the right click and choose properties.
go to Android , press the Add button and choose the faceBook project.
press applay and ok .
clean the projects just for good luck . and now you finally can impory com.facebook !
hope it will save some poor programmer valuble time in the future .
you should follow this steps and guide facebook
Your sdk and your project should be in the same path. If not the library will not be properly loaded. Check if your project is in the same path as your facebook sdk. Or copy the sdk to the same folder of your project and then load that as library.
The problem is that the Facebook SDK still remains in your C:/Downloads folder. You have to put it in your Eclipse Workspace and then import it. It worked for me!
I was facing a similar issue. My project work space was in another directory and the SDK in another and based on the tutorials, I preferred to keep them that way. The solution is to include the Facebook SDK into your project's build path. You could do this in properties or click on the error icons > organize imports and it should automatically give you an option to add the SDK (if found) into your build path. That should work!

Issue in accessing R. resources in Android 2.2

I am very new to Android application development.
I successfully added some backgrounds to several layouts. And added media files to play. However when I rename a file in the folder structure, it shows an error that the resource does not exist.
But I can see those files in gen-><mypackage>->R.java->drawable.
Now my background pictures and resources do not appear in code.
R.layout.splashforproduct1 it shows an error for splashforproduct1.
not only splashforproduct1 but this issue is the same for R.raw.media.mp4
This is not first time I have got this issues. Please help me.
I am using Android 2.2 with eclipse.
If cleaning your project doesn't work try this: Scroll up to the top of the file and delete the import lines. Then wait for Eclipse to detect your changes and let it work out what you need to import and accept its suggestions.
I guess you just need to clean your project.
In Eclipse you do it clicking:
Project -> Clean and then you choose your android project.

Categories