Issue
I am trying out Android Studio instead of Eclipse. I install it and then start a completely new project and follow the wizard. I add no code of my own.
Then, I right-click to create a new component, a new Fragment:
and choose a new fragment:
and as soon as I do, I see compile errors:
... so I start googling and find out that I need to install and reference support library 4, and that I do. When I check the build.gradle (whatever that is, new to me coming from Eclipse), I see:
but I change that to
because they said so here. After recompiling and all that, the error is still there. I then reference the .jar-file directly, like this:
and again do recompile etc, but that doesn't help either.
This behaviour seems very strange to me. What am I missing here? This is the SDK Manager view:
Solution
The symptom of this problem is usually that the build works fine from the command line (which means your build.gradle
file is set up right) but you get syntax highlighting errors in the IDE. Follow This Steps To Solve The Problem: Click on Tools from the toolbar usually at the top part of your IDE, and then navigate to Android then navigate to Sync Project with Gradle Files button. We realize it's less than ideal that the IDE can't just take care of itself instead of forcing you to manually sync at the right time; we're tracking progress on this in https://code.google.com/p/android/issues/detail?id=63151
Answered By - Scott Barta
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.