Skip to content

LinearGradient with MaskedView not working on Android #32934

Closed
@bhavesh-trentium

Description

@bhavesh-trentium

Minimal reproducible example

its working well on iOS but on a Android not. On an Android, it shows a Red Color Background

What platform(s) does this occur on?

Android

Where did you reproduce the issue?

in a development build

Summary

I am using a MaskedView and LinearGradient. To create a GradientText its working well on iOS but on a Android not.
On an Android, it shows a Red Color Background.

import { LinearGradient } from 'expo-linear-gradient';
import MaskedView from '@react-native-masked-view/masked-view';

 <MaskedView maskElement={<Text style={style}>{text}</Text>}>
      <LinearGradient
        start={{ x: 0, y: 0 }}
        end={{ x: 1, y: 1 }}
        colors={textColor}>
        <Text style={[style, { opacity: 0 }]}>{text}</Text>
      </LinearGradient>
    </MaskedView>
 "react-native": "0.72.6",
  "expo": "^49.0.21",
  "expo-linear-gradient": "~12.3.0",
  "@react-native-masked-view/masked-view": "0.2.9",

ANDROID

screenshot_2024-11-14-16-27-15-433_io smatchit app_720

iOS

image

Environment

expo-env-info 1.2.1 environment info:
    System:
      OS: Windows 11 10.0.22631
    Binaries:
      Node: 20.18.0 - C:\Program Files\nodejs\node.EXE
      Yarn: 1.22.22 - ~\AppData\Roaming\npm\yarn.CMD
      npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    SDKs:
      Android SDK:
        API Levels: 30, 33, 34, 35
        Build Tools: 30.0.3, 33.0.0, 33.0.1, 34.0.0, 35.0.0
        System Images: android-30 | Google Play Intel x86 Atom, android-34 | Google APIs Intel x86_64 Atom, android-VanillaIceCream | Google Play Intel x86_64 Atom
    IDEs:
      Android Studio: AI-242.23339.11.2421.12550806
    Expo Workflow: managed

Expo Doctor Diagnostics

Not working this on my command

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs reviewIssue is ready to be reviewed by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions