text:
[WIP] Transformers as modules

Summary

Related to #7135
Test plan

@SimenB I probably facing the issue that you mentioned about serializing the config back and forward because this line keep failing https://github.com/facebook/jest/blob/8a7b4a9df0759142d148cf2f69ec3f23457c542e/packages/jest-runtime/src/script_transformer.js#L161
I checked my object and my keys gets clean up
My original object is
{ canInstrument: true,
  getCacheKey: [Function: getCacheKey],
  process: [Function: process] }

But there is only
{ canInstrument: true }

Which I am assuming that somebody in the  middle is cleaning up the object somehow.
But, two things

How can I at least throw an error so I can see the stack trace and trace back how I got there. Right now it is painful to figure out things because my console keeps getting cleaning up.

How can I turn this auto terminal cleaning up thing?

Give me some directions please.

Up to this point the config is fine https://github.com/facebook/jest/blob/d481defb350947eba0ebb0e597f7c67e13fd6159/packages/jest-cli/src/reporters/coverage_reporter.js#L171
When the worker starts here https://github.com/facebook/jest/blob/d481defb350947eba0ebb0e597f7c67e13fd6159/packages/jest-cli/src/reporters/coverage_worker.js#L36
I can't see my console logs so I can't verify that the serialization is happening fine but probably the issue is there.
I never deal with workers before so I am not sure what to do

Hi there, just letting you know I just made a PR that looks pretty similar to this one: #7398

@jharris4 it seems that you got further than me maybe I should close this one if you believe you are almost done.
Thoughts?!

@yordis My PR adds the feature that I need to make using jest simple and easy for my use cases. So in that sense it is "done". :-)
I don't have a strong opinion on whether your PR should be closed in favour of mine, but perhaps you could take a look at my PR and let me know if there's anything it's missing for your requirements?

Closing in favor of #7398


text:
set default display name color based on runner

Summary
Follow up to @natealcedo's #8025, automatically generating reasonable defaults for that feature.
BREAKING CHANGE:
See comment that was removed. Looks like it'll have to wait until 25 :|
TODO add changelog when there's a section to put it in without having to rebase ;)

Test plan
Added normalize tests. Tried on work project, tests are white, lints are green :)

Incorporated review feedback. Intentionally didn't add changelog yet, will do so once we can actually land breaking changes :)

@jeysal mind rebasing on the next branch and add the changelog entry?

@SimenB done :) should be good to go I think, manually tested it again

source: gharchive/pull-request

authors: SimenB jeysal

repo: facebook/jest

license: MIT

license_type: permissive

license_source: github-api


text:
WIP istanbul bump

Summary
/cc @coreyfarrell. I've updated some snapshots that looked correct, but left a few alone. ~I'll update after you've fixed the sourceFinder issue~

Test plan
Green CI. We'll need to figure out what to do about TS types. Should probably wait for this to be stable as well. We can upgrade without a new major anyways as this is all internal stuff. I wouldn't consider changes in the coverage report to be breaking

We can upgrade without a new major anyways as this is all internal stuff.

Only if you've already dropped node.js 6 (these new versions require node.js 8).

Yeah, we've landed that on master, just not released yet.

I see we have a windows test failure, though...

Codecov Report

Merging #9192 into master will increase coverage by 0.03%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #9192      +/-   ##
==========================================
+ Coverage   64.85%   64.88%   +0.03%
==========================================
  Files         279      276       -3
  Lines       11744    11741       -3
  Branches     2888     2888
==========================================
+ Hits         7616     7618       +2
+ Misses       3510     3506       -4
+ Partials      618      617       -1

Impacted Files
Coverage Δ

...ckages/jest-reporters/src/generateEmptyCoverage.ts
88.88% <ø> (ø)
:arrow_up:

packages/jest-reporters/src/coverage_reporter.ts
61.53% <100%> (ø)
:arrow_up:

e2e/babel-plugin-jest-hoist/__test_modules__/b.js

...babel-plugin-jest-hoist/__test_modules__/Mocked.js

e2e/babel-plugin-jest-hoist/__test_modules__/a.js

packages/expect/src/utils.ts
96.2% <0%> (+1.26%)
:arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4643178...2489643. Read the comment docs.

added some ts-ignores just to verify this is good to go beyond type updates, and it seems so

Let's land this so it can be included in the upcoming beta release of jest

authors: SimenB codecov-io coreyfarrell


text:
feat: create @jest/config-utils package

Summary
Not too happy about the name. Main idea is to colocate both types and utils, since jest-config depends on the world to be able to resolve default dependencies in a pnp context.
This makes it so only jest-circus, jest-jasmine, jest-each and jest-environment* depends on @jest/types.
Fixes #8570

Test plan
Green CI

Doesn't it make sense to create @jest/config-types with config types only then?

authors: SimenB thymikee


text:
Bug: last character from previous sentence being mixed with current typed character

Lexical version: 0.5.1-next.1 / 0.6.0
OS: iOS 15.6.1 - Safari
https://user-images.githubusercontent.com/25634263/199491639-eae111f3-6df6-4dbc-be0b-f70bf75de029.MP4
Steps To Reproduce

Set up your keyboard language to Korean
Write any sentence in Korean, for example: "안녕하세요"
Using Backspace delete all the characters you just wrote
Type any character, for example: "ㅇ"

The current behavior
You will see the last character from previous sentence being combined with the new character you just typed -> "용"
The expected behavior
It should only show a single character : 'ㅇ'

Workaround before #4814 gets merged:
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
import { COMMAND_PRIORITY_CRITICAL, KEY_BACKSPACE_COMMAND } from 'lexical';
import { useEffect } from 'react';

export default function FixIOSKoreanIssuePlugin() {
  const [editor] = useLexicalComposerContext();

  useEffect(
    () =>
      editor.registerCommand<KeyboardEvent>(
        KEY_BACKSPACE_COMMAND,
        event => {
          // https://github.com/facebook/lexical/pull/4814
          if (event.keyCode === 8 && navigator.language === 'ko-KR' && /iPad|iPhone|iPod/.test(navigator.userAgent)) {
            return true;
          }

          return false;
        },
        COMMAND_PRIORITY_CRITICAL
      ),
    [editor]
  );

  return null;
}

source: gharchive/issue

repo: facebook/lexical


text:
Bug: Editing text in child editor does not trigger update in parent editor

Im using your ImageNode and ImageComponent from your Playground. The main difference is that my root editor is not editable,
while the editor in ImageComponent are.
Lexical version: 0.8.0
The current behavior
I have a button that when clicked I want to export the full HTML from the whole editor. My problem is that when I try to use $generateHtmlFromNodes(mainEditor, null) it does not get the latest version of the editorState. The state in the main editor is not updated when the children editor editorState change. I have found  that if I click the main editor the editorState is updated as It gets focus.
The expected behavior
When child editors editorState change I also want the main editors editorState to be updated. I also want the listeners to fire on the main editor.

Thanks for the report @fpetterlate!
Unfortunately, I think it's a bug that we're allowing your editor to get into the state where the parent composer can be uneditable but the nested composers are editable. We've debated this issue in the past, and we want to avoid Lexical serving as a layout engine with a disabled parent editor and then have multiple nested composers with fixed positions.
It opens up the potential for many unforeseen bugs, and this can be the basic job of HTML.

authors: fpetterlate thegreatercurve


text:
Bug: Importing from markdown does not respect escaping

Steps To Reproduce

Enter \*Hello\* here to see that it is valid markdown which is rendered as expected: https://spec.commonmark.org/dingus/
Go to lexical playground, clear the content, switch to Markdown mode. Enter \*Hello\*
Click the markdown button to import.

Expected: It populates the WYSIWYG editor with the literal text *Hello*
Actual: It displays \Hello\
This is because it ignores the escaping and treats the surrounding asterisks as a format to be applied. The process of applying the text formats should do a negative lookbehind assertion to confirm that the previous character is not a backslash.
Before import

After import

Oh interesting, createTextFormatTransformersIndex does indeed add a negative lookbehind for escaping. I'm not sure why it's not working at this point.

