Code Monkey home page Code Monkey logo

Comments (20)

wafer-li avatar wafer-li commented on August 27, 2024 32

Try to export the schema by adding this to your app/build.gradle

android {
    ...
    defaultConfig {
        ...
        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation":
                             "$projectDir/schemas".toString()]
            }
        }
    }
}

from architecture-components-samples.

imGurpreetSK avatar imGurpreetSK commented on August 27, 2024 4

For me, it also says package com.example.android.persistence.databinding does not exist; cannot find symbol class CommentItemBinding

from architecture-components-samples.

firekesti avatar firekesti commented on August 27, 2024 4

This helped me: https://movieos.org/2017/android-room-data-binding-compile-time-errors/

I was seeing a max of 100 databinding errors, with no "real" error message. By expanding the number of messages that can be shown, check the last error and it will be a real Room compilation error! So, hopefully you can fix that error and get compilation working again :)

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "4000"
            options.compilerArgs << "-Xmaxwarns" << "4000"
        }
    }
}

from architecture-components-samples.

wafer-li avatar wafer-li commented on August 27, 2024 3

@pdog18 国际场合还是不说中文为好

I have no problem after adding the snippet, maybe you could try File -> Invalidate Cache / Restart.

And make sure you add it at the right place, my build.gradle as follow:

image

from architecture-components-samples.

yunshuipiao avatar yunshuipiao commented on August 27, 2024 3

image
i have no problem after add it. I use mac os and i do not know the situation on windows.
code happy.

from architecture-components-samples.

blaZ3 avatar blaZ3 commented on August 27, 2024 2

@GurpreetSK95 were you able to solve this? I am also having the same issue with databinding after adding the room annotation processor

from architecture-components-samples.

cacard avatar cacard commented on August 27, 2024 1

火钳流明。You know I am using Chinese.

from architecture-components-samples.

pdog18 avatar pdog18 commented on August 27, 2024

@wafer-li 不行啊..加上这个build.gradle不通过

Error:(47, 0) Could not find method javaCompileOptions() for arguments [build_5ysf0fcwfxj8vp2lg0uw45bf1$_run_closure1$_closure8@6b28c7e9] on object of type com.android.build.gradle.AppExtension.
<a href="openFile:C:\Users\pdog18\Desktop\android-architecture-components-master\BasicSample\app\build.gradle">Open File</a>

我试了下clean 然后还是报错,但是项目可以跑起来了

from architecture-components-samples.

pdog18 avatar pdog18 commented on August 27, 2024

@GurpreetSK95 thanks , i see my databinding is always enable;
then i clean the project and run again,unfortunate ,error again ,but app can running on the avd, i don't know why ..it make me stupid

from architecture-components-samples.

imGurpreetSK avatar imGurpreetSK commented on August 27, 2024

Still doesn't work

from architecture-components-samples.

JoseAlcerreca avatar JoseAlcerreca commented on August 27, 2024

Does this only happen in Windows? For me that's just a warning.

from architecture-components-samples.

yigit avatar yigit commented on August 27, 2024

That schema thing is just a warning so cannot be the problem.
Can you try running ./gradlew asDeb --debug from command line and sharing the output?

from architecture-components-samples.

danilodequeiroz avatar danilodequeiroz commented on August 27, 2024

I'm facing the same problem, just did what @yigit said, follow the output:
https://gist.github.com/dzfacts/0a02723bce4f42d0fa7bf15d375dce11

from architecture-components-samples.

teaphy avatar teaphy commented on August 27, 2024

I think we can try, speak English by Chinese!!!

from architecture-components-samples.

liuwenping828 avatar liuwenping828 commented on August 27, 2024

Error:Execution failed for task ':app:transformJackWithJackForDebug'.

java.lang.AssertionError: No yet implemented

from architecture-components-samples.

kaikaifly avatar kaikaifly commented on August 27, 2024

@liuwenping828 do you solve this problem? 你解决了这个问题没

from architecture-components-samples.

blaZ3 avatar blaZ3 commented on August 27, 2024

I am also getting the databinding classes not found after adding the this line
annotationProcessor "android.arch.persistence.room:compiler:1.0.0-alpha5"

from architecture-components-samples.

zhan2046 avatar zhan2046 commented on August 27, 2024

@GurpreetSK95 were you able to solve this? I am also having the same issue with databinding after adding the room annotation processor

from architecture-components-samples.

dewoch971 avatar dewoch971 commented on August 27, 2024

Someone found a solution? I also have the same issue

from architecture-components-samples.

xrnd avatar xrnd commented on August 27, 2024

I had similar issue after adding Room in my existing application. BR errors hide the actual error in the code. I took steps below and could see the java error and once they were solved, my code worked perfectly fine

For Project gradle
Gradle Plugin Version classpath 'com.android.tools.build:gradle:3.0.1'
and Gradle verison gradle-4.1-all.zip

For app gradle
For Data binding in app.gradle

dataBinding {
       enabled = true
       version '2.3.0'
   }

App dependencies for Room
implementation 'android.arch.persistence.room:runtime:1.0.0'
No Dependency for Data binding and other architectural components as of now

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xmaxerrs" << "5000"
        }
    }
}

defaultConfig{
  javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
}

After syncing my code I could actually see the Room errors instead of BR errors. The culprit was annotationProcessor 'android.arch.persistence.room:compiler:1.0.0' in app.gradle dependency.
Hope this helps someone

UPDATE:

To Run I the code fine, I had to Rebuild the project and could see room related errors then only. Check my answer https://stackoverflow.com/questions/48356496/room-annotation-processor-with-data-binding/48379815#48379815

from architecture-components-samples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.