Yes
Yes and followed
macOS platform: El Capitan 10.11.6
package.json:
{
"name": "navigationApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.4.1",
"react-native": "0.56.0",
"react-native-navigation": "^1.1.478"
},
"devDependencies": {
"babel-jest": "23.4.0",
"babel-preset-react-native": "5.0.2",
"jest": "23.4.1",
"react-test-renderer": "16.4.1"
},
"jest": {
"preset": "react-native"
}
}
react-native init navigationApp
npm install --save react-native-navigation@latest
react-native run-android
in the project directoryProject run without an error
Running as Android thrown following error:
Moved to android folder in Terminal and ran ./gradlew clean
, that successfully completed.
Ran ./gradlew assembleDebug --stacktrace
in the same location, thrown a large error, following are excerpts from it:
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:201)
at com.android.build.gradle.internal.tasks.IncrementalTask.taskAction(IncrementalTask.java:82)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:163)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:134)
at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:123)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:115)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.execute(ExecuteActionsTaskExecuter.java:109)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:109)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:90)
... 70 more
Caused by: com.android.ide.common.process.ProcessException: Failed to execute aapt
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:867)
at com.android.build.gradle.tasks.ProcessAndroidResources.doFullTaskAction(ProcessAndroidResources.java:194)
... 82 more
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing process /Users/santanu/Library/Android/sdk/build-tools/26.0.2/aapt with arguments {package -f --no-crunch -I /Users/santanu/Library/Android/sdk/platforms/android-25/android.jar -M /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/manifests/aapt/release/AndroidManifest.xml -S /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/res/merged/release -m -J /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/generated/source/r/release --custom-package com.reactnativenavigation --non-constant-id -0 apk --output-text-symbols /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/bundles/default --no-version-vectors}
at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:299)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:286)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
at com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:865)
... 83 more
Caused by: com.android.ide.common.process.ProcessException: Error while executing process /Users/santanu/Library/Android/sdk/build-tools/26.0.2/aapt with arguments {package -f --no-crunch -I /Users/santanu/Library/Android/sdk/platforms/android-25/android.jar -M /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/manifests/aapt/release/AndroidManifest.xml -S /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/res/merged/release -m -J /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/generated/source/r/release --custom-package com.reactnativenavigation --non-constant-id -0 apk --output-text-symbols /Users/santanu/Documents/React Native/navigationApp/node_modules/react-native-navigation/android/app/build/intermediates/bundles/default --no-version-vectors}
at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:74)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:49)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:78)
at com.android.builder.internal.aapt.AbstractProcessExecutionAapt$1.onSuccess(AbstractProcessExecutionAapt.java:74)
at com.google.common.util.concurrent.Futures$6.run(Futures.java:1319)
at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:457)
at com.google.common.util.concurrent.ExecutionList.executeListener(ExecutionList.java:156)
at com.google.common.util.concurrent.ExecutionList.execute(ExecutionList.java:145)
at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:185)
at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:53)
at com.android.build.gradle.internal.process.GradleProcessExecutor$1.run(GradleProcessExecutor.java:60)
Caused by: org.gradle.process.internal.ExecException: Process 'command '/Users/santanu/Library/Android/sdk/build-tools/26.0.2/aapt'' finished with non-zero exit value 1
at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:369)
at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:47)
... 9 more
BUILD FAILED
Total time: 2.182 secs
I would suggest using react-native-navigation v2 as opposed to v1. v1 is getting very little support these days.
Yes I also doubted that. Thanks for suggesting.
But there also I faced a blocked #3641 , unfortunately.
Hmm, I have v2 building with rn-0.56.0 just fine. Do you have an example repo I can look at?
Thanks for asking! I have updated the project example link with #3641 issue!
@santanu4ver, I downloaded the example project you posted on your dropbox. I see several errors in build.gradle files and the MainApplication.java and MainActivity.java files. Are you sure you followed the instructions correctly? I made changes to get the app to compile but it doesn't launch because some image files are missing and a few other things.
I suspect what you posted is a mixture of RNN v1 and v2. Frankly, the gradle and java files were just wrong. I suggest you verify the steps you followed. I am happy to post the package with the changes I made.
Thank you @ujwal-setlur , I have updated #3641 with my findings.
Some suggestions requires here, giving the current state of the v2 project, and as Wix also wants us to concentrate on v2, do you think it's good to vouch for new projects now?
I know it's in alpha and more changes shall be applied, but you see I'm a little bit impatient to start my new project )
Thanks!
That's a good question. I personally have started a new project, and I have committed to v2 of this package. I almost went with V1, but was nervous about lack of support.
V2 is still very much a work in progress. In the early days, I was frustrated by updates breaking my app, but it has gotten much more stable. I am at a point where I feel I can build my app with this package, but I am trying not to use any fancy features yet. To be honest, I am frustrated that something as fundamental as navigation is left to third party libraries in react-native, and I have been burnt by other solutions before. So I try to structure my code where I can switch out my navigation package of needed (yes, wishful thinking :), but I try.
That said, I am gaining more confidence in this package.
Thank you so much, for your detailed sharing! That does returns some confidence to newcomer like me! :) Although, I see there are many assumption/discussion on redux integration (like this) as Wix did not present yet any v2 Redux best practices.
You have any thought on that, @ujwal-setlur ?
@santanu4ver I use Apollo and Redux in my app, though I currently use Redux only for determining connection status to my server (connected/not connected/logged in/not logged in) and presenting the appropriate screen. Essentially, I wrap all my screens with Apollo and Redux when I register the screens, and also pass the client and store as props directly to the screen component:
Navigation.registerComponent("login", () => withReduxAndApollo(Login, store, client));
import hoistNonReactStatic from "hoist-non-react-statics";
const withReduxAndApollo = (WrappedComponent, store, client) => {
type Props = {
componentId: string
};
class EnhancedComponent extends React.PureComponent<Props> {
render() {
return (
<ApolloProvider client={client}>
<Provider store={store}>
<WrappedComponent
{...this.props}
client={client}
store={store}
/>
</Provider>
</ApolloProvider>
);
}
}
// hoist our statics from the wrapped component to the enhanced component
hoistNonReactStatic(EnhancedComponent, WrappedComponent);
return EnhancedComponent;
};
Hope this helps.
By the way, I would seriously look at MobX vs Redux for state management. To me, it seems intuitively simpler, but I am not that familiar with it yet. But when I find the time, I will look at migrating from redux to mobx if it makes sense. Also, use state management only if you have to. I have built a fairly complex app without Redux before :)
Thank you again for some insight along with your thoughts @ujwal-setlur . I took sometime to balance between life and test out RN example with MobX - and I must say I loved it! This is much more simpler in my initial findings than Redux! Truthfully, RNN Redux implementation made me uneasy to an extent (because of its boilerplate/ways etc.), but anyway let's not to get into those complexities, when MobX is around!
I tested MobX with recent version of RN and hit by some blockers/errors. After have them fixed, application goes well. Later I moved to test to a RNN[v2] application. I tried to follow a [v1] boilerplate share from here. But I still having some problem to the components with @inject specifier:
Error: MobX injector: Store 'someStoreFile' is not available! Make sure it is provided by some Provider
To provide store files and Provider I followed this procedure from above Git link.
Did you able to ran any [v2] app with MobX @ujwal-setlur ?
Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you believe the issue is still relevant, please test on the latest version and report back. Thank you for your contributions.
The issue has been closed for inactivity.
Most helpful comment
That's a good question. I personally have started a new project, and I have committed to v2 of this package. I almost went with V1, but was nervous about lack of support.
V2 is still very much a work in progress. In the early days, I was frustrated by updates breaking my app, but it has gotten much more stable. I am at a point where I feel I can build my app with this package, but I am trying not to use any fancy features yet. To be honest, I am frustrated that something as fundamental as navigation is left to third party libraries in react-native, and I have been burnt by other solutions before. So I try to structure my code where I can switch out my navigation package of needed (yes, wishful thinking :), but I try.
That said, I am gaining more confidence in this package.