GithubHelp home page GithubHelp logo

iyegoroff / react-native-text-gradient Goto Github PK

View Code? Open in Web Editor NEW
92.0 3.0 29.0 2.31 MB

Text gradient for React-Native (ON HIATUS)

License: MIT License

Java 38.79% JavaScript 19.66% Objective-C 36.65% Dockerfile 0.46% Ruby 0.98% Starlark 3.47%
react-native text-gradients

react-native-text-gradient's Introduction

react-native-text-gradient

npm version Dependency Status typings included npm

React-Native text gradient component for iOS & Android.

Status

🚧🚧🚧

Currently rntg is on hiatus, but I'll update it someday. Last supported react-native version is "0.59.10".

🚧🚧🚧

  • Component works as drop-in replacement for standard Text component and it is possible to have nested gradients.
  • React-Native:
    • with rn >= 0.59.0 use latest version and patch;
    • with rn >= 0.56.0 use 0.0.17 and patch;
    • with rn >= 0.55.0 use 0.0.9;
    • with rn >= 0.54.0 use 0.0.7;
    • with rn >= 0.53.1 use 0.0.4;
    • rn 0.53.0 is not supported;
    • with rn >= 0.50.0 use 0.0.3.

Getting started

$ npm install react-native-text-gradient --save

Mostly automatic installation

$ react-native link react-native-text-gradient

Manual installation

link

If you are using Cocoapods you need to follow the manual installation guide.

Example

import { LinearTextGradient } from "react-native-text-gradient";

<LinearTextGradient
  style={{ fontWeight: "bold", fontSize: 72 }}
  locations={[0, 1]}
  colors={["red", "blue"]}
  start={{ x: 0, y: 0 }}
  end={{ x: 1, y: 0 }}
>
  THIS IS TEXT GRADIENT
</LinearTextGradient>;
iOS Android

Usage

LinearTextGradient

Interface is similar to Text & LinearGradient

colors

An array of at least two color values that represent gradient colors. Example: ['red', 'blue'] sets gradient from red to blue.

start

An optional object of the following type: { x: number, y: number }. Coordinates declare the position that the gradient starts at, as a fraction of the overall size of the gradient, starting from the top left corner. Example: { x: 0.1, y: 0.1 } means that the gradient will start 10% from the top and 10% from the left.

end

Same as start, but for the end of the gradient.

locations

An optional array of numbers defining the location of each gradient color stop, mapping to the color with the same index in colors prop. Example: [0.1, 0.75, 1] means that first color will take 0% - 10%, second color will take 10% - 75% and finally third color will occupy 75% - 100%.

useViewFrame

Optional. If true gradient will be calculated for text view background frame rather than text frame.

<LinearTextGradient
  numberOfLines={1}
  useViewFrame={true}
  locations={[0.5, 0.95]}
  // note colors like '#FF000000' are used for seamless transition to transparent
  colors={["#FF0000", "#FF000000"]}
  start={{ x: 0, y: 0 }}
  end={{ x: 1, y: 0 }}
>
  %%%%%%%%%%%%%%%%%%%%%%
</LinearTextGradient>

Usage with rn >= 0.56.0

Wait until facebook/react#13211 will be merged or patch react-native to remove failing invariant checks

$ node node_modules/react-native-text-gradient/patch-rn.js

Caveats

When mixing several text gradients and Texts top component always should be text gradient.

<LinearTextGradient {...someGradientProps}>
  <Text>123</Text>
  qwerty
  <LinearTextGradient {...anotherGradientProps}>321</LinearTextGradient>
</LinearTextGradient>

This is necessary because only top text component is 'mapped' to actual native node and its children are 'virtual' from the native perspective.

react-native-text-gradient's People

Contributors

cmmartin avatar dependabot[bot] avatar eaa avatar iyegoroff avatar ofir-oron avatar rowinbot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-native-text-gradient's Issues

Getting No ViewManager defined for class RNLinearTextGradient

"react-native-text-gradient": "0.0.13",
"react-native": "~0.55.2",

I ran rnpm link react-native-text-gradient

npm-link info Android module react-native-text-gradient is already linked
rnpm-link info iOS module react-native-text-gradient is already linked
rnpm-link info Linking assets to ios project
rnpm-link info Linking assets to android project
rnpm-link info Assets has been successfully linked to your project

How can i fix this issue?

