I Just Installed Android Studio And Created A New Project, It Always Came Up With Error With Gradle
Solution 1:
I'm pretty sure that the issue is with your Java-version. Don't use the newest version until you would be sure it's fully supported.
I see two ways: first which I'm sure it works and second one which should works without downgrading JDK version in Android Studio. Choose yours.
RECOMMENDED: Downgrade your existing JDK8 to JDK7
First please install Java™ SE Development Kit 7, Update 65 (JDK 7u65)
Watch installation process to see where Java would be installed
After that follow these steps:
Go to Top Menu File and select Project Structure
Select the SDK location option on the left and enter the path of you JDK in the JDK location
- Change Java 8 SDK with JDK7.
After that restart Android Studio.
EXPERIMENTAL: Upgrading manual android-gradle to the newest one
In your project view, select
Gradle Scripts
Open
gradle-wrapper.properties
Change this line:
distributionUrl=https://services.gradle.org/distributions/gradle-2.4-all.zip
with
distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
Go to build.gradle (Project: your_app_name)
Change this line
classpath 'com.android.tools.build:gradle:1.3.0'
to this
classpath 'com.android.tools.build:gradle:1.5.0'
- Don't click
Sync Now
- From menu choose
File -> Invalidate Caches/Restart...
- Choose first option:
Invalidate and Restart
Android Studio would restart. After this, it should work normally
Hope it help
Post a Comment for "I Just Installed Android Studio And Created A New Project, It Always Came Up With Error With Gradle"