Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[v2] add support for react-native 0.57.0 #3851

Merged
merged 8 commits into from
Oct 11, 2018
Merged

[v2] add support for react-native 0.57.0 #3851

merged 8 commits into from
Oct 11, 2018

Conversation

alradadi
Copy link
Contributor

No description provided.

@alradadi alradadi changed the title add support for react-native 0.57.0 [v2] add support for react-native 0.57.0 Aug 25, 2018
@manosim
Copy link

manosim commented Sep 12, 2018

Can confirm that this works great on a fresh RN 0.57.0 project.

I had to use Step 9 from the (installation guide) which I guess is not optional any more?

Basically I had to add:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support' && requested.name != 'multidex') {
            details.useVersion "${rootProject.ext.supportLibVersion}"
        }
    }
}

but NOT this implementation 'com.android.support:design:25.4.0'.

In android/build.gradle, I only had to bump the minSdkVersion since RN 0.57 comes with updated versions of buildToolsVersion & supportLibVersion etc.

@esipavicius
Copy link

So what I need to do to run react-native-navigation v2 with react-native 57? I geting:

error: cannot find symbol
import com.facebook.react.uimanager.UIImplementationProvider;
...

or if add "|| names.contains("reactNative56")"
does not exist
import com.reactnativenavigation.NavigationActivity;
....

I need to wait for release?

@holparb
Copy link

holparb commented Sep 17, 2018

Can someone who feels confident in the topic please review the PR and accept if it's okay?
We would love to have RNN with RN 0.57 support. :)

@DVSoftware
Copy link

Doesn't work with latest:

/Users/dvsoftware/Projects/-/node_modules/react-native-navigation/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/NavigationReactNativeHost.java:24: error: duplicate class: com.reactnativenavigation.react.NavigationReactNativeHost
public class NavigationReactNativeHost extends ReactNativeHost implements BundleDownloadListenerProvider {
       ^
/Users/dvsoftware/Projects/-/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactNativeHost.java:86: error: cannot find symbol
                .setUIImplementationProvider(getUIImplementationProvider())
                                             ^
  symbol:   method getUIImplementationProvider()
  location: class NavigationReactNativeHost

@LeVadim
Copy link

LeVadim commented Sep 18, 2018

Any update on this? Looking forward to it.
Thank you

@leonardoballand
Copy link

leonardoballand commented Sep 18, 2018

I've created a repository that is working, while the PR is waiting to be merged.

https://github.com/leonardoballand/react-native-navigation-rn57

Just need to do:
yarn add https://github.com/leonardoballand/react-native-navigation-rn57.git

Hope it helps

@alradadi
Copy link
Contributor Author

@esipavicius @DVSoftware this hasn't been merged so you can't use it just yet. We're waiting on someone to review this and accept it. @guyca would you please review this so these beautiful people can use navigation with the new react 0.57?

@LeVadim
Copy link

LeVadim commented Sep 18, 2018

Would appreciate if it would be possible to merge this change, thank you!!

@ammichael
Copy link

@guyca sorry bother (once more), but with iOS 12 release, RN 0.57 is almost mandatory since it fixes tons of XCode 10 problems. Could you please review and merge this PR?

Thanks a lot!

@DVSoftware
Copy link

@esipavicius @DVSoftware this hasn't been merged so you can't use it just yet. We're waiting on someone to review this and accept it. @guyca would you please review this so these beautiful people can use navigation with the new react 0.57?

I know, i applied the patch, but i'm getting the mentioned errors

@epileftro85
Copy link

is this available now?

@djedlajn
Copy link

Would be great if this gets merged

@esipavicius
Copy link

Would be great if this gets merged

But it has red light. Everywhere is red ;D

@urosappdev
Copy link

urosappdev commented Sep 21, 2018 via email

@ujwal-setlur
Copy link
Contributor

I applied the patch to my project. Does not work:

> Task :react-native-navigation:compileReactNative57DebugJavaWithJavac FAILED
/Users/ujwal/Work/seamlz/seamlz-mobile/node_modules/react-native-navigation/lib/android/app/src/reactNative57/java/com/reactnativenavigation/react/NavigationReactNativeHost.java:24: error: duplicate class: com.reactnativenavigation.react.NavigationReactNativeHost
public class NavigationReactNativeHost extends ReactNativeHost implements BundleDownloadListenerProvider {
       ^
/Users/ujwal/Work/seamlz/seamlz-mobile/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactNativeHost.java:86: error: cannot find symbol
                .setUIImplementationProvider(getUIImplementationProvider())
                                             ^
  symbol:   method getUIImplementationProvider()
  location: class NavigationReactNativeHost
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

@ammichael
Copy link

@ujwal-setlur did you remember to filter the RN56 variant on build.gradle?

@ujwal-setlur
Copy link
Contributor

@ammichael filter? How? Here is my build.gradle:

