Fixed
Status Update
Comments
vi...@google.com <vi...@google.com>
vi...@google.com <vi...@google.com>
yb...@google.com <yb...@google.com> #2
What about Enums? Enum is a type-safe way to pass navigation arguments.
Will Enums be covered in this issue as part of Serializable or will have own handled separately?
Because for enum you can provide a reasonable default value but for Parcelable or Serializable only @null
Will Enums be covered in this issue as part of Serializable or will have own handled separately?
Because for enum you can provide a reasonable default value but for Parcelable or Serializable only @null
he...@gmail.com <he...@gmail.com> #3
Please add support for Serializable objects so Enums can be used.
yb...@google.com <yb...@google.com> #4
Support of Serializable objects is not enough for enums, you definitely need also the support of default values.
he...@gmail.com <he...@gmail.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Author: Wojtek Kaliciński <wkal@google.com>
Date: Mon Jul 23 20:17:19 2018
Support more types for args
Provides support for Serializable, enums,
as well as arrays of primitive types and Parcelables
in Navigation arguments.
Only enums support default values other than @null,
in the form of the enum literal (without class name),
e.g. app:defaultValue="READ"
Test: unit tests updated
BUG: 111487504
BUG: 111316353
Change-Id: I7e5abbc8ed0950bfdef292342dbe1fb34a5c4b17
M navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/test/TestEnum.java
M navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavWriterTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/MainFragmentArgs.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
https://android-review.googlesource.com/720246
https://goto.google.com/android-sha1/6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Branch: androidx-master-dev
commit 6f59e3d74d0da5a4bf79c8480f56964e3af47f1c
Author: Wojtek Kaliciński <wkal@google.com>
Date: Mon Jul 23 20:17:19 2018
Support more types for args
Provides support for Serializable, enums,
as well as arrays of primitive types and Parcelables
in Navigation arguments.
Only enums support default values other than @null,
in the form of the enum literal (without class name),
e.g. app:defaultValue="READ"
Test: unit tests updated
BUG: 111487504
BUG: 111316353
Change-Id: I7e5abbc8ed0950bfdef292342dbe1fb34a5c4b17
M navigation/runtime/src/androidTest/java/androidx/navigation/NavInflaterTest.kt
A navigation/runtime/src/androidTest/java/androidx/navigation/test/TestEnum.java
M navigation/runtime/src/androidTest/res/navigation/nav_default_arguments.xml
M navigation/runtime/src/main/java/androidx/navigation/NavInflater.java
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParser.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavParserErrors.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/NavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/Types.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavWriterTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/MainFragmentArgs.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
ap...@google.com <ap...@google.com> #6
This is fixed internally and will be available in 1.0.0-alpha08
ap...@google.com <ap...@google.com> #7
What happened if I declaire app:argType="androidx.navigation.test.TestEnum" and turn on proguard/R8? Because both ProGuard and R8 will optimize trivial enums into ints.
ap...@google.com <ap...@google.com> #8
yb...@google.com <yb...@google.com>
it...@gmail.com <it...@gmail.com> #9
Thanks. Just saw the latest documentation.
yb...@google.com <yb...@google.com> #10
it is only on master, this might take a while to release as we'll probably make a minor version bump and an alpha to ensure it works fine.
meanwhile, you can try it via:
Room master is fairly stable so there is less risk in using its snapshots (but of course, they are snapshots so there is some risk of instability :) )
Description
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1error: cannot generate view binders java.lang.StackOverflowError
And then a list of calls that caused the java.lang.StackOverflowError
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:209)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211)
at android.databinding.tool.expr.Expr.resolveListeners(Expr.java:211) (etc)
It seems that it is known issue with data binding and room mismatch from what I read online but the solution of forcing a particular version of antlr4 doesn't work for me.
When forcing a version of antlr4 like so
configurations.all() {
resolutionStrategy.force "org.antlr:antlr4-runtime:4.5.3"
resolutionStrategy.force "org.antlr:antlr4-tool:4.5.3"
}
I can;'t compile Room with error Caused by: java.lang.ClassNotFoundException: org.antlr.v4.runtime.CharStreams
when forcing it to 4.7.1 it does nothing. Same error with version mismatch. Downgrading Room does nothing.