Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: android.content.res.Resources$NotFoundException RCTSlider (Android) #17560

Closed
salujaharkirat opened this issue Jan 12, 2018 · 7 comments
Closed
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@salujaharkirat
Copy link

salujaharkirat commented Jan 12, 2018

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 7.2.1
npm: 3.10.10
Watchman: 4.7.0
Android Studio: 2.3 AI-162.4069837

Packages: (wanted => installed)
react-native: 0.48.1 => 0.47.2
react: 16.0.0-alpha.12 => 16.0.0-alpha.12

Steps to Reproduce

I have an application in which I use TextInput with Slider. When I slide on the slider it updates the value in the component state.

I keep the value in my component state and read this value in TextInput. The value in the text input is treated as the final value which i use elsewhere.

Following is my code:-

class CustomSlider extends React.Component {
  state = {
    amount: 4000
  };

  render () {
    return (
      <View>
        <TextInput 
          value={this.state.value}
        />
        <Slider
          maximumValue={100000}
          minimumValue={0}
          step={1000}
          onValueChange={(amount) => this.setState({amount})}
        />      
      </View>
    );
  }
}

While this code works fine on iOS in android release build crashes randomly at times showing following error.

android.content.res.Resources$NotFoundException Drawable android:drawable/seekbar_thumb_material_anim with resource ID #0x1080692 
    unknown file unknown method


Caused by: java.lang.NullPointerException Attempt to read from field 'android.animation.Animator android.animation.AnimatorSet$Node.mAnimation' on a null object reference 
    AnimatorSet.java:725 android.animation.AnimatorSet.clone
    AnimatorSet.java:682 android.animation.AnimatorSet.clone
    Animator.java:589 android.animation.Animator$AnimatorConstantState.newInstance
    Animator.java:588 android.animation.Animator$AnimatorConstantState.newInstance
    ConstantState.java:53 android.content.res.ConstantState.newInstance
    ConstantState.java:61 android.content.res.ConstantState.newInstance
    ConfigurationBoundResourceCache.java:40 android.content.res.ConfigurationBoundResourceCache.getInstance
    AnimatorInflater.java:114 android.animation.AnimatorInflater.loadAnimator
    AnimatedVectorDrawable.java:876 android.graphics.drawable.AnimatedVectorDrawable$AnimatedVectorDrawableState$PendingAnimator.newInstance
    AnimatedVectorDrawable.java:852 android.graphics.drawable.AnimatedVectorDrawable$AnimatedVectorDrawableState.inflatePendingAnimators
    AnimatedVectorDrawable.java:681 android.graphics.drawable.AnimatedVectorDrawable.applyTheme
    DrawableContainer.java:953 android.graphics.drawable.DrawableContainer$DrawableContainerState.applyTheme
    DrawableContainer.java:612 android.graphics.drawable.DrawableContainer.applyTheme
    StateListDrawable.java:371 android.graphics.drawable.StateListDrawable.applyTheme
    AnimatedStateListDrawable.java:392 android.graphics.drawable.AnimatedStateListDrawable.applyTheme
    ResourcesImpl.java:594 android.content.res.ResourcesImpl.loadDrawable
    MiuiResourcesImpl.java:308 android.content.res.MiuiResourcesImpl.loadDrawable
    Resources.java:876 android.content.res.Resources.loadDrawable
    TypedArray.java:930 android.content.res.TypedArray.getDrawable
    AbsSeekBar.java:99 android.widget.AbsSeekBar.<init>
    SeekBar.java:85 android.widget.SeekBar.<init>
    SeekBar.java:81 android.widget.SeekBar.<init>
    ReactSlider.java:56 com.facebook.react.views.slider.ReactSlider.<init>
    ReactSliderManager.java:124 com.facebook.react.views.slider.ReactSliderManager.createViewInstance
    ReactSliderManager.java:42 com.facebook.react.views.slider.ReactSliderManager.createViewInstance
    ViewManager.java:46 com.facebook.react.uimanager.ViewManager.createView
    NativeViewHierarchyManager.java:218 com.facebook.react.uimanager.NativeViewHierarchyManager.createView
    UIViewOperationQueue.java:150 com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute
    UIViewOperationQueue.java:923 com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations
    UIViewOperationQueue.java:895 com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded
    GuardedFrameCallback.java:31 com.facebook.react.uimanager.GuardedFrameCallback.doFrame
    ReactChoreographer.java:136 com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame
    ChoreographerCompat.java:107 com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame
    Choreographer.java:874 android.view.Choreographer$CallbackRecord.run
    Choreographer.java:688 android.view.Choreographer.doCallbacks
    Choreographer.java:620 android.view.Choreographer.doFrame
    Choreographer.java:862 android.view.Choreographer$FrameDisplayEventReceiver.run
    Handler.java:754 android.os.Handler.handleCallback
    Handler.java:95 android.os.Handler.dispatchMessage
    Looper.java:163 android.os.Looper.loop
    ActivityThread.java:6205 android.app.ActivityThread.main
    Method.java:-2 java.lang.reflect.Method.invoke
    ZygoteInit.java:904 com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run
    ZygoteInit.java:794 com.android.internal.os.ZygoteInit.main

I think this issue is related to #9979.

Expected Behavior

Android build should not crash

@hramos hramos added the Android label Mar 8, 2018
@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Mar 18, 2018
@react-native-bot react-native-bot added Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. labels Mar 18, 2018
@stale
Copy link

stale bot commented Jun 17, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 17, 2018
@rkbhochalya
Copy link

This happens to me too. I use<Slider /> component for video player and the app crashes randomly on Android when I open the video player screen.

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Jun 24, 2018
@ashokkumar88
Copy link

I am facing also the same issue. I am using .

@MarianBe
Copy link

i have the same issue

@ashokkumar88
Copy link

ashokkumar88 commented Jul 17, 2018

finally I removed the react native default <Slider/> and used https://github.com/jeanregisser/react-native-slider. It is working fine now.

@stale
Copy link

stale bot commented Oct 15, 2018

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 15, 2018
@stale
Copy link

stale bot commented Oct 23, 2018

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Oct 23, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Oct 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

7 participants