Android 项目评估期间无法应用Protobuf

Android 项目评估期间无法应用Protobuf,android,google-app-engine,android-studio,gradle,protocol-buffers,Android,Google App Engine,Android Studio,Gradle,Protocol Buffers,我正在尝试编译protobuf,在应用程序中使用此代码 build.gradle: 但我得到了一个错误: 错误:期间无法应用com.google.protobuf插件 项目评价。Java插件或Android插件之一必须 首先应用到项目中 当我添加apply插件时:“com.google.protobuf” 有人能帮我吗 谢谢。protobuf插件似乎不支持孵化com.android.model.library插件。我应该怎么做才能将protobuf添加到android?protobuf插件似乎不

我正在尝试编译protobuf,在应用程序中使用此代码

build.gradle:

但我得到了一个错误:

错误:期间无法应用com.google.protobuf插件 项目评价。Java插件或Android插件之一必须 首先应用到项目中

当我添加
apply插件时:“com.google.protobuf”

有人能帮我吗


谢谢。

protobuf插件似乎不支持孵化
com.android.model.library
插件。我应该怎么做才能将protobuf添加到android?protobuf插件似乎不支持孵化
com.android.model.library
插件。我应该怎么做才能将protobuf添加到android?
apply plugin: 'com.android.model.library'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.5'
    }
}
apply plugin: 'com.google.protobuf'

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.1"

        defaultConfig.with {
            applicationId = "com.google.sample.helloandroidjni"
            minSdkVersion.apiLevel = 17
            targetSdkVersion.apiLevel = 23
            versionCode = 1
            versionName = "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
            plugins {
                apply plugin: 'com.google.protobuf'
            }
        }
    }
    android.buildTypes {
        release {
            minifyEnabled = false
            proguardFiles.add(file('proguard-android.txt'))
        }
    }
    android.ndk {
        moduleName = "hello-android-jni"
    }
    android.packagingOptions {
        pickFirst 'plugin.xml'
    }

}
dependencies {
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.1'
    compile files('build/protobuf-java-2.4.1.jar')
    compile fileTree(include: ['*.jar'], dir: 'libs')
}