com.google.protobuf.AbstractMessageLite $ $生成LimitedInputStream

时间:2018-06-17 07:29:42

标签: android gradle protocol-buffers

请帮助我的项目无法运行它显示错误if (LoadIconWithScaleDown) LoadIconWithScaleDown (...); else LoadIcon (...);

这是我的gradle app

com.google.protobuf.AbstractMessageLite$Builder$LimitedInputStream

1 个答案:

答案 0 :(得分:0)

您在com.android.support.test.espresso:espresso-core中遇到语法错误,并在依赖项中添加了多义词,请尝试以下代码:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.mixtape.tz.chat"
        minSdkVersion 15
        targetSdkVersion 27
        versionCode 22
        versionName "1.22"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    // Enabling multidex support.
    multiDexEnabled true

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath false
        }
    }

}
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

}

android { lintOptions { abortOnError false }

    aaptOptions {
        cruncherEnabled = false

    }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2')
    { exclude group: 'com.android.support', module: 'support-annotations' } //compile 'io.github.rockerhieu:emojicon:1.4.0'

//compile 'com.github.lzyzsd.randomcolor:library:1.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.googlecode.libphonenumber:libphonenumber:7.3.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation 'com.squareup.okio:okio:1.14.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.android.gms:play-services-location:15.0.1'
    implementation 'com.google.android.gms:play-services-places:15.0.1'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'org.ocpsoft.prettytime:prettytime:3.2.0.Final'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.vanniktech:emoji-one:0.4.0'
    implementation 'com.daasuu:BubbleLayout:1.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'net.opacapp:multiline-collapsingtoolbar:1.4.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.google.cloud:google-cloud-translate:1.14.0'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.0'
    testImplementation 'junit:junit:4.12'

}

apply plugin: 'com.google.gms.google-services'

还要检查您的项目gradle,例如:

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

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'

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

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven {
            url "https://maven.google.com"
        }
    }
}