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

Android 4.x : Error while updating property 'nativeBackgroundAndroid' of a view managed by: RCTView #29983

Closed
mans17 opened this issue Sep 19, 2020 · 14 comments
Labels
Needs: Issue Manager Attention Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.

Comments

@mans17
Copy link

mans17 commented Sep 19, 2020

I have a production app that has crashs ONLY with android 4.x devices.
I'm tring to make the simplest crashing app that produces this bug on 4.x devices (and ont crashing on other devices, of course !)

I saw several thread mentioning this bug : react-native-community/jsc-android-buildscripts#132 but they did not provide a simple "hello world" example reproducing crash, IMHO.

I could reproduce it on a new clean project :

$ react-native init testbackgroundcolor
==> react-native@0.63.2[0] 

$  cd testbackgroundcolor
$ react-native start

(new terminal)
$ react-native run-android

this is my code (just modified App.js) :

import React from 'react';
import {
  StyleSheet,
  View,
  Button,
} from 'react-native';

const App: () => React$Node = () => {

  return (
    <View>
       <Button 
                    title="Press me"
                    fontFamily="Helvetica-Bold"
                    onPress={() => {console.info ("Pressed");}}
                  />
    </View>
  );
};

const styles = StyleSheet.create({
});

export default App;

Run :

  • on any AVD but 4.x : a blue button will be printed.
  • on a 4.x AVD, such as Android 4.4 (Google APIs) with 800x1280 : you have a crash "Error while updating property 'nativeBackgroundAndroid' of a view managed by: RCTView"

Screenshot_1600503643
Screenshot_1600503647

To avoid problem :

  • I'll remove button :-)

I don't know what to do from here to "help"...

[0] % react-native info
info Fetching system and libraries information...
(node:13839) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
    OS: Linux 5.8 Arch Linux
    CPU: (12) x64 Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz
    Memory: 245.41 MB / 15.55 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.10.1 - /usr/bin/node
    Yarn: 1.22.5 - /usr/bin/yarn
    npm: 6.14.7 - /usr/bin/npm
    Watchman: 4.9.0 - /usr/bin/watchman
  SDKs:
    Android SDK:
      API Levels: 10, 16, 17, 19, 20, 23, 27, 28, 29, 4, 8
      Build Tools: 19.0.1, 20.0.0, 27.0.3, 28.0.3, 29.0.2
      System Images: android-17 | ARM EABI v7a, android-17 | MIPS, android-17 | Intel x86 Atom, android-19 | Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-23 | Android TV ARM EABI v7a, android-23 | Android TV Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-27 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-L | Android TV ARM EABI v7a, android-L | Android TV Intel x86 Atom, android-L | ARM EABI v7a, android-L | Intel x86 Atom, android-L | Intel x86 Atom_64, android-R | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
  Languages:
    Java: 1.8.0_265 - /usr/bin/javac
    Python: 3.8.5 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1
    react-native: 0.63.2 => 0.63.2
  npmGlobalPackages:
    *react-native*: Not Found
@react-native-bot react-native-bot added Platform: Android Android applications. Needs: Author Feedback Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. and removed Needs: Triage 🔍 labels Sep 19, 2020
@github-actions
Copy link

⚠️ Missing Environment Information
ℹ️ Your issue may be missing information about your development environment. You can obtain the missing information by running react-native info in a console.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Sep 19, 2020
@mans17
Copy link
Author

mans17 commented Sep 19, 2020

Weirdly enough, I tried with "Hermes" activated : the same bug occurs.

enableHermes: false => this screenshot
enableHermes: true => no impact ; same bug (and I cleared with ./gradlew clean)

@chrisglein chrisglein added Needs: Issue Manager Attention and removed Needs: Attention Issues where the author has responded to feedback. Needs: Environment Info Please run `react-native info` and edit your issue with that command's output. labels Oct 6, 2020
@chrisglein
Copy link

I saw several thread mentioning this bug : react-native-community/jsc-android-buildscripts#132 but they

Mind finishing that sentence?

@mans17
Copy link
Author

mans17 commented Oct 6, 2020

I saw several thread mentioning this bug : react-native-community/jsc-android-buildscripts#132 but they

Mind finishing that sentence?

:-/ sorry.
I meant "did not provide a useful crashing example".

@fonov
Copy link

