0

I am beginning a course of Android Studio but i have problems running my code : Indeed, when i click on "Run app", with a Nexus S API 22, it is my old project which is launched and not my new one. I have the Android Studio 3.5

I tried to restart Android Studio et start whole new projects but it wasn't successful.

Thank you for your help.

Aydin Abiar
  • 334
  • 3
  • 11

2 Answers2

0

Try to reinstall the application or clear the cache from settings.

If this doesn't help, try restarting the emulator without saving its state.

Ishaan Ohri
  • 187
  • 1
  • 2
  • 9
0

First try running a new Basic Activity(File > New > New Project > Basic Activity), if it run the Basic Activity without problem. The problem probably is the file path of your project, the issues of copy pasting a project folder. Try hovering the mouse in your Program file Tab enter image description here

confirm the file path if it is correct.

if it's correct check the run/debug configuration and set it to default.

L2_Paver
  • 596
  • 5
  • 11
  • Hello, thank you for your answer, I have tried a Basic Activity but it still didn't work. I hovered the file path, but i don't know to what path i should compare it to see if it's the good one ? Sorry haha https://imgur.com/PZSARia – Aydin Abiar Sep 23 '19 at 20:30
  • No problem in your file path. Now try checking Run > Edit Configuration then check the Launch Options > Launch = Default Activity and the Installation Options > Deploy = default APK. – L2_Paver Sep 24 '19 at 00:21
  • If the problem persist try using another emulator or try it to the real device. – L2_Paver Sep 24 '19 at 00:23
  • Hello, for whatever reasons, i started a new project (empty activity), made my project and ran it and it worked ! I just have an issue : The emulator worked and showed my app, my button worked (it is supposed to write a "Button Clicked !" message in the log) but then, i closed it and reopened it but my button didn't work anymore. I have this last message on my log : "Error while waiting for device: Time out after 300seconds waiting for emulator to come online" Here's a screenshot :/ https://imgur.com/jgfeLPQ – Aydin Abiar Sep 26 '19 at 18:35
  • sometimes a simple copy paste of the problem in uncle google can solve your problem, refer to this https://stackoverflow.com/questions/36675654/error-while-waiting-for-device-time-out-after-300seconds-waiting-for-emulator-t goodluck – L2_Paver Sep 27 '19 at 00:23
  • Once again, i restarted it today and it worked. I really am confused on why it works one day and not the other, with the same technical context.. :/ Thank you for your help and your fast answers ! – Aydin Abiar Sep 27 '19 at 20:50