-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
Description
Android build fails with Kotlin compilation errors in [email protected]:
e: RCTTabView.kt:260:48 Unresolved reference 'badgeBackgroundColor'.
e: RCTTabView.kt:272:48 Unresolved reference 'badgeTextColor'.
e: RCTTabView.kt:266:48 Unresolved reference 'colorError'.
Root Cause
RCTTabView.kt (lines 260-283) accesses item.badgeBackgroundColor and item.badgeTextColor, but these properties are missing from the TabInfo data class in RCTTabViewManager.kt.
The TabInfo data class currently has:
data class TabInfo(
val key: String,
val title: String,
val badge: String?,
val activeTintColor: Int?,
val hidden: Boolean,
val testID: String?
)But RCTTabView.kt expects:
item.badgeBackgroundColoritem.badgeTextColor
Additionally, com.google.android.material.R.attr.colorError is unresolved, likely due to Material library version compatibility.
Steps to Reproduce
- Install
[email protected] - Run Android build:
./gradlew assembleDebug - Build fails with the above errors
Environment
- react-native-bottom-tabs: 1.0.4
- React Native: 0.82.1
- Gradle: 9.0.0
Suggested Fix
- Add missing properties to
TabInfodata class:
data class TabInfo(
val key: String,
val title: String,
val badge: String?,
val badgeBackgroundColor: Int?,
val badgeTextColor: Int?,
val activeTintColor: Int?,
val hidden: Boolean,
val testID: String?
)- Populate them in
setItems():
badgeBackgroundColor = if (item.hasKey("badgeBackgroundColor")) item.getInt("badgeBackgroundColor") else null,
badgeTextColor = if (item.hasKey("badgeTextColor")) item.getInt("badgeTextColor") else null,- Simplify badge color application to avoid
colorErrorresolution:
item.badgeBackgroundColor?.let { badge.backgroundColor = it }
item.badgeTextColor?.let { badge.badgeTextColor = it }I'm happy to submit a PR with these fixes.
Metadata
Metadata
Assignees
Labels
No labels