- I was following the instructions to set up the react-native examples (UIExplorer, Movies etc.) pulled from GIT, following the instructions set up at - https://github.com/facebook/react-native
- I am attempting to set it up to preview the examples via the Genymotion Android Simulator on a Mac. *All previous steps regarding setup, pulling the repo, etc. are successful with no errors. *I then execute the following statement at the bash shell on Mac
./gradlew :Examples:UIExplorer:android:app:installDebug
The following error is shown while building.
_:Examples:UIExplorer:android:app:compileDebugJavaWithJavac /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:63: error: cannot find symbol
mReactInstanceManager.onPause(); ^
symbol: method onPause() location: variable mReactInstanceManager of type ReactInstanceManager /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:72: error: cannot find symbol
mReactInstanceManager.onResume(this, this); ^
symbol: method onResume(UIExplorerActivity,UIExplorerActivity) location: variable mReactInstanceManager of type ReactInstanceManager 2 errors :Examples:UIExplorer:android:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED_
Using the --debug parameter reveals similar info
11:47:06.178 [INFO] [org.gradle.api.internal.tasks.compile.JdkJavaCompiler] Compiling with JDK Java compiler API.
11:47:06.434 [ERROR] [system.err] /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:63: error: cannot find symbol
11:47:06.434 [ERROR] [system.err] mReactInstanceManager.onPause();
11:47:06.434 [ERROR] [system.err]
^ 11:47:06.435 [ERROR] [system.err] symbol: method onPause()11:47:06.435 [ERROR] [system.err] location: variable mReactInstanceManager of type ReactInstanceManager
11:47:06.440 [ERROR] [system.err] /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:72: error: cannot find symbol
11:47:06.441 [ERROR] [system.err] mReactInstanceManager.onResume(this, this);
11:47:06.441 [ERROR] [system.err] ^ 11:47:06.441 [ERROR] [system.err] symbol: method onResume(UIExplorerActivity,UIExplorerActivity)
11:47:06.441 [ERROR] [system.err] location: variable mReactInstanceManager of type ReactInstanceManager
11:47:06.464 [ERROR] [system.err] 2 errors
11:47:06.465 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Finished executing task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'
11:47:06.465 [LIFECYCLE] [class org.gradle.TaskExecutionLogger] :Examples:UIExplorer:android:app:compileDebugJavaWithJavac FAILED
11:47:06.466 [INFO] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] :Examples:UIExplorer:android:app:compileDebugJavaWithJavac (Thread[Daemon worker Thread 4,5,main]) completed. Took 0.319 secs.
11:47:06.466 [DEBUG] [org.gradle.execution.taskgraph.AbstractTaskPlanExecutor] Task worker [Thread[Daemon worker Thread 4,5,main]] finished, busy: 5.546 secs, idle: 0.049 secs
11:47:06.468 [ERROR] [org.gradle.BuildExceptionReporter]
11:47:06.468 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
11:47:06.468 [ERROR] [org.gradle.BuildExceptionReporter]
11:47:06.469 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
11:47:06.469 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'.
11:47:06.469 [ERROR] [org.gradle.BuildExceptionReporter] > Compilation failed; see the compiler error output for details.
11:47:06.469 [ERROR] [org.gradle.BuildExceptionReporter]
11:47:06.469 [ERROR] [org.gradle.BuildExceptionReporter] * Try:
11:47:06.470 [ERROR] [org.gradle.BuildExceptionReporter] Run with --stacktrace option to get the stack trace.
11:47:06.471 [LIFECYCLE] [org.gradle.BuildResultLogger]
11:47:06.471 [LIFECYCLE] [org.gradle.BuildResultLogger] BUILD FAILED
11:47:06.471 [LIFECYCLE] [org.gradle.BuildResultLogger]
11:47:06.471 [LIFECYCLE] [org.gradle.BuildResultLogger] Total time: 14.184 secs
11:47:07.413 [INFO] [org.gradle.launcher.daemon.client.DaemonClient] Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task
':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'.] from daemon DaemonInfo{pid=23827, address=[0c64a320-a8e2-43e3-ad0a-0b3dfff7feca port:65276, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], idle=true,
context=DefaultDaemonContext[uid=dba435c0-a637-4e5b-8486-166f81a1489c,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home,daemonRegistryDir=/Users/xxx/.gradle/daemon,pid=23827,idleTimeout=10800000,daemonOpts=-XX> :MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
and using the -info parameter also returns the same information
Executing task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac' (up-to-date check took 0.004 secs) due to: No history is available. All input files are considered out-of-date for incremental task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'. Compiling with JDK Java compiler API. /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:63: error: cannot find symbol mReactInstanceManager.onPause(); ^ symbol: method onPause() location: variable mReactInstanceManager of type ReactInstanceManager /Users/xxx/gitRepo/react-native/Examples/UIExplorer/android/app/src/main/java/UIExplorerActivity.java:72: error: cannot find symbol mReactInstanceManager.onResume(this, this); ^ symbol: method onResume(UIExplorerActivity,UIExplorerActivity) location: variable mReactInstanceManager of type ReactInstanceManager 2 errors :Examples:UIExplorer:android:app:compileDebugJavaWithJavac FAILED :Examples:UIExplorer:android:app:compileDebugJavaWithJavac (Thread[Daemon worker Thread 5,5,main]) completed. Took 0.418 secs.
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'. Compilation failed; see the compiler error output for details.
Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 7.151 secs Stopped 0 compiler daemon(s). Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Execution failed for task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'.] from daemon DaemonInfo{pid=23827, address=[0c64a320-a8e2-43e3-ad0a-0b3dfff7feca port:65276, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], idle=true, context=DefaultDaemonContext[uid=dba435c0-a637-4e5b-8486-166f81a1489c,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home,daemonRegistryDir=/Users/xxx/.gradle/daemon,pid=23827,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
using --stacktrace returns
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':Examples:UIExplorer:android:app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:69) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:46)
... (did not want to put the whole stacktrace unless you want it)
All the types of errors indicate that UIExplorerActivity.java has an error onPause() and onResume() while compiling.
I have already looked at similar issues on this list, including - https://github.com/facebook/react-native/issues/5790 - https://github.com/facebook/react-native/issues/4858
as well as issues on stackoverflow, including
React native Android Example does not work
React Native make android app load in genymotion
and a few others but they do not appear to be related to this issue (as it is either a different class that is failing or a different issue that causes the same result.
Notes: building the iOS version works fine (with xCode etc.).
How to fix this? Any insight appreciated. thanks..
Edward