fonov commented Oct 7, 2020

some issue

Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'nativeBackgroundAndroid' of a view managed by: RCTView
       at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.getPropName(ViewManagersPropertyCache.java)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.getProperties(ViewManagerPropertyUpdater.java)
       at com.facebook.react.uimanager.ViewManagerPropertyUpdater.clear(ViewManagerPropertyUpdater.java)
       at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java)
       at com.facebook.react.uimanager.NativeViewHierarchyManager.access$000(NativeViewHierarchyManager.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.doFrameGuarded(UIViewOperationQueue.java)
       at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.java)
       at com.facebook.react.modules.core.ReactChoreographer$ReactChoreographerDispatcher.doFrame(ReactChoreographer.java)
       at com.facebook.react.modules.core.ChoreographerCompat$FrameCallback$1.doFrame(ChoreographerCompat.java)
       at android.view.Choreographer$CallbackRecord.run(Choreographer.java:786)
       at android.view.Choreographer.doCallbacks(Choreographer.java:591)
       at android.view.Choreographer.doFrame(Choreographer.java:559)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:774)
       at android.os.Handler.handleCallback(Handler.java:808)
       at android.os.Handler.dispatchMessage(Handler.java:103)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:5332)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:831)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:647)
       at dalvik.system.NativeStart.main(NativeStart.java)

@sonywijaya
Copy link

i'm experiencing the same problem caused by Button from react-native 0.63.0
running on genymotion android 4.4 (api 19)

System: OS: macOS 10.15.5 CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz Memory: 126.41 MB / 8.00 GB Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node Yarn: 1.22.5 - /usr/local/bin/yarn npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm Watchman: Not Found Managers: CocoaPods: 1.9.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 11.6/11E708 - /usr/bin/xcodebuild Languages: Java: 14.0.2 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.0 => 0.63.0 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found

@thomasvm
Copy link

thomasvm commented Oct 20, 2020

I'm experiencing this problem with TouchableNativeFeedback on Android 4.4 devices, API level 19. My react-native version is 0.63.2. This used to work fine before

My code looks like this

  const background =
    Platform.Version >= 21
      ? TouchableNativeFeedback.Ripple(color, true)
      : TouchableNativeFeedback.SelectableBackground();

  return (
    <TouchableNativeFeedback background={background} onPress={handlePress}>
    ...

When i set the background to null, everything works. So the problem comes from TouchableNativeFeedback.SelectableBackground()

@alexandrzavalii
Copy link

alexandrzavalii commented Oct 22, 2020

seams related
#9870 (comment)

@MarkCSmith
Copy link

This is fixed by #29746 (not merged yet).

@safaiyeh
Copy link
Contributor

Closing as Android 4.x will no longer be supported, master has been upgraded to API 21.

Ashoat added a commit to CommE2E/comm that referenced this issue Oct 28, 2020
Summary:
I noticed that Android 4 was crashing on startup after the RN0.63 upgrade. Turns out it's [this issue](facebook/react-native#29983).

Android 4 support is going away in React Native 0.64, but for now it's still supported. I figure we might as well keep it working until we have to upgrade.

Test Plan: Make sure Android 4 doesn't crash on startup anymore

Reviewers: palys-swm

Reviewed By: palys-swm

Subscribers: KatPo, zrebcu411, Adrian

Differential Revision: https://phabricator.ashoat.com/D332
@jesenko
Copy link

jesenko commented Nov 24, 2020

@safaiyeh If I understand correctly, this bug thus also won't be fixed in 0.63.x? If so, I guess min API for 0.63.x should already be bumped to 21, and release notes updated - so that those that need Android 4.x support would stay at 0.62.x release...

@safaiyeh
Copy link
Contributor

@jesenko yes. We are releasing the Android 4.x deprecation with 63.4/64.0. It will no longer be supported & changes won’t be merged into master

@Dimon70007
Copy link

Hi guys
Could you apply #29746 fix for patch 0.63 version and increase android api version in minor updates 0.64 or bigger.
I think this will match semver

@HugoGresse
Copy link

Quick patch-package for this specific issue as it will not be fixed for the React Native 0.63.4 anyway.
react-native+0.63.4.patch.zip

@facebook facebook locked as resolved and limited conversation to collaborators Oct 26, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Issue Manager Attention Platform: Android Android applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests