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] IncompatibleClassChangeError: Couldn't find ReactProp.name crash on createContextInBackground #9354

Closed
lelandrichardson opened this issue Aug 11, 2016 · 9 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@lelandrichardson
Copy link
Contributor

We are using React Native 0.30.0 and are seeing a (relatively infrequent) hard crash when running createReactContextInBackground().

This crash only happens on Android and, from what we can tell, seems to only be affecting Samsung devices.

It also only seems to be happening to devices running Android 5.0.x.

The crash appears to be reflection related. It says that ReactProp is missing name. I cannot tell which ViewManager it appears to be crashing on, but for a sanity check I have double checked all of our viewmanagers and none of them are missing a name prop.

Full stack trace is here:

java.lang.RuntimeException: An error occured while executing doInBackground()
        at android.os.AsyncTask$3.done(AsyncTask.java:300)
        at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
        at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
        at java.util.concurrent.FutureTask.run(FutureTask.java:242)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.IncompatibleClassChangeError: Couldn't find com.facebook.react.uimanager.annotations.ReactProp.name
        at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:659)
        at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
        at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
        at java.lang.reflect.Method.getAnnotation(Method.java:301)
        at com.facebook.react.uimanager.ViewManagersPropertyCache.extractPropSettersFromViewManagerClassDefinition(ViewManagersPropertyCache.java:400)
        at com.facebook.react.uimanager.ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(ViewManagersPropertyCache.java:301)
        at com.facebook.react.uimanager.ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(ViewManagersPropertyCache.java:298)
        at com.facebook.react.uimanager.ViewManagersPropertyCache.getNativePropSettersForViewManagerClass(ViewManagersPropertyCache.java:298)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.<init>(ViewManagerPropertyUpdater.java:115)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.<init>(ViewManagerPropertyUpdater.java:110)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater.findManagerSetter(ViewManagerPropertyUpdater.java:73)
        at com.facebook.react.uimanager.ViewManagerPropertyUpdater.getNativeProps(ViewManagerPropertyUpdater.java:60)
        at com.facebook.react.uimanager.ViewManager.getNativeProps(ViewManager.java:199)
        at com.facebook.react.uimanager.UIManagerModuleConstantsHelper.createConstants(UIManagerModuleConstantsHelper.java:62)
        at com.facebook.react.uimanager.UIManagerModule.createConstants(UIManagerModule.java:132)
        at com.facebook.react.uimanager.UIManagerModule.<init>(UIManagerModule.java:84)
        at com.facebook.react.CoreModulesPackage.createNativeModules(CoreModulesPackage.java:66)
        at com.facebook.react.ReactInstanceManagerImpl.processPackage(ReactInstanceManagerImpl.java:923)
        at com.facebook.react.ReactInstanceManagerImpl.createReactContext(ReactInstanceManagerImpl.java:829)
        at com.facebook.react.ReactInstanceManagerImpl.access$700(ReactInstanceManagerImpl.java:99)
        at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:196)
        at com.facebook.react.ReactInstanceManagerImpl$ReactContextInitAsyncTask.doInBackground(ReactInstanceManagerImpl.java:179)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
        at java.lang.Thread.run(Thread.java:818)

Has anyone else observed this? We haven't been able to reproduce on a device ourselves.

@lelandrichardson
Copy link
Contributor Author

cc @astreet @mkonicek

@astreet
Copy link
Contributor

astreet commented Aug 11, 2016

Seems to be hitting other frameworks with other annotations on Samsung devices :( google/gson#726

@astreet
Copy link
Contributor

astreet commented Aug 11, 2016

Here is the Android bug tracker issue: https://code.google.com/p/android/issues/detail?id=172339

@astreet
Copy link
Contributor

astreet commented Aug 11, 2016

(it might be helpful if you cross post on that issue)

@charpeni
Copy link
Contributor

@facebook-github-bot label Icebox

@charpeni
Copy link
Contributor

Hi there! This issue is being closed because it has been inactive for a while.

But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/android-incompatibleclasschangeerror-couldnt-find-reactpropname-crash-on-createcontextinbackground

ProductPains helps the community prioritize the most important issues thanks to its voting feature.
It is easy to use - just login with GitHub.

Also, if this issue is a bug, please consider sending a PR with a fix.
We're a small team and rely on the community for bug fixes of issues that don't affect fb apps.

@charpeni
Copy link
Contributor

@facebook-github-bot close

@facebook-github-bot
Copy link
Contributor

@charpeni tells me to close this issue. If you think it should still be opened let us know why.

@facebook-github-bot facebook-github-bot added Ran Commands One of our bots successfully processed a command. Icebox labels Nov 14, 2016
@joshjhargreaves
Copy link
Contributor

joshjhargreaves commented Mar 20, 2018

Hey @lelandrichardson did you end up finding a fix to this?

We're still seeing a lot of crashes on React native 0.53 with the same Stack trace, all Samsung 5.x devices.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

7 participants
@astreet @joshjhargreaves @lelandrichardson @facebook-github-bot @charpeni @react-native-bot and others