OK, it's the switch here that adds the negative assertion depending on userAgent. It turns out my Jest test is classified as IS_APPLE_WEBKIT, although I think it should support the regexp.
So maybe the fix is to change the condition under which it's not used?
    if (IS_SAFARI || IS_IOS || IS_APPLE_WEBKIT) {
      fullMatchRegExpByTag[tag] = new RegExp(
        `(${tagRegExp})(?![${tagRegExp}\\s])(.*?[^${tagRegExp}\\s])${tagRegExp}(?!${tagRegExp})`
      );
    } else {
      fullMatchRegExpByTag[tag] = new RegExp(
        `(?<![\\\\${tagRegExp}])(${tagRegExp})((\\\\${tagRegExp})?.*?[^${tagRegExp}\\s](\\\\${tagRegExp})?)((?<!\\\\)|(?<=\\\\\\\\))(${tagRegExp})(?![\\\\${tagRegExp}])`
      );
    }

Hello, I created a pull request that fixes this issue and #4808, you can see if it fits your requirements here: #4813

Hi everyone.
Any update on this?
Note that at the moment, neither import nor export handle the text content escaping, making the markdown support less reliable for production use.
Will @ratasorin's code be reviewed and hopefully merged soon?

Duplicate of https://github.com/facebook/lexical/issues/2715?

Duplicate of #2715

authors: antsorin cduff etrepum ratasorin robfig


text:
Bug: Toggling the list item is not working properly

When the text is highlighted and the user tries to remove the numbered/ bullet points from any specific word it automatically removes the numbered/ bullet points from other points too
https://github.com/facebook/lexical/assets/127859730/0da13777-55f4-416a-bd32-82d0d33f9ebc
Lexical version:
Steps To Reproduce
1.Create a list with items
2. Try to remove the bullet or number list from the middle item
3. It will remove all the bullet or number list items

Link to code example: lexical.

The current behavior
When the text is highlighted and the user tries to remove the numbered/ bullet points from any specific word it automatically removes the numbered/ bullet points from other points too
The expected behavior
It should only remove the selected bullet/number element

I have fixed this, will add to upstream


text:
Selection#formatText to retain selection and handle all text nodes

A few bugs in formatText affected selection retention and nodes formatting in case selection starts with non-text node:

Selection changes after formatting

https://user-images.githubusercontent.com/132642/183076029-8d848c8b-4427-4c9e-bb1e-aa9c78ae1ca5.mov
https://user-images.githubusercontent.com/132642/183076594-afb91e3d-6e51-44f6-994c-b35420246be8.mov

Selection formats only first text node

https://user-images.githubusercontent.com/132642/183076292-32adb1b1-6104-408c-8a3f-ce0f409c90e1.mov

Backward selection (focus is before anchor) converted to a regular one (anchor goes first). Select word backward, make it bold, press Shift + left arrow. Expected selection to keep expanding backward

https://user-images.githubusercontent.com/132642/183086040-c8f09519-25ef-4f45-933e-39d15822f002.mov
Overall logic:

Get selected text nodes (skip first one if selection starts on its end)
Get start/end text offsets including cases with non-text anchor/focus
Split first/last nodes if selection starts or ends inside text node and format it
Format all text nodes in between
Move selection only in case when it was on text node that was split, otherwise keep it as is (including cases when it's on element node)

Adjusted e2e that expected backward selection to be converted to a regular one

I ran into this bug yesterday, and like magic this fix was released today. Love this lib and the solid work you all are doing, it is very much appreciated.

authors: Awjin fantactuka


text:
Seeing RemoteNodeMemory warnings in coordinator server.log

Seeing many of the following WARNings in the coordinator server.log after a 0.123 upgrade:
2015-10-28T23:54:53.004Z    WARN    query-management-0    com.facebook.presto.memory.RemoteNodeMemory    Error fetching memory info from http://10.93.7.37:8080/v1/memory: java.util.concurrent.TimeoutException
2015-10-28T23:54:56.015Z    WARN    http-client-shared-103    com.facebook.presto.memory.RemoteNodeMemory    Error fetching memory info from http://10.93.8.44:8080/v1/memory: java.util.concurrent.TimeoutException
2015-10-28T23:54:56.015Z    WARN    http-client-shared-104    com.facebook.presto.memory.RemoteNodeMemory    Error fetching memory info from http://10.93.7.37:8080/v1/memory: java.util.concurrent.TimeoutException
Multiple recurring warnings. IP varies per log line (those should be the slave node IPs). Nothing else of note in the logs.
Let me know if I can provide more information.
Cheers.

Hey -- there are two threads on the user mailing list that should provide you with some more info:
https://groups.google.com/d/topic/presto-users/J4V1Zzm0ZNo/discussion
https://groups.google.com/d/topic/presto-users/p-bJVMtztsU/discussion

These are harmless if they occur transiently. There was also a bug fixed related to these though. If you're seeing them frequently with version 0.147 please re-open.

authors: cberner jcowanpdx petroav

repo: facebook/presto

license_source: bigquery


text:
Update typescript.md

Hi! Today I tried to create a new project using typescript with react-native init command, I followed your guide in typescript.md (from your website). After first try with your example, I got the error below. And I tried to remove react-native-template after --template. Now it works.
It may need to update the command in your guide. Thanks.
Error:
(node:59595) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript

Hi @enesozturk this is a duplicate of #1777 and many more.
For more information please check out react-native-template-typescript usage note

Hi @Simek, thanks for the response. I should have been check the previous issues and PRs before mine.  I will check the resource. 🙌🏽

authors: Simek enesozturk

repo: facebook/react-native-website


text:
[RFC] Add New Arch version docs

Overview
I'm proposing a change to the New Arch docs, which moves all of the New Arch docs to a separate version in the docs. In this PR, I'll explain the benefits I think this brings, some common concerns about the move, and how I think they're mitigated.
Live Preview
Benefits

Consistent docs: Currently, the docs for a version includes both the old arch and the new arch. This means for a given version, you have to a) know what architecture you're on and b) know which parts of the docs are relevant to the new architecture. As a result, we have a bunch of references all over the docs to the new architecture, which is also confusing because users should not be opting into the new arch yet except to test and provide feedback.
Clearer expectations: We're hearing feedback that users don't understand our expectations for the new arch (i.e. should they upgrade now or not). My thesis is that the docs are a part of this - the docs are documented as if it's landed in the stable channel in available to use, when in reality, for all non-testing users, it's going to land in a future version.
Fabric-only props: There is a proposal to add some fabric-only props, and that brings up the issue of how to document this. One solution is to add inline-flags in the docs to tell users the props are fabric only. My thesis is that this exasperates the above two problems. With this change, we could document those props only in the New Architecture version, since they're only available in the New Arch.
Simplifying the docs: After this change, we can start finalizing what the docs will look like in a post-new-arch world. For example, instead of having a docs page for Native Modules, and Turbo Modules, we can update the Native Modules doc to explain how to implement Turbo Modules only (referencing the legacy modules where needed).
Un-versioning the New Arch docs: See the "concerns" section below, but I see this as a benefit - this change un-versions the docs so that there is one version of the new architecture, the latest version, and we are free to update and change the version/docs during this phase. This sets the expectation that to test the new arch and give us feedback, you need to update to the lastest version before testing.

Moving the top-level "architecture" section: finally, I moved the Architecture top-level nav item to the New Architecture version. This page only documents the new architecture, so until that lands, it's not accurate or relevant to most users/
Concerns
Please let me know what your concerns are, here are some that I have heard:

Loss of versioning for the New Arch: As mentioned above, I see this as a benefit. With versioning, users on older versions would have clear instructions for how to upgrade to the New Architecture, and we're losing that. But the question is: Why should users use the New Arch on older versions? Right now, we only want users to enable the New Arch to test it and give us feedback. Although it's possible that we could get useful feedback on old versions, more often then not, issues users experience will be fixes in later versions anyway. Note: from our website data, essentially 0 users are currently visiting old versions of the New Arch docs.
Discoverability: there is some concern that this buries the New Arch docs so users can't find it. There's some truth to this, and although I think that the power users who we know are testing the New Arch will find the docs, maybe there is something we can do to make these docs more discoverable without disrupting the experience of our old arch users.
Harder to change the docs: Since this change forks the docs, there is some additional overhead in maintaining the New Arch docs. For example, we no longer can use the "next" channel to "stage" New Arch docs (so we may need to feature branch them until the next release).
More? Let me know!

Overall, I think this is making a tradeoff. We lose versioning and add a little more work to maintaining the docs, but we get a much simpler story, with clearer expectations, and a lot more freedom to change the docs for the New Architecture.

Instructions may and have changed per-version. Moving all of the new architecture out of version management breaks that, along with any of the benefits we get from being able to document different behavior on different versions.
I am strongly against breaking versioning for anything "experimental", especially since this is public, opt-in, and people to frequently use and make edits to this documentation.
If we want to downplay the new architecture compared to current prominence, I think that is fine, but let's please not break versioning to do that.

