3

I am trying to build my gradle but it fails to build and diplays the following message in Android Studio

Gradle sync failed: Unrecognized SSL message, plaintext connection? Consult IDE log for more details (Help | Show Log)

The following message is shown on Android Monitor

Please configure Android SDK

Once I configure Android SDK it shows the following:-

Project Structure

Once I fill this out the error changes to :

Gradle sync failed: Could not find method android() for arguments [build_5xge73exnwldgwxfnjosseesw$_run_closure3@45218b07] on root project 'MyApplication' of type org.gradle.api.Project. Consult IDE log for more details (Help | Show Log)

build.gradle is as shown :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
} }

allprojects { repositories { jcenter() } }

task clean(type: Delete) { delete rootProject.buildDir }

Cyborg
  • 357
  • 5
  • 12
  • Hi ! Please add your gradle file – Priya Sep 05 '17 at 04:14
  • hey i think you will find your solution from here: https://stackoverflow.com/questions/6532273/unrecognized-ssl-message-plaintext-connection-exception – ND1010_ Sep 05 '17 at 04:19
  • Delete this part `task clean(type: Delete) { delete rootProject.buildDir }` and see what happens. – Mehran Zamani Sep 05 '17 at 04:25
  • @ND1010_ Sorry but that didn't helped me it is term for Java and that too for client and server related query but my problem is i couldn't even build a new project it shows this error every time – Cyborg Sep 05 '17 at 04:26
  • @MehranZamani That deleting that didn't work – Cyborg Sep 05 '17 at 04:27
  • 1
    @Cyborg You should have `android` block in your `build.gradle` of your app(not project). Something like `android { signingConfigs { release { keyAlias '**' keyPassword '**' storeFile file('**') storePassword '**' } } compileSdkVersion ** buildToolsVersion "**" defaultConfig { applicationId "**" minSdkVersion ** targetSdkVersion ** versionCode ** versionName "**" multiDexEnabled true } }` which seems to be missing. – Mehran Zamani Sep 05 '17 at 04:41
  • Thank you for your help @MehranZamani . I just reinstalled everything and the error was removed. Don't know the reason. – Cyborg Sep 05 '17 at 06:47
  • My guess was that you delete some part of `build.gradle`. Check it out to be sure next time ;) – Mehran Zamani Sep 05 '17 at 07:05

0 Answers0