Fixed
Status Update
Comments
yb...@google.com <yb...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
ro...@gmail.com <ro...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
ro...@gmail.com <ro...@gmail.com> #4
deleted
yb...@google.com <yb...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
yb...@google.com <yb...@google.com> #6
fixed in beta3.
Description
Version used:
Devices/Android versions reproduced on: Android API 26
- Sample project is here:
- Kotlin annotation processor throws this error: "e: [kapt] An exception occurred: java.lang.IllegalArgumentException: ? extends com.codepath.apps.restclienttemplate.models.Tweetcannot be converted to an Element".
The particular line in question is here:
@Query("SELECT * FROM User WHERE userId = :id")
UserTweetsFail byId(long id); // change to UserTweetsWorks to see this pass
Where UserTweetsFail.kt is:
class UserTweetsFail {
@Embedded var user: User? = null
@Relation(parentColumn = "userId", entityColumn = "id", entity=Tweet::class)
var tweets: List<Tweet> = listOf()
}
If I change to use UserTweetWorks to use the Java version
UserTweetWorks.java:
public class UserTweetsWorks {
@Embedded
User user;
@Relation(parentColumn = "userId", entityColumn = "id", entity=Tweet.class)
List<Tweet> tweets;
}
The difference seems to be that a Kotlin collection of tweets is essentially:
@Relation(parentColumn = "userId", entityColumn = "id", entity=Tweet.class)
List<? extends Tweet> tweets;
This seems to break the Auto library, since the list is now a subtype of Tweet.
I'm confused why this didn't show up in the integration tests in AOSP -- there seems to be an exact class (