Not a blocker but these sidebar categories should probably be clarified -- the titles are kind of confusing between what the difference is

In general, this is a good idea, but in the other hand I feel like we introduce another level of docs complexity, which even before, with versioned docs and "Next" could confuse people, but with another select it might be even more problematic for some users. So I think that we should focus on making the distinction between both docs versions and ensure that we do not list twice content or navigation unless it's beneficial, to keep the nav structure clear and sidebar streamlined.
Even now, I'm sure why "Stable.Next" docs include the Architecture sections (but in unusual order) and they to not differ from "Experimental.Next", but this also might be a mistake:

Additionally docs for latest releases docs differs in the section order to the both "Next" versions, which also seems like an unintended change.

Maybe for the clarity, and distinction, we should include the permanent banner while browsing "Experimental" docs, similar to the one, which pop out in "Next" docs:

I agree with the general feedback that has been given so far:

we should really not lose versioning (that seems be have been addressed, at least somewhat? but the "all other versions" doesn't link to a dedicated versions page for new arch? see screenshot)

I think fully duplicating the docs is gonna lead to massive pains for contributors, we are basically in a similar situation of a long living branch were changes need to be manually done twice every time. We are increasing the risk of the docs misaligning (ex. fixing a typo in the alert component page needs to be done twice, and since there's no way to automatically replicate either the reviewer remembers to tell the person to do it in both places, or we'll end up with things misaligned) (so, it's bigger than just "additional overhead in maintaining the New Arch docs") (as Simek and Luna have shown in the screenshot, it's very easy to end in an unsynced state)

the versions shown in the submenus should always match the support window IMO

I really don't think we should let props be fabric-only - the user shouldn't even have to ask themself if a feature they want is available on their arch: everything should work, the change should be transparent for the avg user

this solution increases docs complexity for the user

I agree with the sentiment of wanting to set clearer expectations and I think it's going to benefit people a lot to have clarity in that sense

I'm passing this PR to more folks at MSFT so that they can provide their own thoughts

I'm glad versioning came back for the new docs.

I really don't think we should let props be fabric-only - the user shouldn't even have to ask themself if a feature they want is available on their arch: everything should work, the change should be transparent for the avg user

Unfortunately, that is already a reality.  And at this point new features in core are often going to only get implemented on fabric unless it is trivial to add it to paper too.  Otherwise, you are often going to double the amount of work to add a new feature, which just slows everything down.
I look forward to the "simplifying the docs" next step, which I think is really where this plan will shine.  Showing users the "Native Modules" and "Native Components" sections currently is just confusing new users.  The only place those should be mentioned is under the back-compat section.

Unfortunately, that is already a reality. And at this point new features in core are often going to only get implemented on fabric unless it is trivial to add it to paper too. Otherwise, you are often going to double the amount of work to add a new feature, which just slows everything down.

right - it sounds like this is an architectural conversation on how the new arch should have been structured/delivered/planned more than a feedback to give to the docs, so I'll retire that bullet point from my feedback

Unfortunately, that is already a reality. And at this point new features in core are often going to only get implemented on fabric unless it is trivial to add it to paper too. Otherwise, you are often going to double the amount of work to add a new feature, which just slows everything down.

right - it sounds like this is an architectural conversation on how the new arch should have been structured/delivered/planned more than a feedback to give to the docs, so I'll retire that bullet point from my feedback

This has been contentious, and there are Fabric only props introduced in 0.72 that are (if all goes well) also getting a paper version because of it.
There will be new Fabric only properties (e.g. pointer events) and components (e.g. StrictLayout), but how these will be staged/released is not certain yet.
I do personally tend to still think it's the best use of engineer-time to ship Fabric features when ready (add to typings and documents with some disclaimer) but it does create confusion.

I must confess I looked through the site preview, and not the source changes, and missed the amount of duplication here. I also agree that it will be an issue. Apart from effort, leading to documents getting out of sync.
As a more extreme example, it means that, per API, we may now have up to 8 of the same code example needing updates for a change. (JS/TS, Class/Function component, Paper vs Fabric, = 2^3). Though we should be able to remove the class component examples soon (the new React docs heavily reduce visibility to them).

The blending of docs is super confusing but based on feedback I’m not going to merge this so
I’m going to close.

authors: NickGerleman Simek acoates-ms kelset lunaleaps rickhanlonii


text:
Is it possible to push an existing native UIViewController to React-Native's navigator stack

hi~
i am beginner at react native.
i want to push an existing native UIViewController with js bridge, but it's not works well.
does any one knows how to do?

The short answer is no, the NavigatorIOS component doesn't support that. One solution is to separate the view code from the view controller, follow the React Native documentation that shows how to create a JS class for your new native view class, and then display that directly. But... you lose a lot of your view controller logic that way, so you could try embedding the view controller in a view, and then bridging that to JS, but you have to set up view controller containment in a fragile way. Basically it's possible but you're on your own. For RN it's really much better to rewrite with React.

@oceantang I also wanted to something similar, but ended up just replacing the rootViewController
#import "AppDelegate.h"
#import "RCTRootView.h"

@interface AppDelegate()

// keep a reference to the React Native VC
@property (nonatomic, strong) UIViewController *reactNativeViewController;

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;

  jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle"];

  RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
                                                      moduleName:@"CrowdTest"
                                                   launchOptions:launchOptions];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

  // keep a reference to the React Native VC
  self.reactNativeViewController = [[UIViewController alloc] init];
  self.reactNativeViewController.view = rootView;

  self.window.rootViewController = self.reactNativeViewController;
  [self.window makeKeyAndVisible];

  return YES;
}

- (void)goToReactNative {

  [self.window.rootViewController dismissViewControllerAnimated:TRUE completion:nil];

}

- (void)goNativeStoryboard {

  UIViewController *vc = [UIStoryboard storyboardWithName:@"NativeStoryboard" bundle:nil].instantiateInitialViewController;

  [self.window.rootViewController presentViewController:vc animated:true completion:nil];

}
@end

call the bridge method SwiftApp.goToNative() from ReactNative js
@objc(SwiftApp)
class SwiftApp: NSObject {
  @objc func goToNative() -> Void {
    if let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate {
      appDelegate.goNativeStoryboard()
    }
  }

and to go back to ReactNative
import UIKit

class NativeViewController: UIViewController {