    defaultConfig {
        applicationId "com.seamlz.app"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57"
        versionCode buildNumber
        versionName "${versionMajor}.${versionMinor}.${versionPatch}"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }

@ujwal-setlur
Copy link
Contributor

Essentially, I am running into the same issue as @DVSoftware

@ammichael
Copy link

@ujwal-setlur try adding this to your /android/build.gradle:

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin("android") || subproject.plugins.hasPlugin("android-library"))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
                // Ignoring RN Navigation Flavors. Needs to be updated when lib is updated
                variantFilter { variant ->
                  def names = variant.flavors*.name
                  if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56")) {
                      setIgnore(true)
                  }
                }
            }
        }
    }
}

@ujwal-setlur
Copy link
Contributor

@ammichael unfortunately, I still get that error...

It seems not so much of a conflict between reactNative57 and reactNative56, but more between reactNative57 and the code under src/main/java/com/reactnativenavigation/react/NavigationReactNativeHost.java

They both declare NavigationReactNativeHost class

@mcousillas6
Copy link

Hi guys, Any news about this?

@ammichael
Copy link

This has been opened more than 1 month ago. I'm in a really bad situation here; can't update to RN 0.57 and release my iOS 12 update while this isn't merged. It's very likely there are more people in the same situation. Please, can somebody (@guyca) take over this merge, fix what is failing and finally merge it?!

Please?

@ujwal-setlur
Copy link
Contributor

Yes me too please. Frankly, I am contemplating moving off RNN. Issues with RN releases, issues with code push. I really like this library, but it's getting hard...

@guyca
Copy link
Collaborator

guyca commented Oct 11, 2018

Hey guys, sorry for the delay

PR looks good, though it seems that RNN isn't compatible with RN 0.57. The workaround pruposed here broke, I think RNN is pretty much unusable in large apps without this fix 😕

// for future guyca

{
  "react": "16.5.1",
  "react-native": "0.57.1"
}

exec.execSync(node ./node_modules/react-native/local-cli/cli.js start --projectRoot ./playground/);

@guyca guyca merged commit ab2f335 into wix:v2 Oct 11, 2018
@alradadi
Copy link
Contributor Author

Thanks for merging @guyca, but what do you mean RNN isn't compatible with react-native 0.57 :D?
I've been using it with 0.57.2 and it's working for me.

@retyui
Copy link
Contributor

retyui commented Oct 12, 2018

@abdullah-sr It is working on IOS or Android ?

@leonardoballand
Copy link

Both for me

@alradadi
Copy link
Contributor Author

@retyui both iOS and android

@Coding-2-86
Copy link

@abdullah-sr what's your rn & rnn version?

@alradadi
Copy link
Contributor Author

well i was using my own fork with react-native 0.57.2, but since this was merged you can use the last release that came out yesterday 2.0.2580

@sampettersson
Copy link

@abdullah-sr RNN requires a custom synchronous UIImplementationProvider, Facebook refactored those bits for 0.57 meaning you can't pass a custom UIImplementationProvider anymore. So for large-ish apps, RNN just throws weird errors all the time :/

@alradadi
Copy link
Contributor Author

i see. well luckily I haven't run into those issues yet.

@guyca
Copy link
Collaborator

guyca commented Oct 14, 2018

@Iamsamwhoami I think I have a workaround for that, hope to publish it in the net few days. Also spoke to some guys at facebook and they reintroduce the api we require.

@guyca
Copy link
Collaborator

guyca commented Oct 18, 2018

Quick update, there's an internal PR at RN which reintroduces the UiImplementation api we need. If all goes well it should land in RN 0.58.
If you're extensively using react components in TopBar - I suggest you reconsider upgrading to RN 0.57.

@Dgs-asohail4
Copy link