Patch for RN >= 0.60

This package not work with rn 0.60.
But simply change the pattern in patch-rn.js with this.

const pattern = new RegExp(
'throw[\s\S]{0,40}' +
'"Text strings must be rendered within a component\."[\s\S]{0,20}' +
'\)[;,]'
);

Thanks.

'RCTTextShadowView.h' file not found

My build failed with this message, and the simulator shows:
No component found for view with name "RNLinearTextGradient"
Using the latest version 0.0.8

ArithmeticException: divide by zero exception on Android

I'm using this library and we got this error from a production build.

Not sure what to look for so I'm just printing here the stack trace. Device is LG K20 V, running android 7.0

Caused by: java.lang.ArithmeticException: divide by zero at iyegoroff.RNTextGradient.Linear.RNLinearTextGradientSpan.isMultiline(RNLinearTextGradientSpan.java:109) at iyegoroff.RNTextGradient.Linear.RNLinearTextGradientSpan.updateDrawState(RNLinearTextGradientSpan.java:80) at android.text.TextLine.handleRun(TextLine.java:957) at android.text.TextLine.measureRun(TextLine.java:395) at android.text.TextLine.measure(TextLine.java:285) at android.text.TextLine.metrics(TextLine.java:259) at android.text.BoringLayout.isBoring(BoringLayout.java:310) at android.text.BoringLayout.isBoring(BoringLayout.java:220) at com.facebook.react.views.text.ReactTextShadowNode$1.measure(ReactTextShadowNode.java:61) at com.facebook.yoga.YogaNode.measure(YogaNode.java:654) at com.facebook.yoga.YogaNode.jni_YGNodeCalculateLayout(YogaNode.java:-2) at com.facebook.yoga.YogaNode.calculateLayout(YogaNode.java:198) at com.facebook.react.uimanager.ReactShadowNodeImpl.calculateLayout(ReactShadowNodeImpl.java:512) at com.facebook.react.uimanager.UIImplementation.calculateRootLayout(UIImplementation.java:942) at com.facebook.react.uimanager.UIImplementation.updateViewHierarchy(UIImplementation.java:694) at com.facebook.react.uimanager.UIImplementation.dispatchViewUpdates(UIImplementation.java:654) at com.facebook.react.uimanager.UIManagerModule.updateRootLayoutSpecs(UIManagerModule.java:754) at com.facebook.react.ReactRootView$1.runGuarded(ReactRootView.java:396) at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:21) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29) at android.os.Looper.loop(Looper.java:154) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:192) at java.lang.Thread.run(Thread.java:761)

Add Cocoapods integration

Kind of issue
Feature request

platform: iOS 12.0
react-native: 0.57.2
react-native-text-gradient: 0.0.16

Description

I'm currently unable to use this amazing project alongside with Cocoapods, if you do link the project and build it from Xcode it highlights build errors because of the missing React header search paths (which are handled by Cocoapods). So it would be very helpful if you include support for Cocoapods in this library.

If you like I may be likely to submit a PR to include support for it...

Thanks in advance!

React native 0.60.5 version error

@iyegoroff, When I used the react-native-text-gradient library. it shows this error "Text strings must be rendered within a component". it was working fine in the previous react-native version library. when I update the react-native version it shows this error. note I run the patch-rn.js command.

Update compiledSdkVersion to 25

  • Platform: Android
  • React Native version: 0.56
  • React Native Text Gradient version: 0.0.8

React Native 0.56 requires sdk version to be at least 25.0 but react-native-text-gradient still uses 23.0.

Error output:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
   > A problem occurred configuring project ':react-native-text-gradient'.
      > The SDK Build Tools revision (23.0.1) is too low for project ':react-native-text-gradient'. Minimum required is 25.0.0

Showing error 'Text strings must be rendered within a <Text> component'

After creating .apk file and install in my android device i got this error 'Text strings must be rendered with in a text component'. I have used the patch that is in the document before creating offline bundle. Still the issue is happening and the app continuosuly crashes in IOS. Any work around for this issue.

'RNShadowTextGradient.h' file not found

Don't see this file in the repo either...


❌  .../ios/Pods/ReactNativeTextGradient/ios/RNShadowRadialTextGradient.h:1:9: 'RNShadowTextGradient.h' file not found

