0

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.

2 Answers2

0

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.

Julien Rousseau
  • 975
  • 1
  • 9
  • 15
  • Can you post your Test.java and AndroidManifest.xml files? – Julien Rousseau Jun 22 '13 at 16:16
  • Islibrary is not checked. Ok I have been unclear, my project is called Test, my activity called MainActivity and therefore the class qhich interest me is called MainActivity as well. My class MainActivity is in the xml file. – user2511974 Jun 22 '13 at 16:24
  • Ok here is my MainActivity class: package com.example.test; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class MainActivity extends Activity { private TextView coucou = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); coucou = new TextView(this); coucou.setText("Bonjour, vous me devez 1 000 000€."); setContentView(coucou); } } – user2511974 Jun 22 '13 at 16:24
  • "I use Eclipse IDE for Java Developers which I downloaded just yesterday in Eclipse official website so I guess the version is not the problem." Did you also install ADT? Your activity is fine BTW, mais je ne vais pas te donner un millions d'euros ;) – Julien Rousseau Jun 22 '13 at 16:53
  • On peut toujours essayer :p Yes I installed the ADT add-on, actually my emulator is started and is apparently normal. – user2511974 Jun 22 '13 at 17:30
  • Ok guys I just found out what was wrong. It seems that when I install my SDK,I asked him to install the Tools, but it did not (don't know why) install the Android SDK Buid-tools....So problem solved, many thanks for your help!!! – user2511974 Jun 22 '13 at 17:50
0

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..

CRUSADER
  • 5,486
  • 3
  • 28
  • 64
  • Ok so first thank you both for your quick answers. - Islibrary is unckecked - I did the Fix Project Properties and Clean things, but it does not work But I do not know what and where the R.java file is. More information about what I did. I created an new Android Applcation Project (called Test) and a blank activity called MainActivity. Eclipse geenrated automatically my project with a java class called "MainActivity". I modified this class in order to display a simple message. But when I run the project, it does not work.... – user2511974 Jun 22 '13 at 16:14
  • ok, try with other possible fix mentioned above, let me know if you are still having problem.. – CRUSADER Jun 22 '13 at 16:16
  • I use Eclipse IDE for Java Developers which I downloaded just yesterday in Eclipse official website so I guess the version is not the problem. – user2511974 Jun 22 '13 at 16:30
  • Well, in that case, 2nd and 4th case is not solution try 1st and 3rd' – CRUSADER Jun 22 '13 at 16:33
  • R.java is autoGenerated file, it is in gen folder created by Eclipse itself. – CRUSADER Jun 22 '13 at 16:39
  • yes but it seems that this file has not been generated. How can I do this? – user2511974 Jun 22 '13 at 16:40
  • Ahh, there you are, there must be problem with your .xml files in layout section. check for problems there.. goto Wndow-->Show view --> Problems.. clean build your project and you will get to know your prob there.. – CRUSADER Jun 22 '13 at 16:53
  • I just tried to clean build but nothing appears in the Problem window (and why would there be any problem in xml layout file?I did not modify it) – user2511974 Jun 22 '13 at 17:28
  • Ok guys I just found out what was wrong. It seems that when I install my SDK,I asked him to install the Tools, but it did not (don't know why) install the Android SDK Buid-tools....So problem solved, many thanks for your help!!! – user2511974 Jun 22 '13 at 17:50
  • @user2511974 If your problem is solved then you should post your experience in answer section and mark that as solved. It will benefit other who might have same problem – CRUSADER Jun 23 '13 at 05:17