I am trying to create a u202 Android project from Jake Wharton. My android studio cannot build a project. The displayed error looks like this:
Gradle 2.1 is required
Migrate to Gradle wrapper and sync project
The line in which the error is displayed indicates apply plugin: 'com.android.application'in the file build.gradle.
I tried the following solutions, but to no avail.
- Run
gradlewfrom the oldest project directory. However, when I run this from the command line, I get a message that the assembly was successful, but when I try to synchronize the project in Android studio, I get the above error. - Run gradle through the command line. Since the version of gradle in my path was version 2.2.1, I received an error that the plugin "com.android.application" was not found - I assume that this is because I have this version of gradle -plugin in the project, which must be updated to support the newer version of gradle: 'com.android.tools.build:gradlepg.13.3'
Finally, I could create a project by loading gradle 2.1 manually and indicating that the project uses a local gradle instead of a shell. I wanted to know if there was anything wrong with the way I tried to use the gradle wrapper.
source
share