Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
since these are in public API (:/) we need to do this in 1.2
wo...@gmail.com <wo...@gmail.com> #3
since it is already marked as deprecated, we can probably do it by now.
wo...@gmail.com <wo...@gmail.com> #4
Opening diff shortly
mm...@commonsware.com <mm...@commonsware.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/61 .
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
https://android-review.googlesource.com/1396827
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request from
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
yb...@google.com <yb...@google.com> #7
this is actually a limitation of java where we cannot read the parameter names for classes coming from dependencies :/
we've fixed this for kotlin in 1.1 -alpha2. For java, we'll need to introduce a new annotation to specify names :/.
we've fixed this for kotlin in 1.1 -alpha2. For java, we'll need to introduce a new annotation to specify names :/.
wo...@gmail.com <wo...@gmail.com> #8
Nice, when will this come out?
Currently I'm heading towards sqldelight for all module entities and would like to switch back to room before our next release.
Currently I'm heading towards sqldelight for all module entities and would like to switch back to room before our next release.
yb...@google.com <yb...@google.com> #9
if you are using kotlin, it will come out in a couple of hours.
for java, might take longer
for java, might take longer
yb...@google.com <yb...@google.com> #10
s/might/will
wo...@gmail.com <wo...@gmail.com> #11
Nice, thanks for adressing this :)
Nope, no java in here ;)
Nope, no java in here ;)
yb...@google.com <yb...@google.com> #12
1,1-alpha2 is out now, lmk if it works.
wo...@gmail.com <wo...@gmail.com> #13
Thanks. It's partly fixed. I updated my sample project:
https://github.com/PaulWoitaschek/RoomMultiModuleBug
The property names on the data classes do now work. The dao interface parameter names don't work and still have to be called arg0 etc.:
https://github.com/PaulWoitaschek/RoomMultiModuleBug/blob/master/library/src/main/java/de/paul_woitaschek/roombug/library/LibraryDao.kt#L10
The property names on the data classes do now work. The dao interface parameter names don't work and still have to be called arg0 etc.:
wo...@gmail.com <wo...@gmail.com> #14
It looks like you can use the metadata annotation for interfaces too.
For example if I have this simple dao interface:
https://gist.github.com/PaulWoitaschek/e26d0e4f53460710c8caba9e995eb06d
It will producte the following Metadata annotation in byte code:
d2={"Lcom/yazio/android/misc/repo/MyDao;", "", "get", "Ljava/io/File;", "id", "", "production sources for module app"})
So all the information we need is there.
For example if I have this simple dao interface:
It will producte the following Metadata annotation in byte code:
d2={"Lcom/yazio/android/misc/repo/MyDao;", "", "get", "Ljava/io/File;", "id", "", "production sources for module app"})
So all the information we need is there.
yb...@google.com <yb...@google.com> #15
thanks. i'll take a look at it.
yb...@google.com <yb...@google.com> #16
ugh my bad, i totally missed the part about parsing dao methods :/ .
wo...@gmail.com <wo...@gmail.com> #18
Works, thank you!
be...@gmail.com <be...@gmail.com> #19
Hi, I have used "1.1.0-alpha3" but the problem still happened. When I builded the project, there showed some error like this:
错误: Each bind variable in the query must have a matching method parameter. Cannot find method parameters for :userIds.
错误: Unused parameter: arg0
错误: Each bind variable in the query must have a matching method parameter. Cannot find method parameters for :first, :last.
错误: Unused parameters: arg0,arg1
4 个错误
Here is my projecthttps://github.com/beyondbright/AndroidArchitectureSample
Did I miss something? Please help me. Thanks.
错误: Each bind variable in the query must have a matching method parameter. Cannot find method parameters for :userIds.
错误: Unused parameter: arg0
错误: Each bind variable in the query must have a matching method parameter. Cannot find method parameters for :first, :last.
错误: Unused parameters: arg0,arg1
4 个错误
Here is my project
Did I miss something? Please help me. Thanks.
wo...@gmail.com <wo...@gmail.com> #20
Yes, you need to use kotlin if you want that. The information gets not contained in the way it works right now for java.
Maybe reopen the issue till it's fixed for java too, Yigit?
Maybe reopen the issue till it's fixed for java too, Yigit?
be...@gmail.com <be...@gmail.com> #21
Everything was OK before I put the UserDao into the library module.
be...@gmail.com <be...@gmail.com> #22
Sorry. I know it now. But I use java not kotlin.
I can not use room in our project because of the issue. There are some modules in our project and I have to put the Dao into the library module.
Really hope it works for java.
I can not use room in our project because of the issue. There are some modules in our project and I have to put the Dao into the library module.
Really hope it works for java.
ka...@beehyv.com <ka...@beehyv.com> #23
I am using the java module 2.2.2 and still getting the same errors. However when I build again, it goes away, but having to build the module multiple times is really annoying.
yb...@google.com <yb...@google.com>
ra...@gmail.com <ra...@gmail.com> #24
Still the same problem in 2021. Always need to compile twice. This bug is not "fixed" (for Java)!
da...@google.com <da...@google.com> #25
Use javac -parameters
compiler flag so parameter names are compiled into the .class files and Room is able to read them when inspecting compiled code.
See
fa...@gmail.com <fa...@gmail.com> #26
I have the same problem again using Kotlin 1.7.10.
Does anyone know if this bug just appeared again?
Does anyone know if this bug just appeared again?
mo...@mindtickle.com <mo...@mindtickle.com> #27
yes, I'm facing this issue on kotlin version 1.9.20 as well. Has anyone found any solution for this other than naming arguments to arg0 etc?
du...@gmail.com <du...@gmail.com> #28
I am also facing this problem with Kotlin 1.9.23, please help to check. I don't want to rename to arg0, arg1,...
Description
Version used: 1.0.0-beta2
Devices/Android versions reproduced on:
Consider the following code, added in an android library module (AAR):
@Entity(tableName = "my_table")
public class MyTable {
@PrimaryKey
@NonNull
public String id;
}
@Dao
public interface MyTableDao {
@Query("SELECT * FROM my_table WHERE id = :id")
LiveData<List<MyTable>> sampleQuery(String id);
}
The actual database is instantiated in the app module. When compiling, I receive the following error:
Error:Each bind variable in the query must have a matching method parameter. Cannot find method parameters for :id.
Error:Unused parameter: arg0
Renaming ":id" to ":arg0" in the query fixes the issue. It seems that AAR packages lose the parameter names, and this causes Room to fail to bind the parameters correctly. A similar issue happens when an entity constructor has a parameter ("Error:Entities and Pojos must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).").