    @IBAction func onClick(sender: AnyObject) {
      if let appDelegate = UIApplication.sharedApplication().delegate as? AppDelegate {
        appDelegate.goToReactNative()
      }
    }

}

this is somewhat hacky, but allows you to work directly with native iOS components which aren't yet fully supported.
hope it helps

Neat solution there @yelled3 :smile:
As far as I know, this isn't in the roadmap cc @ericvicenti correct me if I am wrong and I will reopen.

We're working on something similar to achieve native navigation in iOS, it should be relatively easy to extend for any type of view controller:
https://github.com/wix/react-native-controllers

@talkol I'm already using react-native-controllers (and react-native-navigation), but this isn't clear nor obvious. I'm trying to push an Imgly controller for image editing - but I still can't see how to register the Native UIViewController with RCCManager so that I can push. Any pointers?

@yelled3 Can ypu explain it a bit clearly plzz...

@willks haha, you're right. If you add the new UIViewController's wrapper code to react-native-controllers itself (by forking it) it should be easy since that's exactly how it works internally. UINavigationController and UITabBarController are wrapped this way, so you have several examples.
But this is a core update, the bigger question is how to wrap a new controller externally with a separate library. This means some plugin system needs to be implemented in react-native-controllers. We have something like this actually.. experimental. You can see an example in this project https://github.com/wix/react-native-wordpress-editor. What you have there is an external UIViewController (by WordPress) that is wrapped as an external library to react-native-controllers that allows pushing it and so forth.
Having said all that.. @DanielZlotin from our team has taken over react-native-navigation and his plan is to deprecate react-native-controllers in the next major version (and merge the code into navigation). So I'm not sure this method will remain available moving forward. It's a good idea to add it as a feature request to react-native-navigation if you think it's important.

I have trying to solve this issue using an approach similar to @yelled3 but by creating a UINavigationController in AppDelegate.
https://stackoverflow.com/questions/45197759/react-native-push-rather-than-present-native-ios-view
It almost works but when I restore the RN view after returning from the Native view, the RN keyboard is disabled. Any ideas as to why this might happen?

repo: facebook/react-native


text:
ScrollView broken in 0.56.0 for a brownfield edge case in iOS

[x] Review the documentation: https://facebook.github.io/react-native
[x] Search for existing issues: https://github.com/facebook/react-native/issues
[x] Use the latest React Native release: https://github.com/facebook/react-native/releases

Environment
  React Native Environment Info:
    System:
      OS: macOS High Sierra 10.13.5
      CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
      Memory: 2.86 GB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 8.11.3 - ~/.nvm/versions/node/v8.11.3/bin/node
      Yarn: 1.7.0 - ~/.nvm/versions/node/v8.11.3/bin/yarn
      npm: 5.6.0 - ~/.nvm/versions/node/v8.11.3/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 11.4, macOS 10.13, tvOS 11.4, watchOS 4.3
    IDEs:
      Android Studio: 3.1 AI-173.4819257
      Xcode: 9.4/9F1027a - /usr/bin/xcodebuild
    npmPackages:
      react: 16.4.1 => 16.4.1
      react-native: 0.56.0 => 0.56.0
    npmGlobalPackages:
      react-native-cli: 2.0.1

Description
This commit broke ScrollView in certain cases. Details for it are copied from this comment.

In our brownfield project, we had a UIView category (UIView+Something.h) which implemented the protocol UITextViewDelegate which in turn extends UIScrollViewDelegate. Due to this, after upgrading to RN 0.56, our scroll views stopped working coz these lines are missing in the new else if block:
_contentView = view;
RCTApplyTransformationAccordingLayoutDirection(_contentView, self.reactLayoutDirection);

It took us a long time to investigate the issue, so I was wondering if you knew whether this usecase was missed out when this block was added? Is there is a better way to handle this? I know most greenfield apps won't run into this but you never know what legacy code brownfield apps have and making this better might avoid the pain we had to go through after the upgrade.

Reproducible Demo
Its hard to extract an example to share this but the description is self sufficient to identify the issue.
cc'ing @PeteTheHeat as he was planning on looking into this issue and coming up with an appropriate fix.

@karanjthakkar ^ should fix the issue

Thanks! 💯

authors: PeteTheHeat karanjthakkar


text:
NetInfo: effectiveType only changes if type changes

Environment
System:
  OS: Windows 10
  CPU: x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
  Memory: 1.14 GB / 7.89 GB
Binaries:
  Yarn: 1.10.0 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
  Android Studio: Version  3.1.0.0 AI-173.4907809

React Native: v0.57.1
Description
Both NetInfo.getConnectionInfo() and the event listener that I added via NetInfo.addEventListener('connectionChange') don't seem to pick up changes of the network connection if the type stays the same and only the effectiveType changes.
In other words:
When I monitor the Android Emulator with cellular connection and the connection changes from 4g to 3g, the change is not reflected in the effectiveType. If I change to wifi and back to cellular, the effectiveType is adapted accordingly.
Reproducible Demo

Start App on Android Emulator and deactivate wifi
Call NetInfo.getConnectionInfo() - it will correctly return the current effectiveType (e.g. '4g')
Change the network type in the Android Emulator (e.g. to "EDGE")
Call NetInfo.getConnectionInfo() - it will still return the previous effectiveType ('4g')
Activate wifi on the emulator
Deactivate wifi again
Call NetInfo.getConnectionInfo() - it will now return the correct effectiveType ('2g')

Same problem here with the following result to "react-native info":
Environment:
OS: macOS High Sierra 10.13.6
Node: 10.5.0
Yarn: Not Found
npm: 6.1.0
Watchman: 4.9.0
Xcode: Xcode 10.0 Build version 10A255
Android Studio: 3.2 AI-181.5540.7.32.5056338
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-27.0.0.tar.gz => 0.55.2

same issue here, its only detecting changes between wifi <--> cellular , but Cellular: 4g <--> 2g it doesnt trigger 'connectionChange' listner

authors: JuRomand fliPmitKlammern tepho


text:
Cannot build react-native apk for android

Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
I'm using gradlew to build the react-native project for Android according to the docs. I did everything accordingly, but getting the following error (using --stacktrace to see the full log):
I can't trace anything here and have no idea what could go wrong. What should I do?
React Native version:
System:
OS: Windows 10 10.0.18363
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 1.62 GB / 7.88 GB
Binaries:
Node: 13.12.0 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.4 - C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Version  3.5.0.0 AI-191.8026.42.35.6010548
Languages:
Java: 1.8.0_211
Python: 2.7.17
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: ^0.62.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found
Steps To Reproduce
After following the docs, implementing the keystore and changing build.gradle, run gradlew bundleRelease inside the android library
Expected Results
Build apk successfully
Snack, code example, screenshot, or link to a repository:
This is the log from --stacktrace:
C:\Frontend 19-5\android>gradlew bundleRelease --stacktrace

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :react-native-firebase_app
:react-native-firebase_app:firebase.bom using default value: 24.1.0
:react-native-firebase_app package.json found at C:\Frontend 19-5\node_modules\@react-native-firebase\app\package.json
:react-native-firebase_app:version set from package.json: 6.7.1 (6,7,1 - 6007001)
:react-native-firebase_app:android.compileSdk using custom value: 28
:react-native-firebase_app:android.targetSdk using custom value: 28
:react-native-firebase_app:android.minSdk using custom value: 16
:react-native-firebase_app:reactNativeAndroidDir C:\Frontend 19-5\node_modules\react-native\android

> Configure project :react-native-firebase_messaging
:react-native-firebase_messaging:firebase.bom using default value: 24.1.0
:react-native-firebase_messaging package.json found at C:\Frontend 19-5\node_modules\@react-native-firebase\messaging\package.json
:react-native-firebase_messaging:version set from package.json: 6.7.1 (6,7,1 - 6007001)
:react-native-firebase_messaging:android.compileSdk using custom value: 28
:react-native-firebase_messaging:android.targetSdk using custom value: 28
:react-native-firebase_messaging:android.minSdk using custom value: 16
:react-native-firebase_messaging:reactNativeAndroidDir C:\Frontend 19-5\node_modules\react-native\android

> Task :app:bundleReleaseJsAndAssets
warning: the transform cache was reset.
                 Welcome to React Native!
                Learn once, write anywhere

info Writing bundle output to:, C:\Frontend
info Writing sourcemap output to:, C:\Frontend
error EPERM: operation not permitted, open 'C:\Frontend'. Run CLI with --verbose flag for more details.
Error: EPERM: operation not permitted, open 'C:\Frontend'

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1

* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssets'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:148)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.accept(ExecuteActionsTaskExecuter.java:145)
        at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:191)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:138)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionStateTaskExecuter.execute(ResolveBeforeExecutionStateTaskExecuter.java:75)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:108)
        at org.gradle.api.internal.tasks.execution.ResolveBeforeExecutionOutputsTaskExecuter.execute(ResolveBeforeExecutionOutputsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ResolveAfterPreviousExecutionStateTaskExecuter.execute(ResolveAfterPreviousExecutionStateTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
        at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: org.gradle.process.internal.ExecException: Process 'command 'npx.cmd'' finished with non-zero exit value 1
        at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:396)
        at org.gradle.process.internal.DefaultExecAction.execute(DefaultExecAction.java:37)
        at org.gradle.api.tasks.AbstractExecTask.exec(AbstractExecTask.java:56)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:103)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:702)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:669)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$5.run(ExecuteActionsTaskExecuter.java:401)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:402)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:394)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:92)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:390)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:373)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:79)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:210)
        at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:33)
        at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:58)
        at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:35)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:48)
        at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:33)
        at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:39)
        at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
        at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
        at org.gradle.internal.execution.steps.CatchExceptionStep.execute(CatchExceptionStep.java:35)
        at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:51)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:45)
        at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:31)
        at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:201)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:70)
        at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:45)
        at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:49)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:43)
        at org.gradle.internal.execution.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:32)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
        at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:54)
        at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:38)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:77)
        at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
        at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:90)
        at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:48)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:117)
        ... 35 more

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

BUILD FAILED in 1m 43s
1 actionable task: 1 executed

I changed to project folder out of my root folder then tried again as an administrator and got the error:
info Writing bundle output to:, C:\Presto\Frontend
info Writing sourcemap output to:, C:\Presto\Frontend                                                                   > IDLE
info Done writing bundle output
info Done writing sourcemap output
info Copying 128 asset files
Error: EEXIST: file already exists, mkdir 'C:\Presto\Frontend'
error EEXIST: file already exists, mkdir 'C:\Presto\Frontend'. Run CLI with --verbose flag for more details.

> Task :app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1

* 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 1m 59s
1 actionable task: 1 executed

