Comments (20)
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.
For me, it also says package com.example.android.persistence.databinding does not exist; cannot find symbol class CommentItemBinding
from architecture-components-samples.
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.
@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:
from architecture-components-samples.
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.
@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.
火钳流明。You know I am using Chinese.
from architecture-components-samples.
@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.
@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.
Still doesn't work
from architecture-components-samples.
Does this only happen in Windows? For me that's just a warning.
from architecture-components-samples.
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.
I'm facing the same problem, just did what @yigit said, follow the output:
https://gist.github.com/dzfacts/0a02723bce4f42d0fa7bf15d375dce11
from architecture-components-samples.
I think we can try, speak English by Chinese!!!
from architecture-components-samples.
Error:Execution failed for task ':app:transformJackWithJackForDebug'.
java.lang.AssertionError: No yet implemented
from architecture-components-samples.
@liuwenping828 do you solve this problem? 你解决了这个问题没
from architecture-components-samples.
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.
@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.
Someone found a solution? I also have the same issue
from architecture-components-samples.
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)
- 'WorkManagerSample' should use Hilt and App Startup library to initialize and provide WorkManager dependency
- NavigationAdvancedSample doesnt save/restore RecyclerView state HOT 2
- GithubBrowserSample is too older
- Execution failed for task ':lib:compileDebugRenderscript'.
- GithubBrowserSample", "BasicRxJavaSampleKotlin", etc.) and include it in the title if it applies.
- the web page is displayed in the webView when the button is clicked. 当点击按钮时在webView显示网页。 HOT 4
- [PagingSample] UI test fails
- [GithubBrowserSample] Multiple tests fail after version bumps
- [WorkManagerSample] Toast.show called in a worker, throwing a silent error
- [MadSkillsSample] Consider deprecation
- [ViewBinding] Get the `View` type instead of `XxxxBinding` when using the <include /> and the layout file is in the classes (aar) HOT 1
- Sample need to update in order to deploy in Android Studio
- Unable to build MADSkillsNavigation sample HOT 2
- PhotoDaoTest.kt: (57, 35): Type mismatch: inferred type is Photo but PhotoEntity was expected
- ClassCastException java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType HOT 1
- How to not to save state in latest navigation component library
- Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
- 0
- MX TakaTak pLaYeR
- 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from architecture-components-samples.