#import "RNShadowTextGradient.h"
        ^~~~~~~~~~~~~~~~~~~~~~~~```

Gradient breaks when onPress added

iOS
react-native v0.55.4
react-native-text-gradient v0.0.9

The gradient works great until I pass it an onPress prop. Then, the entire text becomes a single color, which happens to be the last value passed to the colors prop.

Any idea how I can accomplish a touchable text gradient? Is it supported in this version?

Applying patch on latest version of rn-0.61.2, gives error

UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, scandir 'node_modules/react-native/Libraries/Renderer/oss/'
(node:19538) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19538) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

system info -

System:
OS: macOS Mojave 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 328.72 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.4.1 - ~/.nvm/versions/node/v10.4.1/bin/node
npm: 6.1.0 - ~/.nvm/versions/node/v10.4.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 23.0.1, 25.0.3, 26.0.2, 27.0.3, 28.0.0, 28.0.2, 28.0.3, 29.0.2
System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom
IDEs:
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
@react-native-community/cli: ^2.9.0 => 2.9.0
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-create-library: 3.1.2

react-native-text-gradient not working for RN version 0.57.4 Error

for RN version 0.55.2 getting below Error.
: Unable to resolve module react-native/Libraries/Text/TextAncestor from C:\Users\CR-27\creatise\claptest\node_modules\react-native-text-gradient\src\create-text-gradient-class.js: Module react-native/Libraries/Text/TextAncestor does not exist in the Haste module map

Text gradient work with Animated?

I Tried using react-native-text-gradient with Animated but I couldn't get it to work.

componentDidMount() {
        this.AniColor =
            Animated.timing(              
                this.state.color,         
                {
                    toValue: 1,                   
                    duration: 2000,            
                    easing: Easing.linear,
                }
            );
    }
...
this.textGrad = this.state.color.interpolate({
            inputRange: [0, 1],
            outputRange: [0, 1],
});
<Animated.View>
                    <LinearTextGradient
                        locations={[0, 1]}
                        colors={[this.screen_color, 'black']}
                        start={{x: 0, y: 0}}
                        end={{x: this.textGrad, y: 0}}
                    >
                        This is Text
                    </LinearTextGradient>
                </Animated.View>

When starting the animation it crashes with

Cannot add property _tracking, object is not extensible.

Use with latest RN v0.63

We can use this package by patching react-native using patch-package

And adding react-native+0.63.3.patch file in patches directory

diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.fb.js
index 2a462f4..43471ca 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.fb.js
@@ -3850,9 +3850,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText) {
-    throw Error("Text strings must be rendered within a <Text> component.");
-  }
 
   var tag = nextReactTag;
   nextReactTag += 2;
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js
index 8e2baed..c177949 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-dev.js
@@ -3851,9 +3851,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText) {
-    throw Error("Text strings must be rendered within a <Text> component.");
-  }
 
   var tag = nextReactTag;
   nextReactTag += 2;
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.fb.js
index 278eba5..fce3887 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.fb.js
@@ -1547,8 +1547,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText)
-    throw Error("Text strings must be rendered within a <Text> component.");
   hostContext = nextReactTag;
   nextReactTag += 2;
   return {
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js
index 7df0e13..af6fcfe 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-prod.js
@@ -1548,8 +1548,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText)
-    throw Error("Text strings must be rendered within a <Text> component.");
   hostContext = nextReactTag;
   nextReactTag += 2;
   return {
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
index be0ac55..af25b02 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.fb.js
@@ -1548,8 +1548,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText)
-    throw Error("Text strings must be rendered within a <Text> component.");
   hostContext = nextReactTag;
   nextReactTag += 2;
   return {
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js
index cc076b1..388985d 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactFabric-profiling.js
@@ -1549,8 +1549,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText)
-    throw Error("Text strings must be rendered within a <Text> component.");
   hostContext = nextReactTag;
   nextReactTag += 2;
   return {
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
index 8ef9be3..bbdaa99 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.fb.js
@@ -4035,9 +4035,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText) {
-    throw Error("Text strings must be rendered within a <Text> component.");
-  }
 
   var tag = allocateTag();
   ReactNativePrivateInterface.UIManager.createView(
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
index d837754..9980be5 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-dev.js
@@ -4036,9 +4036,6 @@ function createTextInstance(
   hostContext,
   internalInstanceHandle
 ) {
-  if (!hostContext.isInAParentText) {
-    throw Error("Text strings must be rendered within a <Text> component.");
-  }
 
   var tag = allocateTag();
   ReactNativePrivateInterface.UIManager.createView(
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js
index f32dc56..acdd6a5 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.fb.js
@@ -4603,10 +4603,6 @@ function completeWork(current, workInProgress, renderExpirationTime) {
             "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
           );
         current = requiredContext(rootInstanceStackCursor.current);
-        if (!requiredContext(contextStackCursor$1.current).isInAParentText)
-          throw Error(
-            "Text strings must be rendered within a <Text> component."
-          );
         rootContainerInstance = allocateTag();
         ReactNativePrivateInterface.UIManager.createView(
           rootContainerInstance,
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js
index 31b089c..cb7b67b 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-prod.js
@@ -4604,10 +4604,6 @@ function completeWork(current, workInProgress, renderExpirationTime) {
             "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
           );
         current = requiredContext(rootInstanceStackCursor.current);
-        if (!requiredContext(contextStackCursor$1.current).isInAParentText)
-          throw Error(
-            "Text strings must be rendered within a <Text> component."
-          );
         rootContainerInstance = allocateTag();
         ReactNativePrivateInterface.UIManager.createView(
           rootContainerInstance,
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js
index 2bac9e2..3da0259 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.fb.js
@@ -4654,10 +4654,6 @@ function completeWork(current, workInProgress, renderExpirationTime) {
             "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
           );
         current = requiredContext(rootInstanceStackCursor.current);
-        if (!requiredContext(contextStackCursor$1.current).isInAParentText)
-          throw Error(
-            "Text strings must be rendered within a <Text> component."
-          );
         rootContainerInstance = allocateTag();
         ReactNativePrivateInterface.UIManager.createView(
           rootContainerInstance,
diff --git a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js
index c817401..e59ac11 100644
--- a/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js
+++ b/node_modules/react-native/Libraries/Renderer/implementations/ReactNativeRenderer-profiling.js
@@ -4655,10 +4655,6 @@ function completeWork(current, workInProgress, renderExpirationTime) {
             "We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."
           );
         current = requiredContext(rootInstanceStackCursor.current);
-        if (!requiredContext(contextStackCursor$1.current).isInAParentText)
-          throw Error(
-            "Text strings must be rendered within a <Text> component."
-          );
         rootContainerInstance = allocateTag();
         ReactNativePrivateInterface.UIManager.createView(
           rootContainerInstance,
diff --git a/node_modules/react-native/scripts/.packager.env b/node_modules/react-native/scripts/.packager.env
new file mode 100644
index 0000000..361f5fb
--- /dev/null
+++ b/node_modules/react-native/scripts/.packager.env
@@ -0,0 +1 @@
+export RCT_METRO_PORT=8081

Greyed out rerender on Android occasionally.

Environment:
Android : 11 (different devices Motorola, Xiaomi, etc).
react-native: 0.63.4
react-native-text-gradient : 0.1.7

Hi,
We're experiencing some weird issue from time to time when our page is rerendered.
We have a Linear Text gradient rendered with these exact props:
<LinearTextGradient locations={[0, 0.33, 0.66, 1]} colors=['#004FFF', '#CB06ED', '#FF0062', '#FF8500']>{text}
Please note that we never change locations or colors props, only text changes and causes rerenders.

Please see the screenshots below:
1633689141506
1633689141500
Thank you your help.

[Android RN 0.60 ] - java.lang.OutOfMemoryError

System:
OS: macOS Mojave 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-8210Y CPU @ 1.60GHz
Memory: 18.01 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.3.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5900203
Xcode: 11.0/11A420a - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.0 => 0.60.0
npmGlobalPackages:
react-native-cli: 2.0.1

Test-case

install package 'yarn' > Link package > Apply text > Keep the emulator idle for sometime > Crash

Below is the code

                        <LinearTextGradient
                            locations={[0, 1]}
                            colors={[Colors.blue_v, Colors.blue_f]}
                            start={{ x: 0, y: 0 }}
                            end={{ x: 1, y: 0 }}
                         >
                            <Text>Text</Text>
                        </LinearTextGradient>

Here is the crash log

 at java.lang.Throwable.nativeFillInStackTrace(Native method)
        at java.lang.Throwable.fillInStackTrace(Throwable.java:799)
        at java.lang.Throwable.<init>(Throwable.java:277)
        at java.lang.Error.<init>(Error.java:70)
        at java.lang.VirtualMachineError.<init>(VirtualMachineError.java:53)
        at java.lang.OutOfMemoryError.<init>(OutOfMemoryError.java:58)
W/vax.geekygaura:     at android.widget.TextView.setText(TextView.java:6278)
W/vax.geekygaura:     at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
W/vax.geekygaura:     at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)
        at android.widget.TextView.setText(TextView.java:6278)
        at android.widget.TextView.setText(TextView.java:6097)
        at android.widget.TextView.setText(TextView.java:6049)
        at com.facebook.react.views.text.ReactTextView.setText(ReactTextView.java:260)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1$1.run(RNShadowTextGradient.java:240)
        at iyegoroff.RNTextGradient.RNShadowTextGradient$1$1.run(RNShadowTextGradient.java:245)
        at iyegoroff.RNTextGradient.OneOffListener.trigger(OneOffListener.java:17)
W/vax.geekygaura:     at iyegoroff.RNTextGradient.RNShadowTextGradient$TextChangeListener.afterTextChanged(RNShadowTextGradient.java:51)
        at android.widget.TextView.sendAfterTextChanged(TextView.java:10551)

[EDITED] πŸ‘ The code works fine. I am getting a beautiful linear gradient text.

cocoapods build failure

react-native version: 0.59
react-native-text-gradient version: 0.1.4

Using cocoapods for all iOS dependencies with use_frameworks!

iOS build fails with
Undefined symbols for architecture x86_64: "_OBJC_IVAR_$_RCTTextShadowView._bridge", referenced from: -[RNTextGradientShadowView uiManagerWillPerformMounting] in RNTextGradientView(RNTextGradientShadowView.o) "_OBJC_IVAR_$_RCTTextView._textStorage", referenced from: -[RNTextGradientView drawRect:] in RNTextGradientView(RNTextGradientView.o) "_OBJC_IVAR_$_RCTTextViewManager._shadowViews", referenced from: -[RNTextGradientViewManager shadowView] in RNTextGradientView(RNTextGradientViewManager.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

[Bug] Production build crashes in RN V0.61.2

App working if debug build
applied patch #31 (comment) works in both minified & debug enabled/disabled but in production build there is a crash.

2019-10-18 17:35:33.634 31236-31236/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: ********, PID: 31236
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
        at iyegoroff.RNTextGradient.k.a(Unknown Source:2)
        at iyegoroff.RNTextGradient.h.resolveView(Unknown Source:34)
        at iyegoroff.RNTextGradient.h.a(Unknown Source:0)
        at iyegoroff.RNTextGradient.g.a(Unknown Source:8)
        at com.facebook.react.uimanager.ea$q.execute(Unknown Source:8)
        at com.facebook.react.uimanager.ca.run(Unknown Source:72)
        at com.facebook.react.uimanager.ea.kia(Unknown Source:53)
        at com.facebook.react.uimanager.ea.j(Unknown Source:0)
        at com.facebook.react.uimanager.ea$g.T(Unknown Source:31)
        at com.facebook.react.uimanager.c.doFrame(Unknown Source:0)
        at com.facebook.react.modules.core.i$b.doFrame(Unknown Source:46)
        at com.facebook.react.modules.core.a.doFrame(Unknown Source:2)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:947)
        at android.view.Choreographer.doCallbacks(Choreographer.java:761)
        at android.view.Choreographer.doFrame(Choreographer.java:693)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6718)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:495)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

element type is invalid

i get this error:
Element type is invalid: expected a string or a class/function(for composite components) but got: object

I changed the import, but did not work:
import LinearTextGradient from 'react-native-text-gradient';

please help

Build Failed in iOS

Getting build failed in iOS only

React/RCTShadowView.h file not found

Done npm link also. what would be the problem?

react-native: 0.51.0
react-native-text-gradient: 0.0.3

Using the right target version:
with rn >= 0.50.0 use 0.0.3.

android apk release error

09-17 11:46:55.448 20714 20714 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at iyegoroff.RNTextGradient.k.a()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at iyegoroff.RNTextGradient.h.j()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at iyegoroff.RNTextGradient.h.a()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at iyegoroff.RNTextGradient.g.a()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.da$p.execute()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.ba.run()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.da.i()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.da.i()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.da$f.b()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.uimanager.c.a()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.modules.core.i$b.a()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.facebook.react.modules.core.a.doFrame()
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:924)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.view.Choreographer.doCallbacks(Choreographer.java:735)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.view.Choreographer.doFrame(Choreographer.java:664)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:912)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:761)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:98)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.os.Looper.loop(Looper.java:156)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6517)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
09-17 11:46:55.448 20714 20714 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)

A problem occurred evaluating project ':app'. > Could not find method compile() for arguments [project ':react-native-text-gradient'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

After Inserting the following lines inside the dependencies block in android/app/build.gradle:

compile project(':react-native-text-gradient')

am get this error message below when am trying to for andriod app

A problem occurred evaluating project ':app'. >
Could not find method compile() for arguments [project ':react-native-text-gradient'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Cocoapod build failure for RN 0.61.2

"react-native": "0.61.2",
"react-native-text-gradient": "0.1.7"

Added package and done pod install, finished successfully
When building this error occurs:
Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_RCTVirtualTextViewManager", referenced from: _OBJC_CLASS_$_RNVirtualTextGradientViewManager in RNVirtualTextGradientViewManager.o "_OBJC_METACLASS_$_RCTVirtualTextViewManager", referenced from: _OBJC_METACLASS_$_RNVirtualTextGradientViewManager in RNVirtualTextGradientViewManager.o "_OBJC_METACLASS_$_RCTVirtualTextShadowView", referenced from: _OBJC_METACLASS_$_RNVirtualTextGradientShadowView in RNVirtualTextGradientShadowView.o "_OBJC_IVAR_$_RCTTextShadowView._bridge", referenced from: -[RNTextGradientShadowView uiManagerWillPerformMounting] in RNTextGradientShadowView.o "_OBJC_CLASS_$_RCTBaseTextShadowView", referenced from: objc-class-ref in RNTextGradientShadowView.o "_OBJC_METACLASS_$_RCTTextView", referenced from: _OBJC_METACLASS_$_RNTextGradientView in RNTextGradientView.o "_OBJC_CLASS_$_RCTTextView", referenced from: _OBJC_CLASS_$_RNTextGradientView in RNTextGradientView.o "_OBJC_IVAR_$_RCTTextViewManager._shadowViews", referenced from: -[RNTextGradientViewManager shadowView] in RNTextGradientViewManager.o "_OBJC_IVAR_$_RCTTextView._textStorage", referenced from: -[RNTextGradientView drawRect:] in RNTextGradientView.o "_OBJC_CLASS_$_RCTVirtualTextShadowView", referenced from: _OBJC_CLASS_$_RNVirtualTextGradientShadowView in RNVirtualTextGradientShadowView.o "_OBJC_METACLASS_$_RCTTextViewManager", referenced from: _OBJC_METACLASS_$_RNTextGradientViewManager in RNTextGradientViewManager.o "_OBJC_METACLASS_$_RCTTextShadowView", referenced from: _OBJC_METACLASS_$_RNTextGradientShadowView in RNTextGradientShadowView.o "_OBJC_CLASS_$_RCTRawTextShadowView", referenced from: objc-class-ref in RNTextGradientShadowView.o "_OBJC_CLASS_$_RCTTextShadowView", referenced from: _OBJC_CLASS_$_RNTextGradientShadowView in RNTextGradientShadowView.o "_OBJC_CLASS_$_RCTTextViewManager", referenced from: _OBJC_CLASS_$_RNTextGradientViewManager in RNTextGradientViewManager.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
This happened after react-native version upgrade. I did the patch and reset everything by cloning new project and even used react-native-clean-project.

Please help. Thank you.
BTW Love the library.

Gradient Isn't Working

react-native -v 0.56.0
react-native-text-gradient -v 0.0.15

I had an issue with the .56 version and as your documentation says i patched it and it throws no error anymore,

but the gradient isn't showing on android although when i apply styles directly in the <LinearTextGradient ...> like fontWeight it works but not the gradient ..

i'm building an app for Android ..

here is my code

                  <LinearTextGradient start={{x: 0, y: 0}} end={{x: 1, y: 0}} colors={['red', 'blue']} style={{ fontWeight: 'bold' }}>
                    Dr. John Doe
                  </LinearTextGradient>

i tried removing it from any other style so it may be affecting the rendering of the gradient, but no luck still

Latest version is not compatible with Android X

System:
OS: macOS 10.14.4
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Memory: 16.86 MB / 16.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 10.15.3 - /usr/local/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.4.1 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1
Android SDK:
API Levels: 23, 26, 28
Build Tools: 23.0.1, 26.0.2, 28.0.3
System Images: android-26 | Google APIs Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
IDEs:
Xcode: 10.1/10B61 - /usr/bin/xcodebuild
npmPackages:
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7

react-native-text-gradient: 0.1.6

When running react-native run-android
gradlew shows this error:
`Error: Command failed: ./gradlew app:installTolunaDevDebug -PreactNativeDevServerPort=8081
/Users/ofir.oron/dev/new_toluna-mobile-app/toluna-mobile-app/mobile-apps/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/RNShadowTextGradient.java:19: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/ofir.oron/dev/new_toluna-mobile-app/toluna-mobile-app/mobile-apps/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/ReflectUtils.java:3: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
^
/Users/ofir.oron/dev/new_toluna-mobile-app/toluna-mobile-app/mobile-apps/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/RNShadowTextGradient.java:80: error: cannot find symbol
private @nullable View resolveView(int tag) {
^
symbol: class Nullable
location: class RNShadowTextGradient
/Users/ofir.oron/dev/new_toluna-mobile-app/toluna-mobile-app/mobile-apps/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/ReflectUtils.java:14: error: cannot find symbol
static T getFieldValue(Object target, String name, @nullable Class type) {
^
symbol: class Nullable
location: class ReflectUtils
/Users/ofir.oron/dev/new_toluna-mobile-app/toluna-mobile-app/mobile-apps/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/ReflectUtils.java:32: error: cannot find symbol
static T invokeMethod(Object target, String name, @nullable Class type) {
^
symbol: class Nullable
location: class ReflectUtils
5 errors

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-text-gradient:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 5s`

Crache on using react-native-reanimated

using this package next to react-native-reanimated v3 produces this error
Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference

Warning: ReactClass: You're attempting to include a mixin that is either null or not an object.

I'm getting the following error with React Native 0.55.4:

ExceptionsManager.js:71 Warning: ReactClass: You're attempting to include a mixin that is either null or not an object. Check the mixins included by the component, as well as any mixins they include themselves. Expected object but got undefined.

The culprit seems to be NativeMethodsMixin which is coming back as undefined. Is this mixin necessary?

Gradient doesnΒ΄t render on iOS

Bug

The code below works on Android but doesn't render the gradient on iOS.

React native info output:

System:
    OS: macOS 10.15.3
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 1.57 GB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - /usr/local/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 25, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5977832
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5 
  npmGlobalPackages:
    react-native-cli: 2.0.1

react-native-text-gradient version: 0.1.7

Code to reproduce:

<LinearTextGradient
  style={{ fontWeight: 'bold', fontSize: 72 }}
  locations={[0, 1]}
  colors={['red', 'blue']}
  start={{ x: 0, y: 0 }}
  end={{ x: 1, y: 0 }}
>
  <Text>THIS IS TEXT GRADIENT</Text>
</LinearTextGradient>

Images from my App

iOS

gradient_ios

Android

gradient_android

mismatch in a method override

I'm using React Native version 0.73.0, and during the Android build, I encountered the following error:


{root-directory}/node_modules/react-native-text-gradient/android/src/main/java/iyegoroff/RNTextGradient/RNShadowTextGradient.java:152: error: dispatchUpdates(float,float,UIViewOperationQueue,NativeViewHierarchyOptimizer) in RNShadowTextGradient cannot implement dispatchUpdates(float,float,UIViewOperationQueue,NativeViewHierarchyOptimizer) in ReactShadowNode public boolean dispatchUpdates( ^ return type boolean is not compatible with void

It seems there is a mismatched interface in the Facebook React Native library starting from version 0.73.0. Considering this, do you think it would be advisable to downgrade my React Native version to 0.72.0?

No ViewManager defined for class RNLinearTextGradient

i am getting this error
here are my dependencies and their versions
"dependencies": {
"react": "16.3.1",
"react-native": "0.55.4",
"react-native-elements": "^0.19.1",
"react-native-linear-gradient": "^2.4.0",
"react-native-text-gradient": "^0.0.8",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.3.1"
},

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.