-1

EDIT2: Seems to be working now. It was just my computer that were so slow so I thought nothing was happening...

I followed the instructions in the Android Studio introduction meticulously, but it doesn't apply the code changes except for the "Hello World" program which runs over and over again.

Introduction: https://developer.android.com/training/basics/firstapp/creating-project

This is the program I'm trying to run (at the end of the page): https://developer.android.com/training/basics/firstapp/starting-activity

The buttons "Apply changes and restart activity" and "Apply code changes" are grey and also say "(disabled: device not connected)".

I have tried to get them working through applying several tips but they stay grey.

Android Studios version: 3.5.2, just installed.

Help me stackoverflow, you are my only hope.

EDIT: this is what my run configuration looks like now: https://ibb.co/JQT4x4T Right now AS can't run any app, not even "Hello World".

  • Is your device connected? Can you see it on the list of devices? Does it appear with a proper name or as an Unknown Device? Do you have USB debugging enabled? Have you given your computer permission to connect to your device? – Nikos Hidalgo Nov 06 '19 at 16:25
  • Im using an emulator. It appears as "Pixel 2 API 29". – user9692590 Nov 06 '19 at 17:44

2 Answers2

0

Connect your USB cable to your device -> In mobile settings -> About Phone -> keep tapping on Version option (till you get a message 'Developer Mode enabled') -> Go back to settings of mobile -> Settings of mobile -> Developer Options -> some cases of phones it maybe present under Additional Settings option (Oppo phones) -> Developer Options -> enable -> USB Debugging enable ->

Now, in the toolbar you will see your device name as of Android 3.5 update and then click on Debug !

Happy Coding!

Prajwal Waingankar
  • 2,534
  • 2
  • 13
  • 20
0

Then your device isn't properly active or connected

connect USB cable to your device then go to settings to activate developers option and enable debugging mode

also make sure you device name shows in the 'available device' before running

Wisdom
  • 40
  • 6
  • Im not using a device, but a emulator. It is shown under "available devices" as "Pixel 2 API 29". – user9692590 Nov 06 '19 at 17:42
  • ohhh.....Try restarting your emulator.....and select your emulator and run your code – Wisdom Nov 06 '19 at 17:43
  • Ok, I did. Then I try to start it again and it just gives me an empty screen with Googles logo in the middle. And where it previously said "Pixel 2 API 29" it now says "Unkown device". – user9692590 Nov 06 '19 at 17:54
  • Try Creating another emulator...also go to your SDK manager and update – Wisdom Nov 06 '19 at 18:08
  • I tried creating a new AVD with "Pie" instead; didnt work. Ever since I restarted one of my AVDs with "cold boot now" I can't even get the "Hello World" program to start... Now there is only the Google logotype, doesnt matter if I choose the Pie AVD och the Q AVD... – user9692590 Nov 06 '19 at 19:07
  • This is what my run configration looks like. Is that good? https://ibb.co/JQT4x4T This is what the launch looks like: https://ibb.co/2FrLzTL As you can see there is "Uknown device" in the top right part of the window. But there was a device just before I launched. – user9692590 Nov 06 '19 at 19:45
  • Also the ADB seems to be out of date, despite the fact that I just installed the newest Android Studio. – user9692590 Nov 06 '19 at 19:54
  • From the image everything seems ok...except the unknown device part it is meant to show your emulator device there.....try getting an Android device and run it .....saves time and emulator issues – Wisdom Nov 06 '19 at 20:57