It says that the file already exists, after it created it, so I'm left with a file Frontend without any extension. Is this actually the APK file?

Hey @omerfaran , right now i"m building app like you with react-native and focusing same problem there app:bundleReleaseJsAndAssets , so you can try building without js assets but i don"t know if it will work , because for me it worked i built APK file using gradlew assembleRelease -x bundleReleaseJsAndAssets , but when I installed app it was crashing instantly so I"m out of ideas now , hope it will work for your app :)

Hey JustFagger thank you very much for your response,
Yes you're right using your command works and actually this is the way to build and APK, what I was trying to do, to my understanding is building AAB and not APK. I still don't have any idea why it didn't work

Yeah, gradlew assembleRelease builds apk ,gradlew bundleRelease builds AAB file .
Should I ask if you used yarn or only npm ?

I am getting the same issue, even after creating an apk file of a new project. Its driving me nuts. gradlew assembleRelease -x bundleReleaseJsAndAssets this command works but the apk file crashes as soon as I run the file. Did you find any solution to this. Kindly help me through this

Hey @omerfaran , right now i"m building app like you with react-native and focusing same problem there app:bundleReleaseJsAndAssets , so you can try building without js assets but i don"t know if it will work , because for me it worked i built APK file using gradlew assembleRelease -x bundleReleaseJsAndAssets , but when I installed app it was crashing instantly so I"m out of ideas now , hope it will work for your app :)

I am experiencing similar issue, did you find a solution to this?

I am getting the same issue, even after creating an apk file of a new project. Its driving me nuts. gradlew assembleRelease -x bundleReleaseJsAndAssets this command works but the apk file crashes as soon as I run the file. Did you find any solution to this. Kindly help me through this

Yeah experiencing same problem as you described , exactly you cannot build APK with JsAssets or app will not open , I think this work needs to be done On Linux (MAC OS) operating system , seems Windows CMD is broken with this React.

authors: AmnaIqbal1998 JustFragger omerfaran


text:
Android app bundle crashes of soloader

All of ours Android apps provided with app bundle (.aab) experiencing with much amount of soloader crashes.
Different devices, different OS versions. Can not reproduce it on our testing devices
Switching to separate apps is not an options since starting from August 2021 app bundle is required.
react versions:
"react": "17.0.1", "react-native": "0.64.0",
Environment Info:
System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 923.96 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.15.1 - /usr/local/bin/node
    Yarn: 1.9.4 - /usr/local/bin/yarn
    npm: 6.14.9 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.3, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      Android NDK: 22.1.7171670
  IDEs:
    Android Studio
    Xcode: 12.3/12C33
  Languages:
    Java: 11.0.9.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1
    react-native: 0.64.0 => 0.64.0
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Stacktrace 1:
java.io.IOException at (Unknown Source)
com.facebook.soloader.g.<init> (or com.facebook.soloader.FileLocker.<init>)
java.lang.RuntimeException: Unable to create application chat.roulette.MainApplication: java.lang.RuntimeException: java.io.IOException: Resource deadlock would occur
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6853)
	at android.app.ActivityThread.access$1400(ActivityThread.java:246)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loop(Looper.java:236)
	at android.app.ActivityThread.main(ActivityThread.java:7876)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.lang.RuntimeException: java.io.IOException: Resource deadlock would occur
	at com.facebook.soloader.SoLoader.g(Unknown Source)
	at chat.roulette.MainApplication.onCreate(Unknown Source)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1193)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6848)
	... 8 more
Caused by: java.io.IOException: Resource deadlock would occur
	at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
	at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:115)
	at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1139)
	at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
	at com.facebook.soloader.g.<init>(Unknown Source)
	at com.facebook.soloader.g.c(Unknown Source)
	at com.facebook.soloader.n.b(Unknown Source)
	at com.facebook.soloader.SoLoader.i(Unknown Source)
	at com.facebook.soloader.SoLoader.f(Unknown Source)
	at com.facebook.soloader.SoLoader.e(Unknown Source)
	at com.facebook.soloader.SoLoader.g(Unknown Source)
	... 11 more

Stacktrace 2: (little bit different)
java.lang.RuntimeException: Unable to create application chat.roulette.MainApplication: java.lang.RuntimeException: java.io.IOException: Resource deadlock would occur
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5506)
	at android.app.ActivityThread.-wrap2(ActivityThread.java)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1595)
	at android.os.Handler.dispatchMessage(Handler.java:110)
	at android.os.Looper.loop(Looper.java:203)
	at android.app.ActivityThread.main(ActivityThread.java:6251)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1073)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934)
Caused by: java.lang.RuntimeException: java.io.IOException: Resource deadlock would occur
	at com.facebook.soloader.SoLoader.g(Unknown Source)
	at chat.roulette.MainApplication.onCreate(Unknown Source)
	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5503)
	... 8 more
Caused by: java.io.IOException: Resource deadlock would occur
	at sun.nio.ch.FileDispatcherImpl.lock0(Native Method)
	at sun.nio.ch.FileDispatcherImpl.lock(FileDispatcherImpl.java:99)
	at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1026)
	at java.nio.channels.FileChannel.lock(FileChannel.java:875)
	at com.facebook.soloader.g.<init>(Unknown Source)
	at com.facebook.soloader.g.c(Unknown Source)
	at com.facebook.soloader.n.b(Unknown Source)
	at com.facebook.soloader.SoLoader.i(Unknown Source)
	at com.facebook.soloader.SoLoader.f(Unknown Source)
	at com.facebook.soloader.SoLoader.e(Unknown Source)
	... 12 more

⚠	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.

fixed

Hey,
We're cleaning up the React Native issue tracker to make sure we focus on the most important issues first.
I'm closing this one because it's stale and related to a version of React Native we no longer support. If the issue persists on the latest version, please re-open a new issue and reference this one.
Moreover, we generally can't fix issues just by looking at a stacktrace reported from your crash reporting platform. Please provide a reproducer in your future reports.
Thank you.

authors: Desintegrator cortinico


text:
Could not find com.facebook.react:react-android:.:0.72.1

Description
Not able to generate .aar from a new react-native app version 0.72.1
Getting the below issue
Steps to reproduce
In the android folder I'm doing ->  ./gradlew :RNSDK:assembleRelease to create a aar file
React Native Version
0.72.1
Affected Platforms
Runtime - Android
Output of npx react-native info
System:
  OS: macOS 13.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 62.58 MB / 16.00 GB
  Shell:
    version: 5.8.1
    path: /bin/zsh
Binaries:
  Node:
    version: 20.11.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.2.4
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.03.25.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /Users/abhishekkumar/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.1 AI-221.6008.13.2211.9514443
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 2.7.6
    path: /Users/abhishekkumar/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.1
    wanted: 0.72.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs
FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':rnsdk:compileReleaseAidl'.
> Could not resolve all task dependencies for configuration ':rnsdk:releaseCompileClasspath'.
   > Could not find com.facebook.react:react-android:.
     Required by:
         project :rnsdk

* 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.

Reproducer
https://github.com/19abhishek/react-native-hello-world
Screenshots and Videos
No response

Thanks for the reproducer @19abhishek
There are 2 problems in your project:

This line
https://github.com/19abhishek/react-native-hello-world/blob/faae4b860b93e7cf39a9e9f231db155268488c86/android/app/build.gradle#L1

It should be changed as follows:
-apply plugin: "com.android.application"
+apply plugin: "com.android.library"

That's because you're specifying an Android App there and not a library.

You're including the same Gradle module twice here:

https://github.com/19abhishek/react-native-hello-world/blob/faae4b860b93e7cf39a9e9f231db155268488c86/android/settings.gradle#L3-L5
As you're including the :app module (with path ./app), and then you're creating another module called :rnsdk with path ./app. So this can't work.
You would have to change the settings.gradle file as follows:
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
-include ':rnsdk'
-project(':rnsdk').projectDir = new File(rootProject.projectDir, './app')
includeBuild('../node_modules/@react-native/gradle-plugin')

I made these changes but I'm still getting the same issue @cortinico. I have updated the reproducer file as well with these changes.
Getting the below error -
Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.

Could not find com.facebook.react:react-android:.
Required by:
project :app

Sorry I used the wrong symbols on my first suggestion:
You should update the android/app/build.gradle as follows:
+apply plugin: "com.android.application"
-apply plugin: "com.android.library"

That'll generate a releaseAPK, I wanted to create a .aar file (SDK for android). What changes do I need to make for that?

That'll generate a releaseAPK, I wanted to create a .aar file (SDK for android). What changes do I need to make for that? @cortinico

