Android Studio数据绑定错误,找不到符号:debug / dataBindingGenBaseClassesDebug / databinding / ActivitySignupBinding.java [英] Android studio databinding error, Cannot find symbol: debug/dataBindingGenBaseClassesDebug/databinding/ActivitySignupBinding.java

查看:77
本文介绍了Android Studio数据绑定错误,找不到符号:debug / dataBindingGenBaseClassesDebug / databinding / ActivitySignupBinding.java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

project / build.gradle



  buildscript {仓库{maven {url 'https://maven.fabric.io/public'} google()jcenter()}依赖项{classpath'com.android.tools.build:gradle:3.5.0'classpath'com.google.gms:google-services :4.0.1'//注意:请勿将您的应用程序依赖项放在此处;它们属于//属于各个模块build.gradle文件}} allprojects {存储库{mavenCentral()maven {url'https://maven.google.com'} maven {url'https://jitpack.io'} google ()jcenter()}}任务清理(类型:删除){删除rootProject.buildDir} ext {// SDK和工具minSdkVersion = 16 targetSdkVersion = 26 compileSdkVersion = 26 buildToolsVersion = '26 .0.0'//应用依赖项supportLibraryVersion =' 25.4.0'gsonVersion ='2.8.0'posterVersion ='2.2.0'glideVersion ='3.7.0'roomDatabase ='1.0.0-alpha3'rx2FastAndroidNetworking ='1.0.0'dagger2Version ='2.11'rxjava2Version ='2.0 .6'rxandroidVersion ='2.0.1'placeholderviewVersion ='0.6.1'debugDBVersion ='1.0.0'timberVersion ='4.5.1'生命周期='1.0.0-alpha3'retrofitVersion ='2.3.0'GsonVersion =' 2.7'okhttpVersion ='3.8.0'googleplus = '11 .0.4'glideversion ='4.1.1'braintree ='3。 +'//测试依赖项junitVersion ='4.12'espressoVersion ='2.2.2'mockitoVersion ='2.7.1'}  


app / build.gradle



  apply plugin:'com.android。 application'apply插件:'io.fabric'repositories {maven {url'https://maven.fabric.io/public'}} buildscript {repositories {maven {url'https://maven.fabric.io/public' }}依赖项{classpath'io.fabric.tools:gradle:1.+'}} android {compileSdkVersion 28 signingConfigs {ReleaseConfig {keyAlias'test'keyPassword'test'storeFile file('../ KeyStore / test.jks') storePassword'test'}} defaultConfig {applicationId bz.pie.rider minSdkVersion 17 targetSdkVersion 28 versionCode 2 multiDexEnabled是true versionName 1.1 vectorDrawables.useSupportLibrary = true signingConfig signingConfigs.ReleaseConfig setProperty( archivesBaseName, PEITaxi_User_v $ versionName)testInstrumentationRunner androidx.test.runner.AndroidJUnitRunner} buildTypes {release {minifyEnabled proguard-android.txt'),'proguard-rules.pro'}} dataBinding.enabled = true lintOptions {checkReleaseBuilds false abortOnError false}}存储库{flatDir {dirs'libs'}}依赖项{实现fileTree(dir:'libs' ,包括:['* .jar'])实现项目(':countrylist')//实现项目(':slideDateTimePicker')androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0',{排除组:'com.android.support',模块:'support-annotations'})//依赖注入实施 com.google.dagger:dagger:$ rootProject.dagger2Version注解处理器 com.google.dagger:dagger-compiler:$ rootProject.dagger2Version注解处理器 com.google.dagger:dagger-android-processor:$ rootProject。 dagger2Version实现 com.google.dagger:dagger-android-support:$ rootProject.dagger2Version实现 com.squareup.retrofit2:retrofit:$ rootProject.retrofitVersion实现 com.squareup.retrofit2:converter-gson:$ rootProject .retrofitVersion实现 com.squareup.okhttp3:logging-interceptor:$ rootProject.okhttpVersion实现'com.github.javiersantos:AppUpdater:2.7'实现('com.crashlytics.sdk.android:crashlytics:2.8.0@aar '){可传递=真; }实现 com.google.android.gms:play-services-auth:$ rootProject.googleplus实现 com.github.bumptech.glide:glide:$ rootProject.glideversion实现('io.socket:socket.io- client:1.0.0'){排除组:'org.json',模块:'json'}实现 com.braintreepayments.api:drop-in:$ rootProject.braintree实现'com.google.android.material: material:1.0.0'实现'androidx.constraintlayout:constraintlayout:1.1.3'实现'androidx.legacy:legacy-support-v4:1.0.0'实现'com.intuit.sdp:sdp-android:1.0.4'实现'com.facebook.android:facebook-login:[4,5)'实现'com.google.android.gms:play-services-auth:16.0.1'实现'com.google.android.gms:play- services-identity:16.0.0'实现'com.google.android.gms:play-services-plus:16.0.0'实现'com.google.android.gms:play-services-drive:16.1.0'实现' com.google.android.gms:play-services-map s:16.1.0'实现'com.google.android.gms:play-services-location:16.0.0'实现'com.google.android.gms:play-services-places:16.1.0'实现'com。 google.firebase:firebase-auth:17.0.0'实现'com.google.firebase:firebase-messaging:18.0.0'实现'androidx.multidex:multidex:2.0.0'testImplementation'junit:junit:4.12'//可选-机器人环境testImplementation'androidx.test:core:1.0.0'//可选-Mockito框架testImplementation'org.mockito:mockito-core:1.10.19'实现'androidx.appcompat:appcompat:1.1.0'实现'androidx.recyclerview:recyclerview:1.0.0'//检测测试所需androidTestImplementation'androidx.annotation:annotation:1.0.0'androidTestImplementation'androidx.test:runner:1.1.0'}应用插件:'com.google .gms.google-services' 


gradle.properties



 #项目范围内的Gradle设置。#IDE(例如Android Studio)用户:#通过IDE配置的Gradle设置*将覆盖*#此文件中指定的任何设置。#有关如何配置构建环境的详细信息,请访问#http://www.gradle.org/docs/current /userguide/build_environment.html#指定用于守护进程的JVM参数。#该设置对于调整内存设置特别有用。org.gradle.jvmargs= -Xmx1536m#Android X:https://developer.android.com/ topic / libraries / support-library / androidx-rnandroid.useAndroidX = trueandroid.enableJetifier = trueandroid.databinding.enableV2 = true#配置后,Gradle将在孵化并行模式下运行。#此选项仅适用于解耦的项目。有关更多详细信息,请访问#http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects# org.gradle.parallel = true  



wrapper.properties



  #Mon Nov 18 11:40:24 IST 2019distributionBase = GRADLE_USER_HOMEdistributionPath = wrapper / distszipStoreBase = GRADLE_USER_HOMEzipStorePath = wrapper / distsdistributionUrl = https\://services.gradle.org/distributions/gradle -5.4.1-all.zip  



我尝试更改版本GRadle并更新项目我最终以此错误
结束,下图显示未找到该包
图片1
,但可以使用注册包
图片2



请求帮助预先感谢(确实很难解决此问题)



我也遇到了类似的问题,这使我花费了数小时的调试时间。



I最终发现,您只需要更改软件包名称即可以小写(小写)字母而不大写(大写)开头。



重构软件包飞溅以飞溅,注册以注册,并对其他以大写字母开头的软件包执行相同操作,清理然后重新构建项目。如果仍然无法使用,请使android studio缓存无效,然后重新启动计算机


project/build.gradle

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        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 {
        mavenCentral()
        maven { url 'https://maven.google.com' }
        maven { url 'https://jitpack.io' }
        google()
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

ext {
    // Sdk and tools
    minSdkVersion = 16
    targetSdkVersion = 26
    compileSdkVersion = 26
    buildToolsVersion = '26.0.0'

    // App dependencies
    supportLibraryVersion = '25.4.0'
    gsonVersion = '2.8.0'
    calligraphyVersion = '2.2.0'
    glideVersion = '3.7.0'
    roomDatabase = '1.0.0-alpha3'
    rx2FastAndroidNetworking = '1.0.0'

    dagger2Version = '2.11'
    rxjava2Version = '2.0.6'
    rxandroidVersion = '2.0.1'
    placeholderviewVersion = '0.6.1'
    debugDBVersion = '1.0.0'
    timberVersion = '4.5.1'
    lifecycle = '1.0.0-alpha3'

    retrofitVersion='2.3.0'
    GsonVersion='2.7'
    okhttpVersion= '3.8.0'
    googleplus= '11.0.4'
    glideversion= '4.1.1'
    braintree='3.+'
    //Test dependencies
    junitVersion = '4.12'
    espressoVersion = '2.2.2'
    mockitoVersion = '2.7.1'
}

app/build.gradle

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

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

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
android {
    compileSdkVersion 28
    signingConfigs {
        ReleaseConfig {
            keyAlias 'test'
            keyPassword 'test'
            storeFile file('../KeyStore/test.jks')
            storePassword 'test'
        }
    }
    defaultConfig {
        applicationId "bz.pie.rider"
        minSdkVersion 17
        targetSdkVersion 28
        versionCode 2
        multiDexEnabled true
        versionName "1.1"
        vectorDrawables.useSupportLibrary = true
        signingConfig signingConfigs.ReleaseConfig
        setProperty("archivesBaseName", "PEITaxi_User_v$versionName")
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }

    dataBinding.enabled = true
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation project(':countrylist')
//    implementation project(':slideDateTimePicker')
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    // dependency injection
    implementation "com.google.dagger:dagger:$rootProject.dagger2Version"
    annotationProcessor "com.google.dagger:dagger-compiler:$rootProject.dagger2Version"
    annotationProcessor "com.google.dagger:dagger-android-processor:$rootProject.dagger2Version"
    implementation "com.google.dagger:dagger-android-support:$rootProject.dagger2Version"
    implementation "com.squareup.retrofit2:retrofit:$rootProject.retrofitVersion"
    implementation "com.squareup.retrofit2:converter-gson:$rootProject.retrofitVersion"
    implementation "com.squareup.okhttp3:logging-interceptor:$rootProject.okhttpVersion"
    implementation 'com.github.javiersantos:AppUpdater:2.7'
    implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
        transitive = true;
    }
    implementation "com.google.android.gms:play-services-auth:$rootProject.googleplus"
    implementation "com.github.bumptech.glide:glide:$rootProject.glideversion"
    implementation('io.socket:socket.io-client:1.0.0') {
        exclude group: 'org.json', module: 'json'
    }
    implementation "com.braintreepayments.api:drop-in:$rootProject.braintree"
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.4'
    implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-identity:16.0.0'
    implementation 'com.google.android.gms:play-services-plus:16.0.0'
    implementation 'com.google.android.gms:play-services-drive:16.1.0'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-places:16.1.0'
    implementation 'com.google.firebase:firebase-auth:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:18.0.0'
    implementation 'androidx.multidex:multidex:2.0.0'

    testImplementation 'junit:junit:4.12'
    // Optional -- Robolectric environment
    testImplementation 'androidx.test:core:1.0.0'
    // Optional -- Mockito framework
    testImplementation 'org.mockito:mockito-core:1.10.19'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'

    // Required for instrumented tests
    androidTestImplementation 'androidx.annotation:annotation:1.0.0'
    androidTestImplementation 'androidx.test:runner:1.1.0'

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

gradle.properties

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# Android X: https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
android.enableJetifier=true
android.databinding.enableV2=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

wrapper.properties

#Mon Nov 18 11:40:24 IST 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

i tried changed the version of GRadle and updating the project i ended up with this error the below image shows the package not found image1 but the Signup Package is available image2

request Assistance thanks in advance (caught in this issue realy hard)

解决方案

For some weird reason (the databinding algorithm is programmed to detect names starting with uppercase as class names and correspondingly names the binding object with them), package names starting with capital letters cause errors with databinding.

I also had a similar issue that cost me several hours of debugging.

I eventually figured out you just need to change the package names to start with a SMALL (LOWER CASE) LETTER AND NOT CAPITAL (UPPER CASE).

Refactor package Splash to splash, Signup to signup, and do the same for other packages starting with a capital letter, clean then rebuild your project. If still doesn't work, invalidate android studio caches and restart your computer

这篇关于Android Studio数据绑定错误,找不到符号:debug / dataBindingGenBaseClassesDebug / databinding / ActivitySignupBinding.java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