【问题标题】:Gradle and Errors that appears after changes更改后出现的 Gradle 和错误
【发布时间】:2019-01-03 06:49:04
【问题描述】:

最近我尝试将 firebase 集成到我在 android studio 中的第一个项目以及曾经在我的项目中工作的东西,突然不这样做了。

我得到的错误是在 PlaceFragment(搜索地点)中,完成更改后开始使我无法编译。

请帮帮我...我迷路了。

我的 build.gradle 文件是:

buildscript {
    repositories {
        maven {
            url 'https://maven.google.com'
        }
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'

    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}



android {
    compileSdkVersion 26
    buildToolsVersion '26.0.0'

    defaultConfig {
        multiDexEnabled true
        applicationId "snowf.app.celiguide"
        minSdkVersion 16
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    dexOptions
            {
                incremental false
                javaMaxHeapSize "4048M"
                preDexLibraries = false
            }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
        transitive = true;
    }
    compile 'io.nlopez.smartlocation:library:3.2.9'
    compile 'com.afollestad.material-dialogs:core:0.9.2.3'
    compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
    compile 'com.github.jrvansuita:PickImage:2.1.9'
    compile 'me.dm7.barcodescanner:zxing:1.9.8'
    //noinspection GradleCompatible
    compile 'com.android.support:multidex:1.0.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    annotationProcessor 'com.jakewharton:butterknife:7.0.1'
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.google.code.gson:gson:2.6.1'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'cn.pedant.sweetalert:library:1.3'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.github.bumptech.glide:glide:3.8.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.kaopiz:kprogresshud:1.1.0'
    //  compile 'com.google.firebase:firebase-messaging:10.0.1'
    annotationProcessor 'io.realm:realm-android:0.87.4'
    compile 'io.realm:realm-android:0.87.4'
    compile 'me.relex:circleindicator:1.2.2@aar'
    compile 'com.andkulikov:transitionseverywhere:1.7.9'
    compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
    compile 'com.android.support:design:26.0.0-alpha1'
    compile 'com.android.support:cardview-v7:26.0.0-alpha1'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.google.android.gms:play-services:10.2.1'
    compile 'com.orhanobut:dialogplus:1.11@aar'
    compile 'com.github.jaredrummler:Material-Spinner:1.0.8'
    testCompile 'junit:junit:4.12'
}

我得到的错误是“错误:找不到符号类 ID”。

提前致谢。

罗马

【问题讨论】:

    标签: android-studio android-gradle-plugin google-play-services


    【解决方案1】:

    根据这个thread,错误意味着要么你的Java源代码有问题,或者你编译它的方式有问题。也来自这个page

    Cannot find symbol 错误的一般原因如下:

    • 拼写错误。
    • 错误的情况。光环与光环不同。
    • 不当使用可接受的标识符值(字母、数字、下划线、美元符号),my-class 与 myclass 不同。
    • 没有变量声明或变量在您引用的范围之外。

    【讨论】:

    • 请您建议我从哪里开始搜索该错误?这是我第一次使用 android,我不知道从哪里开始。谢谢
    • 解决了!原因是 gradle 中的 google-play 实现中的不同版本。当我设置相同的版本号时,问题消失了
    【解决方案2】:

    解决了!原因是 gradle 中的 google-play 实现中的不同版本。当我设置相同的版本号时,问题就消失了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-08-11
      • 2016-03-11
      • 2017-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多