You should be using a template like this one:
https://callstack.github.io/react-native-builder-bob/create

That'll generate a releaseAPK, I wanted to create a .aar file (SDK for android). What changes do I need to make for that? @cortinico

You should be using a template like this one: https://callstack.github.io/react-native-builder-bob/create

Thanks for the reply. Actually I wanted to create a library of an existing React native app which is on 0.72.0 version, was getting the same error there, so was trying it on a Hello world project but faced the same issue there. How can I create a library for this project, can you help with that?

How can I create a library for this starter hello world project, can you help with that?

Nope sorry I cannot help you further. Please seek support on StackOverflow or use the template project I linked you

How can I create a library for this starter hello world project, can you help with that?

Nope sorry I cannot help you further. Please seek support on StackOverflow or use the template project I linked you

Okay, thanks.


text:
minWidth/minHeight/maxWidth/maxHeight missing on 0.19?

On updating to 0.19 (from 0.17) I found warning on unsupported styling of minWidth/minHeight/maxWidth/maxHeight. I didn't find anything regarding to these in the breaking change release note and since these are the new stuff only be added since 0.17, any chance this is a mistake?

They were never supported to begin with -- the fact that they showed up in the documentation was a mistake.

Hmm, I was using maxHeight and minHeight effectively in 0.19, but now with 0.20.0-rc I get red the red screen of death.  What is the alternative to allow a view to prevent a view from growing/shrinking beyond a certain height?

height: min(this.state.measuredHeight, maxHeight)

:+1:

@ide That doesn't seem like a great solution as you need to set the state in onMeasure which will re-render the UI. Previously the min/max values would be followed without having to re-render the component.
Is there an alternative way which doesn't require the component to render twice?

No, the layout engine doesn't support that.

authors: ide mpretty-homepass seph14 sjmueller


text:
Argument list too long:

Argument list too long: recursive header expansion failed at /Users/qycloud/workspace/ReactNative/example1/test1/Pods/React/packager/node_modules/module-deps/node_modules/duplexer2/node_modules/readable-stream/node_modules/core-util-is/lib.

Can you please help us understand what you did to get this error?

As @jaygarcia mentioned, it would be helpful to have a bit more information :smile: - if this is still an issue, feel free to ping me and provide the full error message and the code that caused it and we can help you further @qjloong! I'll close the issue until then.

I have the same error, reproducible with the following steps:
react-native init longargs
cd longargs
npm install --save react-native-udp
npm install --save-dev react-native-webpack-server
open longargs.xcodeproj
# Link up react-native-udp:
#   1. add node_modules/react-native-udp/UdpSockets.xcodeproj
#   2. link libUdpSockets.a from UdpSockets lib
# Build

i guess it's an Xcode thing, having to do with recursive Header Search Paths: $(SRCROOT)/../../React

I was hitting this issue. In your project and target build settings, search for 'Header Search Paths' and 'User Search Header Paths' and make sure that you are not making Xcode recurse over a very very very large set of files and folders recursively. In my case, I was overwriting the one that CocoaPods had added there, and hence it was recursing over an extremely large directory.

@paramaggarwal - do you think it's worth adding a note about this to the documentation anywhere?

Good thought. If somebody searches the issues or Google with their error message 'Argument list too long', they'll hopefully land here. I went to the React Native documentation, and noticed that the sidebar does not link to the Troubleshooting page. That would be a great place to add stuff like this, that is gathered from the issues. What do you think?

@brentvatne I raised #1701 documenting this possible issue.

Thanks!

who can fixed?

My ios builds are failing due to: /Users/***/mobile/ios/../node_modules/react-native-device-info/android/build/intermediates/exploded-aar/com.facebook.fresco/fbcore/0.11.0
I managed to fix this issue by adding android in xcode under Build Settings > Search Paths > Sub-Directories to Exclude in Recursive Searches
This managed to solve my problem even though I am not exactly sure why. It does not affect my android builds and my codes are all working.
If someone can explain why this works, it would be great.

i have the same error, any efficient solutions so far?

+1

+1

I have the same error

how to solve this ?

authors: ATeamMac2014 BigPun86 Luckygirlllll SnowDang brentvatne burkaslarry cinder92 jaygarcia mvayngrib paramaggarwal qjloong stevenyap


text:
onResponderRelease does not work on android devices

Exactly speaking,
onResponderRelease is not triggered on Android if it nested with Text, but works well with IOS devices. Here is my quite simple code:
render (){
        return (
            <Text>
            <Image onResponderRelease={()=>{alert(1)}} onStartShouldSetResponder={()=>true} source={{height: 100, width: 100, uri: 'http://dimg04.c-ctrip.com/images//u00l0400000000dq8C668.jpg'}}/>
            </Text>
        )
}

@facebook-github-bot duplicate #8177

@charpeni tells me this issue is a duplicate of #8177. Let's discuss there, closing this one.


text:
Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline

Info:

ReactNative: 0.30
Platform: Android
Device: Nexus 5
Android OS: 4.4.2
Rooted: true

Problem:
The problem, as I see it, is that android.graphics.Outline was introduced in Lollipop 5.0 and it is used in ReactViewBackgroundDrawable.java as an import and as a method parameter. So OSs less than this will crash when this is hit.
StackTrace:
Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)
Caused by java.lang.ClassNotFoundException: Didn't find class "android.graphics.Outline" on path: DexPathList[[zip file "/data/app/com.curse.highwind-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.curse.highwind-1, /vendor/lib, /system/lib]]
       at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
       at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
       at java.lang.Class.getDeclaredMethods(Class.java)
       at java.lang.Class.getDeclaredMethods(Class.java:656)
       at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
       at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
       at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
       at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
       at android.view.ViewDebug.dumpView(ViewDebug.java:900)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
       at android.view.ViewDebug.dump(ViewDebug.java:793)
       at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
       at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
       at android.view.IWindow$Stub.onTransact(IWindow.java:65)
       at android.os.Binder.execTransact(Binder.java:404)
       at dalvik.system.NativeStart.run(NativeStart.java)

+1
Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline        at java.lang.Class.getDeclaredMethods(Class.java)        at java.lang.Class.getDeclaredMethods(Class.java:656)        at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)        at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)        at android.view.ViewDebug.exportFields(ViewDebug.java:1175)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)        at android.view.ViewDebug.dumpView(ViewDebug.java:900)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dump(ViewDebug.java:793)        at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)        at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)        at android.view.IWindow$Stub.onTransact(IWindow.java:65)        at android.os.Binder.execTransact(Binder.java:404)        at dalvik.system.NativeStart.run(NativeStart.java) Caused by java.lang.ClassNotFoundException: Didn't find class "android.graphics.Outline" on path: DexPathList[[zip file "/data/app/com.anibox-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.anibox-1, /vendor/lib, /system/lib]]        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)        at java.lang.ClassLoader.loadClass(ClassLoader.java:497)        at java.lang.ClassLoader.loadClass(ClassLoader.java:457)        at java.lang.Class.getDeclaredMethods(Class.java)        at java.lang.Class.getDeclaredMethods(Class.java:656)        at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)        at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)        at android.view.ViewDebug.exportFields(ViewDebug.java:1175)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)        at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)        at android.view.ViewDebug.dumpView(ViewDebug.java:900)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)        at android.view.ViewDebug.dump(ViewDebug.java:793)        at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)        at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)        at android.view.IWindow$Stub.onTransact(IWindow.java:65)        at android.os.Binder.execTransact(Binder.java:404)        at dalvik.system.NativeStart.run(NativeStart.java)

+1 also getting this on a Nexus 5 4.4.2 (surprisingly - also rooted)

+1 on Nexus 5.

