0

I think the people who write the tutorials forget that the people reading them are new to the topic. We're supposed to learn about those by stepping through things, but if something goes wrong we don't know where to look for the error.

I have Windows 7 Pro, I have not attempted any eclipse development for android on this machine (though I use eclipse for other things). I downloaded the Android tutorial just now, installed it with defaults (I doubled the memory size from 2G to 4G on whatever component that was) and told it to start up after it had installed. "Help / About" says it's "Android Studio 1.3.1".

I followed the tutorial instructions for creating a new project, changing the names of the couple of files where it indicated. When I attempt to run it, the log file at the bottom of the AS window says:

Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widge.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

On poking around, I seed that the "MyActivity.java" file is underlined in red, and there are three references in it to "R", also red. If I hover over any one, it says it cannot resolve that symbol.

I also found a file named "v23\values-v23.xml" that has red text for what look like a couple of android components; one of them is the following:

<style name="Base.Widget.AppCompat.Button.Colored" parent="android:Widget.Material.Button.Colored"/>

and the value for 'parent' is underlined in red. Since this looks like it indicates an error with something called "parent" and my runtime error message says "parent", it seems logical they're related.

But I don't know where to go from there. I vaguely remember an instruction to download an Android SDK, but thought that was included with Android Studio (can't imagine why it wouldn't be). It was called the "Android Studio SDK Bundle", I figured that included what was needed.

Other SO questions on the subject are evidently too old, saying to click on menu options that no longer exist, etc., or say things like "open the gradle file" and I can't find one, or "be sure your target project version is set to 11", and I don't have any idea what that is or where to find it.

Please be explicit about menus to use and options to click on; remember that, though I'm an experienced Java programmer, I've not used IntelliJ and I've not programmed on Android, so I don't know the names of things specific to either environment.

arcy
  • 12,845
  • 12
  • 58
  • 103
  • It looks like the new project wizard for Android Studio 1.3.1 has resources for api level 23, make sure you have it installed from the SDK Manager, take a look at the answer in this question: http://stackoverflow.com/questions/32156619/android-studio-blank-activity-throws-error – Daniel Nugent Aug 22 '15 at 16:31
  • These errors are likely to be caused by a configuration problem in the App. Which tutorial are you following? – adelphus Aug 22 '15 at 16:36
  • possible duplicate of [Android Studio/Gradle: Error retrieving parent for item: No resource found that matches the given name](http://stackoverflow.com/questions/32075498/android-studio-gradle-error-retrieving-parent-for-item-no-resource-found-that) – Hussein El Feky Aug 22 '15 at 16:43
  • "be sure your target project version is set to 11" means the tutorial dates back from Android 3.0 Honeycomb (API level 11), which means it's four years old. Either that, or the instructions said to set the minSdkVersion to that number, not the targetSdkVersion. Here take a look at these instructions for week 1. These instructions are being kept uptodate https://www.udacity.com/course/viewer#!/c-ud853/ Don't register for the free trial. Just register for free access to the course materials, wth the blue button. That course is fine for beginners until week 3. Week 4 will be too difficult for you – Stephan Branczyk Aug 22 '15 at 17:01
  • @Stephen The "be sure your target" was an instruction I found googling the error message, not anything connected to my current project. – arcy Aug 22 '15 at 17:03
  • @adelphus am following a tutorial found at https://developer.android.com/training/basics/firstapp/creating-project.html – arcy Aug 22 '15 at 17:05
  • 2
    @DanielNugent on clicking that, it listed a bunch of "Android SDK" packages, two of them selected, Android 5.1 (Lollipop) and Android 5.x (MNC); the former said "update available". On a hunch I tried the "Launch Standalone SDK Manager and found "Android 6.0 (API 23)" with a bunch of checkmarks and "not installed", so I'm downloading and installing that. We'll see... – arcy Aug 22 '15 at 17:30

1 Answers1

0

Daniel Nugent called this shot: at the bottom of the left-hand pane is an option called "Gradle Scripts". My first one was named build.gradle (Project: MyFirstApp), and my second build.gradle (Module: app). Double-clicked on the second one and changed "compileSdkVersion 22" to "compileSdkVersion 23", then attempted a rebuild which failed. The question Daniel Nugent referred to also mentions ensuring I have "Android M libraries" and points to a button on the Toolbar to start the SDK manager; that showed that an update "was available" for Android 5.1 (Lollipop). I couldn't figure out how to update from that window; I guessed at clicking on a link in that window (at the bottom) saying "Launch Standalone SDK Manager", and updated from there (which took a LONG time - 15-20 minutes).

Then the rebuild on Gradle succeeded and running the application (which took perhaps a minute or a minute and a half, longer than I expected) produced the expected window to pick a device, etc. The emulator then ran the "Hello, World" app as desired.

My thanks to all who responded; now if I can just figure out what's wrong with the debug driver for my Galaxy s5...

arcy
  • 12,845
  • 12
  • 58
  • 103