android-persistence icon indicating copy to clipboard operation
android-persistence copied to clipboard

Configurations not available to run

Open drewahearn opened this issue 6 years ago • 9 comments

Downloaded the source and compiled/updated. the "Step 1" configuration is not available to run. The only config available is "app" which doesn't run. as1

How can one fix this?

Android Studio Version 3.1.1 The resolution for this is to either update the source code, adding the appropriate Run Configurations, or update the CodeLab Instructions describing how users can properly create the needed Run Configurations.

drewahearn avatar Apr 27 '18 15:04 drewahearn

I am facing same issue.

ashu879 avatar Apr 27 '18 21:04 ashu879

You need to add following line in AndroidManifest file in corresponding to that step you are solving - <category android:name="android.intent.category.LAUNCHER"/>

Currently no filter has that line.

virat-shukla avatar Apr 30 '18 10:04 virat-shukla

virat-shukla, what do I need to add to the AndroidManifest.xml file? Your answer was not clear.

drewahearn avatar Apr 30 '18 14:04 drewahearn

In order to launch an activity from your phone's default launcher, you need to have following lines of code in one of your activity. Only then it will be listed in your list of installed apps. <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter>

since there were many activities in this code, they left it to us - which activity we want to open. You have to put these lines in activity tag which you are currently working `upon.

viratshukla avatar May 02 '18 04:05 viratshukla

If it helps, please close the issue. Thanks

virat-shukla avatar May 02 '18 04:05 virat-shukla

The instructions for the CodeLab need to be updated to reflect the need to create/update your own Run Configurations.

The existing CodeLab instructions assume all the pre-defined Run Configurations are in place.

drewahearn avatar May 04 '18 14:05 drewahearn

On 12/9 I am having the same problem. PLEASE update codelab

thigbie avatar Dec 10 '18 04:12 thigbie

I give up. I got step 1 and 2 to work. But, from 3 on nothing works. I went back to step1 and now it doesn't work. I'm spending so much time figuring out the lessons, I'm not able to focus on the purpose of the lesson. I'll go somewhere else to learn.

thigbie avatar Dec 10 '18 20:12 thigbie

Sad but true, the codelab is not updated to reflect the instructions, and work as such in AndroidStudio 3.3.

Anyway, the (blunt) advice given already above helps to compile... one just need to consider carefully what to copy and paste, understanding the meaning and purpose of AndroidManifest.xml. :

in AndroidManifest.xml , The intents and actions for each Activity are defined. In the codelab, all actions are incomplete, is missing. Just within each <Intent>, within <IntentFilter>, after <action /> tag, please paste <category android:name="android.intent.category.LAUNCHER"/> Do it to one activity in the AndroidManifest.xml at a time, and then the activity with the line above gets run as app configuration. I hope this helps to workaround the issue.

alketola avatar Mar 03 '19 14:03 alketola