+1 on Nexus 5, 4.4.2 (also rooted)
Fatal Exception: java.lang.NoClassDefFoundError: android/graphics/Outline
at java.lang.Class.getDeclaredMethods(Class.java)
at java.lang.Class.getDeclaredMethods(Class.java:656)
at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
at android.view.ViewDebug.dumpView(ViewDebug.java:900)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dump(ViewDebug.java:793)
at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
at android.view.IWindow$Stub.onTransact(IWindow.java:65)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(NativeStart.java)
Caused by java.lang.ClassNotFoundException: Didn't find class "android.graphics.Outline" on path: DexPathList[[zip file "/data/app/com.flightly.twitterads-1.apk", zip file "/data/data/com.flightly.twitterads/code_cache/secondary-dexes/com.flightly.twitterads-1.apk.classes2.zip"],nativeLibraryDirectories=[/data/app-lib/com.flightly.twitterads-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at java.lang.Class.getDeclaredMethods(Class.java)
at java.lang.Class.getDeclaredMethods(Class.java:656)
at android.view.ViewDebug.getExportedPropertyMethods(ViewDebug.java:960)
at android.view.ViewDebug.exportMethods(ViewDebug.java:1047)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:997)
at android.view.ViewDebug.exportFields(ViewDebug.java:1175)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:996)
at android.view.ViewDebug.dumpViewProperties(ViewDebug.java:983)
at android.view.ViewDebug.dumpView(ViewDebug.java:900)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:855)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dumpViewHierarchy(ViewDebug.java:867)
at android.view.ViewDebug.dump(ViewDebug.java:793)
at android.view.ViewDebug.dispatchCommand(ViewDebug.java:416)
at android.view.ViewRootImpl$W.executeCommand(ViewRootImpl.java:6258)
at android.view.IWindow$Stub.onTransact(IWindow.java:65)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(NativeStart.java)

If you set multiDexEnabled true in android/app/build.gradle, modify MainApplication.java by the following
import android.support.multidex.MultiDexApplication;
public class MainApplication extends MultiDexApplication implements ReactApplication

@oney Why does that fix the problem?

@oney I tried that but I'm still getting the same crash. I'm also seeing it on a rooted Nexus 5 running 4.4.2.

Is the bug perhaps that this code here:
https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewBackgroundDrawable.java#L144-L147
  public void getOutline(Outline outline) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
      super.getOutline(outline);
      return;
    }

Checks the build version instead of the running version of Android? It looks like it might try to work around this issue.

Still seeing this issue through our analytics and we're now on react-native 0.33.

Still seeing this on 0.34

also seeing this on a user with LGE Nexus 5, SDK Level 19

So it seems everyone sees this on a rooted Nexus 5 4.4.2 (API level 19), one that has ViewDebug enabled. That seems like quite the awful coincidence, but whomever that rogue user is using all our different apps, I'm not too worried about them anymore. :)
My guess is that there is some automated system out there running all Android apps in their rooted debug environment, unintentionally breaking when attempting to run our React Native apps. Perhaps it's used for rendering screenshots, for interacting with apps-in-the-cloud, or maybe a grad student research project, or who knows what else.

@lacker Wondering why this issue was closed. I'm getting the same crashes from a SM-G900R7, which is a Samsung Galaxy S5 running 4.4.2, which seems to be different from the device that has been listed above (all Nexus 5 running 4.4.2) so this is probably not limited to a certain device. It could be happening only on Android 4.4.2, but it's still an issue.

@SuhairZain I also got an crash report for a SM-G900R7 (4.4.2).
@mikelambert I also suspect this is some automated system because I got my crash just 2 hours after my apk upload.

RN 0.55.4

Got crash report on Galaxy S5 (4.4.2) . RN 0.52

authors: BeckZero SuhairZain aman1arun arilitan bennyguitar cymen flyingxu getreup mikelambert oney sagivmalihi tepamid yagottahavehart


text:
Minification breaks certain libraries

We're using a library in our Android RN app.
It works fine in dev, but breaks once minified.
Is there a way to skip minification of certain files?

Which libraries and which lines break?

The current minifier is Uglify (may change to Babili later) so if you can figure out how to tell Uglify not to minify certain functions that would probably work for you.

@ide Is there a way to generate a non-minified apk with react-native?

Grep through the build process searching for minify and change whatever code is requesting minify=true in a packager URL to minify=false.

In the end, we solved this by disabling mangling:
function minify(filename, code, sourceMap) {
  const minifyResult = uglify.minify(code, {
    fromString: true,
    inSourceMap: sourceMap,
    outSourceMap: true,
    mangle: false, // ADD THIS LINE
    output: {
      ascii_only: true,
      screw_ie8: true,
    },
  });

in node_modules/react-native/packager/react-packager/src/JSTransformer/worker/minify.js
We haven't found a nice way to commit this into version control yet.

@facebook-github-bot close

@facebook-github-bot label Icebox

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/minification-breaks-certain-libraries
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.

@yogiben you might be interested in patch-package for future situations like this. I use it to prevent mangling myself :-)

For future reference: As of September 2017 the file that needs to be patched (as described by @yogiben's instructions) has been moved to the metro-bundler module, so the path should now be:
node_modules/metro-bundler/src/JSTransformer/worker/minify.js

If you're using patch-package to patch it, here's patches/metro-bundler+0.9.2.patch:
diff --git a/node_modules/metro-bundler/src/JSTransformer/worker/minify.js b/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
index 3f61ce9..4927afb 100644
--- a/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
+++ b/node_modules/metro-bundler/src/JSTransformer/worker/minify.js
@@ -46,10 +46,11 @@ function minify(inputCode, inputMap) {
     fromString: true,
     inSourceMap: inputMap,
     outSourceMap: true,
+    mangle: false,
     output: UGLIFY_JS_OUTPUT_OPTIONS });

 }

 module.exports = {
   noSourceMap,
-  withSourceMap };
\ No newline at end of file
+  withSourceMap };

The file path mentioned here: https://github.com/facebook/react-native/issues/9711#issuecomment-327552716 is changed. It should be:
node_modules/metro-minify-uglify/src/minify.js

authors: charpeni coreh ds300 ide jackylimel maluramichael yogiben you-fail-me


text:
Protocol property of WebSocket object is undefined

Summary
Prior to this patch the websocket protocol was not being set when a connection
was opened, which could cause client libraries and apps to not work properly.
According to the whatwg spec the protocol must be set once the connection is
estabilished.
Changelog
[Javascript] [Fixed] - Properly set the this.protocol on WebSocket open
[Android] [Fixed] - Send the server chosen protocol to the WebSocket object
[iOS] [Fixed] - Send the server chosen protocol to the WebSocket object
Test Plan
In order to reproduce the issue you need to install wampy@6.2.1. Since wampy@6.2.2 and newer contains a workaround for this react-native bug.
https://www.npmjs.com/package/wampy
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import Wampy from "wampy";

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};

export default class App extends Component<Props> {
  state = {conState: 'Initializing...'};
  componentDidMount() {
    const url = "wss://demo.crossbar.io/ws";

    const ws = new Wampy(url, {
      realm: "crossbardemo",
      ws: WebSocket,
      debug: true,
      onConnect: () => {
        console.log("WAMP onConnect");
        this.setState({conState: 'Connected'});
      },
      onClose: () => {
        console.log("WAMP onClose");
        this.setState({conState: 'Connection closed'});
      },
      onError: () => {
        console.log("WAMP onError");
        this.setState({conState: 'Connection Error'});
      }
    });
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.message}>{this.state.conState}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  message: {
    fontSize: 20,
    color: 'black'
  },
});

Using the code above one must see the message WAMP onConnect on Console and Connected in the middle of the screen
Closes #24796

@cojer

@cpojer Sorry about this. I fixed the problem. Could you please take a look once again? thank you very much for your help.


text:
Initial implementation of WebSockets on Android

This implementation uses the okhttp web socket library that is already
used by the debug bridge.
It was tested with the Firebase library that also works with React
Native for iOS.
Fixes https://github.com/facebook/react-native/issues/2837, but without introducing a new dependency.

Hi. Awesome. Just to let you know, I also updated my pull request. There are some notable changes from your pull request,

onMessage will print the IOException instead of throwing it to avoid crash
Pass "reason" on close event, to be closer to the spec, there is a wasClean property in the spec also, but didn't seem to exist in okhttp-ws
On failure event, data is not passed in the event object
While closing, the code is specified as "1000" (CLOSE_NORMAL) and reason as "" instead of "unknown"

Great stuff Satya! I don't mind which one gets merged in, as long as people can start building Firebase apps for Android with React Native soon. :-)

@puf Yup, I also need it in an app I'm working on. Right now using a custom react module. :)

Right now using a custom react module. :)

@satya164 which one?

@owais Custom = self-made. Take the code for WebSocket.android.js and WebSocketModule.java from this (or @satya164 's) PR and create a custom package, like this:
public class AwesomeReactPackage implements ReactPackage {

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
        List<NativeModule> modules = new ArrayList<>();

        modules.add(new WebSocketModule(reactContext));

        return modules;
    }

    @Override
    public List<Class<? extends JavaScriptModule>> createJSModules() {
        return Collections.emptyList();
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
        return Collections.emptyList();
    }
}