Just tried migrating my RN 0.57 project from V1 to V2 got this error
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:10: error: cannot find symbol
import com.facebook.react.uimanager.UIImplementationProvider;
^
symbol: class UIImplementationProvider
location: package com.facebook.react.uimanager
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:23: error: cannot find symbol
public static class Provider extends UIImplementationProvider {
^
symbol: class UIImplementationProvider
location: class SyncUiImplementation
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\NavigationReactNativeHost.java:86: error: cannot find symbol
.setUIImplementationProvider(getUIImplementationProvider())
^
symbol: method getUIImplementationProvider()
location: class NavigationReactNativeHost
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:24: error: method does not override or implement a method from a supertype
@OverRide
^
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:29: error: method does not override or implement a method from a supertype
@OverRide
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

RNN version 2.0.595

@esipavicius
Copy link

Just tried migrating my RN 0.57 project from V1 to V2 got this error
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:10: error: cannot find symbol
import com.facebook.react.uimanager.UIImplementationProvider;
^
symbol: class UIImplementationProvider
location: package com.facebook.react.uimanager
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:23: error: cannot find symbol
public static class Provider extends UIImplementationProvider {
^
symbol: class UIImplementationProvider
location: class SyncUiImplementation
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\NavigationReactNativeHost.java:86: error: cannot find symbol
.setUIImplementationProvider(getUIImplementationProvider())
^
symbol: method getUIImplementationProvider()
location: class NavigationReactNativeHost
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:24: error: method does not override or implement a method from a supertype
@OverRide
^
D:\Projects\React\React-Native Sample app\MobileApp\node_modules\react-native-navigation\lib\android\app\src\reactNative56\java\com\reactnativenavigation\react\SyncUiImplementation.java:29: error: method does not override or implement a method from a supertype
@OverRide
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
5 errors

RNN version 2.0.595

Maybe its it: https://github.com/invertase/react-native-firebase-docs/pull/133/files
I created pull request to documentation. Please try it and write if its works. I already have working project :)

@Dgs-asohail4
Copy link

@esipavicius thanks i got it working now

@ghost
Copy link

ghost commented Nov 13, 2018

> Task :react-native-navigation:compileReactNative57WixForkReleaseJavaWithJavac FAILED

@margaridaDinis
Copy link

I'm getting Execution failed for task ':react-native-navigation:compileReactNative57WixForkReleaseJavaWithJavac'. when I run ./gradlew assembleRelease.

It works on development builds for both Android and iOs, and release for iOs...

I have
React Native 0.57.0,
React 16.5.0
React Native Navigation 2.1.2

@diegolmello
Copy link

@margaridaDinis It seems you need to ignore 57 Wix.
https://wix.github.io/react-native-navigation/#/docs/Installing?id=_82-ignore-other-rnn-flavors

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                variantFilter { variant ->
                    def names = variant.flavors*.name
                    if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56") || names.contains("reactNative57WixFork")) {
                        setIgnore(true)
                    }
                }
            }
        }
    }
}

@margaridaDinis
Copy link

That fixed it! The build is now succeeding, thanks @diegolmello

rajivshah3 pushed a commit to rajivshah3/react-native-navigation that referenced this pull request Nov 21, 2018
@Haqverdi
Copy link

Hello
I have such a problem with the React version 0.57.6
error:

  • What went wrong:
    Execution failed for task ': app: transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

someone had a similar problem???

@Haqverdi
Copy link

Hello
I have such a problem with the React version 0.57.6
error:

  • What went wrong:
    Execution failed for task ': app: transformDexArchiveWithExternalLibsDexMergerForDebug'.

java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

someone had a similar problem???

i soled problems, but dont know correctly how)))))

@hisothreed
Copy link

@Haqverdi

solved by adding those to app/build.gradle

defaultConfig {
       ...
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative57_5"
       ...
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:design:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"

implementation "com.facebook.react:react-native:+"  // From node_modules
implementation project(':react-native-navigation')

}

thame pushed a commit to thame/react-native-navigation that referenced this pull request Jan 16, 2019
@NweThazin
Copy link

Hi,

Which RNN version should I update to support react native 0.57.0?
thanks

@Haqverdi
Copy link

Hi,

Which RNN version should I update to support react native 0.57.0?
thanks

latest works good)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.