android - Failed to sync gradle project: Unable to find method DefaultSourceDirectorySet -


i'm using android studio 2.2.2 , trying import repository https://android.googlesource.com/.

i following error when trying sync given gradle file:

gradle sync failed: unable find method 'org.gradle.api.internal.file.defaultsourcedirectoryset 

i've attempted solution given here updating protobuf version 0.8.0 more errors: execution failed task ':generatedebugproto'

this gradle file:

buildscript {     repositories {         mavencentral()     }     dependencies {         classpath 'com.android.tools.build:gradle:2.1.0'         classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.0'     } }  apply plugin: 'com.android.application' apply plugin: 'com.google.protobuf'  android {     compilesdkversion 23     buildtoolsversion "22.0.1"      defaultconfig {         applicationid "com.android.launcher3"         minsdkversion 16         targetsdkversion 23         versioncode 1         versionname "1.0"          testapplicationid "com.android.launcher3.tests"         testinstrumentationrunner "android.support.test.runner.androidjunitrunner"     }     buildtypes {         debug {             minifyenabled false         }     }     sourcesets {         main {             res.srcdirs = ['res', 'wallpaperpicker/res']             java.srcdirs = ['src', 'wallpaperpicker/src']             manifest.srcfile 'androidmanifest.xml'             proto.srcdirs 'protos/'         }          androidtest {             java.srcdirs = ['tests/src']             res.srcdirs = ['tests/res']             manifest.srcfile "tests/androidmanifest.xml"         }     } }  repositories {     mavencentral() }  dependencies {     compile 'com.android.support:support-v4:23.1.1'     compile 'com.android.support:recyclerview-v7:23.1.1'     compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-2'      testcompile 'junit:junit:4.12'     androidtestcompile 'com.android.support.test:runner:0.5'     androidtestcompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2' }  protobuf {     // configure protoc executable     protoc {         artifact = 'com.google.protobuf:protoc:3.0.0-alpha-3'     } } 

try replacing protobuf section of gradle file following:

protobuf {     // configure protoc executable     protoc {         artifact = 'com.google.protobuf:protoc:3.0.0'     }     plugins {         lite {             artifact = "com.google.protobuf:protoc-gen-javalite:3.0.0"         }     }     generateprototasks {         all().each { task ->             task.builtins {                 remove java             }             task.plugins {                 lite { }             }         }     } } 

Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -