I've been working through the Training tutorials at developer.android.com, 
and I've run into a stumbling block at the "Managing the Activity 
Lifecycle" tutorial. I'd like to download and try the ActivityLifecycle.zip 
sample project using Android Studio 1.5.1.

First I tried placing it directly into my Android Studio projects folder 
and opeining it like I would any other project. When I do this, I get a 
"Sync Android SDKs" dialogue box that says:

"The path
> '\Users\brutledge\android-sdk-macosx'
> does not belong to a directory.
> Android Studio will use this Android SDK instead:
> 'C:\Android\sdk'
> and will modify the project's local.properties file


Ok, I get it. This project was made on somebody else's mac. Android Studio 
will use the SDK I have on my PC. So then I click "OK". Then, I get a 
"Gradle Sync" dialogue box saying:

>
> Gradle settings for this project are not configured yet.
> Would you like the project to use the Gradle wrapper?
> (The wrapper will automatically download the latest supported Gradle 
> version).
> Click 'OK' to use the Gradle wrapper, or 'Cancel' to manually set the path 
> of a local Gradle distribution.


I click "OK", simply because I have no idea what I'm doing. The project is 
building for a few seconds. I get a popup that says "Frameworks detected: 
Android framework is detected in the project *Configure*".

Since nothing seems to be working, I click configure and the "Setup 
Frameworks" dialogue box comes up. I leave the Android and 
AndroidManifest.xml files checked (I'm just grasping at straws at this 
point. I have no idea what this will do). Then, the event log shows a 
couple more things about what went wrong. Here is the entire Event Log for 
the project since I opened it:

>
> 8:32:54 PM Platform and Plugin Updates: The following component is ready 
> to update: Google APIs Intel x86 Atom System Image
> 8:34:41 PM Gradle sync started
> 8:34:53 PM Gradle sync completed
> 8:34:56 PM Frameworks detected: Android framework is detected in the 
> project Configure
> 8:42:12 PM IndexNotReadyException: Please change caller according to 
> com.intellij.openapi.project.IndexNotReadyException documentation
> 8:42:12 PM Update Property Files
>            The structure of following Android modules was changed:
>            activity-lifecycle
>            Would you like to update related project.properties files?
>            Only once
>            Always for these modules
>            Never for these modules


At this point, I decide to close Android Studio and take a different 
approach by importing the project from the desktop. I reopen a different 
project in android studio and go to "File>New>Import Project..." and select 
the activity-lifecycle folder from the desktop and press "OK". In the next 
dialogue box I choose to import it to my Android Studio Projects directory 
and click "Next". I get an "Import Project from ADT (Eclipse Android)" 
dialogue box that says:

The ADT project importer can identify some .jar files and even whole source 
> copies of libraries, and replace them with the Gradle dependencies. 
> However, it cannot figure out which exact version of the library to use, so 
> it will use the latest. If your project needs to be adjusted to compile 
> with the latest library, you can either import the project again and 
> disable the following options, or better yet, update your project.
> [x] Replace jars with dependencies, when possible
> {x] Replace library sources with dependencies, when possible
> Other Import options:
> [x] Create Gradle-style (camelCase) module names


I leave all the boxes checked, and click "Finish". I get a large 
"import-summary.txt" file and a project folder with lots of errors. This is 
what shows up in the event log:

8:58:40 PM Gradle sync started
> 8:58:45 PM Gradle sync failed: Cause: failed to find target with hash 
> string 'android-14' in: C:\Android\sdk
>            Consult IDE log for more details (Help | Show Log)
> 8:58:45 PM Gradle sync started
> 8:58:47 PM Gradle sync failed: Cause: failed to find target with hash 
> string 'android-14' in: C:\Android\sdk
>            Consult IDE log for more details (Help | Show Log)


So I guess it's because I don't have that SDK on my computer. When I open 
my SDK manager, I see options for SDK API level 10 and 15, but not 14. In 
any case, it must be very, very old.

Is there any easy way to get this to work? Is it even worth it? It seems 
like this project wasn't even designed for Android Studio. I'm just 
becoming very frustrated with learning Android development, since it seems 
like all of the resources to learn it are out of date, including at the 
official android developer site. If there's one sample program that's worth 
keeping up to date, it must be this one. The people who are going to use it 
aren't familiar enough with Android to make it compatible with the latest 
version of Android Studio.



-- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
To post to this group, send email to android-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/android-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/android-developers/0c138b16-cef5-4a7c-9369-b2cf52b389c3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to