Register that package in the MainActivity, like this:
        mReactInstanceManager = ReactInstanceManager.builder()
                .setApplication(getApplication())
                .setBundleAssetName("index.android.bundle")
                .setJSMainModuleName("index.android")
                .addPackage(new MainReactPackage())
                .addPackage(new AwesomeReactPackage())
                .setUseDeveloperSupport(BuildConfig.DEBUG)
                .setInitialLifecycleState(LifecycleState.RESUMED)
                .build();

Run the Android app and it'll use your new, custom WebSocket module.

Closing this since WebSockets have landed in master.

authors: ide owais puf satya164


text:
Refactor: removed duplicates of the word "before"

Summary
Found and removed duplicates of the word "before" in comments.
Changelog
[Internal] [Removed] – Removed duplicates of the word "before" in comments.
Test Plan
Not applicable

Hey @Vicachu42
I have to close this PR as you're touching files that are autogenerated.
You should instead open your PR against facebook/react as the typo is there:
https://cs.github.com/facebook/react/blob/20a257c259c265d25ece77ee3c18f353b4b9a925/packages/shared/CheckStringCoercion.js#L81

@cortinico Thank you for your feedback! I'll do that :)


text:
Extract the content of the case 'Int32' (Flow, TypeScript) into a single emitInt32 function in the parsers-primitives.js file.

Summary
Part of #34872
Refactors emitInt32 in codegen parser module into a common parsers-primitive.js

Changelog

[Internal] [Changed] - Extract the content of the case 'Int32' (Flow, TypeScript) into a single emitInt32 function
Test Plan
Ran yarn jesr react-native-codegen

@cipolleschi
Thanks for the review! I've added a unit test for emitInt32.


text:
修复组件报错

Summary

Changelog

Test Plan

Assigning the props field is not required, the base component class will do so already.


text:
Fail generating website if any page throws an error

This will prevent us from having pages on the site that just show error
stack traces -- instead, Travis will fail with an error and we'll
notice sooner.
I cleaned up this logic to use promises which was eay easier to track
for the error behavior and should be simpler to follow regardless.

cc @jamesgpearce

Btw publishing happens in after_success that according to the docs won't fail the build

Ooh, good point.
(This is trying to prevent http://facebook.github.io/react-native/docs/pushnotificationios.html#content which currently shows an error.)

In any case, that's still better than what we have now.

authors: frantic spicyj vjeux


text:
Indentation when printing object/record with attribute

refmt formats as follows:
let obj = [@intl.messages] {
                             "a": {
                               "id": "a",
                               "defaultMessage": "A",
                             },
                           };

Same for records:
let record = [@intl.messages] {
                                a: {
                                  id: "a",
                                  defaultMessage: "A",
                                },
                              };

That's a lot of indentation...

Yes, I think
let obj = [@intl.messages] {
  "a": {
    "id": "a",
    "defaultMessage": "A",
  },
};

would be best. Something like
let obj = [@intl.messages]
{
  "a": {
    "id": "a",
    "defaultMessage": "A",
  },
};

would work for me, too - anything that does not indent the body that much.

repo: facebook/reason


text:
Request for new release

It seems like it's been a while and I'm finding more and more things in main that aren't in the latest release and are valuable.
Thanks!

Great point. I just sent up a diff internally to fix #137. I'll make a release once that is landed.

Looks like release 0.13.0 is out, thank you!

authors: freeform-andre ndmitchell

repo: facebook/starlark-rust


text:
How to add views programatically

Report

[x] I have searched existing issues and this is not a duplicate

Issues and Steps to Reproduce
       YogaNode rootNode = binding.yoga.getYogaNode();
        rootNode.setJustifyContent(YogaJustify.SPACE_AROUND);
        rootNode.setAlignItems(YogaAlign.AUTO);
        rootNode.setAlignContent(YogaAlign.CENTER);

        YogaNode imageNode = new YogaNodeJNIFinalizer();
        imageNode.setAlignSelf(YogaAlign.CENTER);

        ImageView image = new ImageView(getContext());
        image.setImageResource(R.drawable.geometric_outlined_call);

        binding.yoga.addView(image, imageNode);

Expected Behavior
To see an image view in the layout
Actual Behavior
No views displayed
Any help please?

We're deprecating the com.facebook.yoga.android.YogaLayout ViewGroup in the next major release of Yoga. We intend to still push out a new version aligned to the core Yoga 2.0. I have bulk closed ViewGroup issues to reflect that we are not planning to invest time into functional changes of the ViewGroup. and eventually intend to remove it from the repo.

authors: NickGerleman hkawii

repo: facebook/yoga

license: mit


text:
Fix margin auto with smaller parent lead to negative position

This PR fixes #978, where a smaller parent in combination with margin: auto on bigger children lead to a negative position.
Include tests to prevent future regressions.

@SidharthGuglani Which concerns from your side are in place to having this merged?

@jacobp100 I thought about this one more.
If the surfaces are wanting to use as a test for "big enough to be representative" already had margin: "auto" broken without someone noticing, we should probably just make this fix.

Yeah, I’d highly doubt anyone was relying on the incorrect behaviour. Would be really good to get this in - I’ve personally not used auto margins in RN since I hit this bug maybe 3 years ago?

Yeah, I’d highly doubt anyone was relying on the incorrect behaviour. Would be really good to get this in - I’ve personally not used auto margins in RN since I hit this bug maybe 3 years ago?

I finally got around to running the production A/B test on the Facebook app, for the fix for “auto” flexBasis, margin, etc no-oping in Fabric.
Turns out in that example, there were tens of millions of users who hit the code to parse the props that no-op, along with code relying on it which caused those users to see a 1% drop in an important e-commerce metric for us 🙃.
So… I think I’m going to go back to, as a rule, putting any behavior change behind an errata before we can prove it is not relied on in real world usage. Given enough code, it’s surprising what ends up showing up.

FYI @nicoburns, I know you had asked before what I meant when I said “run an experiment”, where I think you had interpreted it as running a lot of tests. This is an example of what I meant, where we turn something on for a percentage of users, and can measure how often a condition is hit and whether user behavior changes.

FYI @nicoburns, I know you had asked before what I meant when I said “run an experiment”, where I think you had interpreted it as running a lot of tests. This is an example of what I meant, where we turn something on for a percentage of users in very large apps with many users, and can measure how often a condition is hit and whether user behavior changes.

Hmm... interesting. I think that does give me a better idea of what "run an experiment" means. I think I had imagined these apps having relatively comprehensive e2e tests, and "run an experiment" would consist of running those rather than enabling the code for production users. I wonder if it would be possible to use a similar mechanism to surface future compatibility warnings to the owners of the affected apps, such that the "errata" could be removed after a certain grace period has elapsed?
(although I would still personally take a "freeze and fork" approach to developing a new version of the algorithm which would avoid this problem entirely as existing conservative users can just stick with the frozen version, and after an initial "experimental" period while it catches up with web implementations, the forked version can piggyback on browsers' web compatibility testing).

mechanism to surface future compatibility warnings to the owners of the affected apps, such that the "errata" could be removed after a certain grace period has elapsed?

That’s the rough plan. I have many more details in https://github.com/facebook/yoga/issues/1247


text:
Fix npm can't install dist folder as missing package version

This PR fix #313. Just add version number to /packages/rome/package.json so npm could install dist folder.

Looks good. We should add a script to make it easier to bump these. Thank you!

authors: sebmck yuzima

repo: facebookexperimental/rome


text:
Feature freeze

I would like to delay adding any new features until #1187 has landed.
We had too many bugfixes in 0.8.2, and it's clear we need to automate testing for all the features we are supporting. Our existing end to end test is not enough.

cc @fson @existentialism

:+1:

Fixed by #1187.

authors: existentialism gaearon

repo: facebookincubator/create-react-app


text:
Update link to jest expect docs

The link to Jest expect docs is outdated and points to globals, not expect:
line 887:

All expect() matchers supported by Jest are extensively documented here.

line 946:

All Jest matchers are extensively documented here.

new link: http://facebook.github.io/jest/docs/expect.html

Wanna send a PR? We love contributions!


text:
Support for CSS Modules

Isn't this as simple as adding ?modules to the (hidden) webpack config file? This would be really nice to have.

See #90 and the followup discussions linked in that thread!

authors: StokeMasterJack mxstbr


text:
Try to reproduce yarn issue

https://github.com/yarnpkg/yarn/issues/2142

0.18.1 should fix this, released tomorrow

authors: bestander gaearon


text:
chore: use correct website URL in Readme

Currently used link leads to the broken page:

thanks :)

authors: Simek slorber

repo: facebookincubator/infima