Closed ujwal-setlur closed 6 years ago
+1
iOS build is fine.
@emiyake, I tried your patch, and the compilation goes through, but I am getting an error on android when the app loads. On iOS, it is just fine. I am not sure whether this is related to this issue
It seems this is more of a react issue, but it happens only on Android, and the exact same code was working on react-native 0.55.4 and rnn-2.0.2397
I tested it on react-native@0.56.0.
If you're using react-native@0.55.4 you might want to downgrade to react-native-navigation@2.0.2395
Will try that later tonight. Did something go into 2.0.2397 that would cause this?
Just to reiterate, react-native 0.55.4 and rnn-2.0.2397 works just fine.
When I used react-native 0.56.0, I saw the problem I originally reported where I could not even build. With your patch applied, I can build with react-native 0.56.0, but then get the react error shown in the screenshot.
@emiyake, I tried rnn-2.0.2395, and I could build it with rn-0.56.0 fine without having to apply your pull-request, but I still get the same react error on app load as seen in the screenshot above. I was not getting this with rn-0.55.4. This is happening only on android, and not iOS.
OK, I think this is something specific to my environment. I stripped it down to a very basic app, and it loads ok.
It turns out there was a polyfill I was using on android that was causing this:
import "core-js/es6/symbol";
@ujwal-setlur Yes.rnn-2.0.2395 doesn't require the pull request. rnn-2.0.2395 with rn-0.56.0 works fine without any patch.
Only rnn-2.0.2397 causes the error you described in the beginning of this thread.
Yep, that's resolved with your change. The other problem I described was due to my use of a polyfill.
Im seeing this on 2.0.2404
To deal with this issue, I did:
// path: node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/JsDevReloadHandler.java
/* modify onSuccess() with onSuccess(@Nullable NativeDeltaClient nativeDeltaClient)
@Override
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
UiUtils.runOnMainThread(reloadListener::onReload);
}
//path: node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java
/* change onSuccess() with onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) */
@Override
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
}
//path: node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactNativeHost.java
/* Here just passed down the nativeDeltaClient instance */
@Override
public void onSuccess(NativeDeltaClient nativeDeltaClient) {
if (bundleListener != null) {
bundleListener.onSuccess(nativeDeltaClient);
}
}
//path: node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/react/ReloadHandler.java
/* add nativeDeltaClient to onSuccess() */
@Override
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
onReloadListener.run();
}
That solved the issue, off course I'm just guessing... but worked for me. But it seemed like the interfaces signatura have changed but not its implementations, looks like a bad merge.
I made the same changes in my own fork of 2.0.2404 and its all good. yeah must be bad merge ^
I don't believe @emiyake's PR has been merged.
Just to clarify - is there a pending fix for this??
I hope so, because otherwise, rnn can't build with rn-0.56.0. I am currently using @emiyake's patch with patch-package
Looks like the patch was merged and a version with the change is on NPM however I still get the error.
I will check in just a bit, but make sure you actually got the latest version. That has tripped me up sometimes, particularly if you have yarn.lock or package-lock.json lying around
@haswalt, you are correct. I just checked with 2.0.2418, and the build fails.
@haswalt, please set:
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative56"
in android/app/build.gradle
Build goes through then.
This is now resolved in 2.0.2418, but please note comment above. Documentation needs to be updated
@ujwal-setlur I still can't get this to build. Tried a fresh project, followed setup instructions with change above for reactNative56 and i get the same error messages.
I see that Task :react-native-navigation:compileReactNative56ReleaseJavaWithJavac
runs correctly first followed by the failing Task :react-native-navigation:compileReactNative51ReleaseJavaWithJavac FAILED
app/build.gradle
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.kitchensink"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative56"
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
build.gradle
ext {
buildToolsVersion = "27.0.3"
minSdkVersion = 25
compileSdkVersion = 27
targetSdkVersion = 26
supportLibVersion = "26.1.0"
}
note this is the issue reported here: https://github.com/wix/react-native-navigation/issues/3388#issuecomment-402637025
If I delete the productFlavours that i'm not using from the lib I have no issues building, unfortunately I don't know enough about android and gradle to work out why al productFlavors are being built
@haswalt, are you doing a debug build or release build? Let me try on a fresh protect as well
@ujwal-setlur Release build.
For those hitting this issue I'm using patch-package and this patch:
patch-package
--- a/node_modules/react-native-navigation/lib/android/app/build.gradle
+++ b/node_modules/react-native-navigation/lib/android/app/build.gradle
@@ -48,12 +48,6 @@ android {
}
flavorDimensions "RNN.reactNativeVersion"
productFlavors {
- reactNative51 {
- dimension "RNN.reactNativeVersion"
- }
- reactNative55 {
- dimension "RNN.reactNativeVersion"
- }
reactNative56 {
dimension "RNN.reactNativeVersion"
}
same with debug build
@haswalt this is different issue. Try this fix: https://github.com/wix/react-native-navigation/issues/3388#issuecomment-399071604
hi @sytolk just update to 2.0.2435 still the issue downgrade to 2.0.2425 fix it
solved 👍
"react-native": "0.56.0",
"react-native-navigation": "^2.0.2427",
I will close this as this seems to be working. Works for me at least...
I'm still getting this issue. I'm running RNN 2.0.2427
with RN 0.56.0
and debug build works fine, however a release build fails with the above issues. (And yes I'm using the right build flavour)
we were using app:assembleDebug
but weren't passing the app
prefix for the release build. We've added this and the build issues seem to have been resolved 👍
I'm also still getting this issue. Running RN 0.56 with RNN 2.0.2577. Also tried latest version 2.0.2582. All the above solutions don't work. Any suggestions?
For me, debug was working but release was failing with above issue. The solution was to add filter for reactNative57 too because the error message was containing stuff with
generateReactNative57ReleaseRFile
Issue Description
android build fails with:
Environment