I am experiencing the following problem when trying to install NativeBase for my React Native project on Windows 10
react-native init RNappcd RNappnpm install native-base --savereact-native link react-native-vector-icons- Edit
android/app/build.gradleand add the followingto the end of file:
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Running echo %JAVA_HOME% gives C:\Program Files\Java\jdk1.8.0_111
Now when I run
react-native run-android
the build fails with the following error. Is there a solution to this problem?
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:6: error: cannot find s
mbol
import com.facebook.react.ReactApplication;
^
symbol: class ReactApplication
location: package com.facebook.react
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:9: error: cannot find s
mbol
import com.facebook.react.ReactNativeHost;
^
symbol: class ReactNativeHost
location: package com.facebook.react
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:17: error: cannot find
ymbol
public class MainApplication extends Application implements ReactApplication {
^
symbol: class ReactApplication
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:19: error: cannot find
ymbol
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
symbol: class ReactNativeHost
location: class MainApplication
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:35: error: cannot find
ymbol
public ReactNativeHost getReactNativeHost() {
^
symbol: class ReactNativeHost
location: class MainApplication
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainActivity.java:5: error: MainActivity is
ot abstract and does not override abstract method getPackages() in ReactActivity
public class MainActivity extends ReactActivity {
^
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:19: error: cannot find
ymbol
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
symbol: class ReactNativeHost
location: class MainApplication
C:\Users\y\RNapp\android\app\src\main\java\com\rnapp\MainApplication.java:34: error: method does
ot override or implement a method from a supertype
@Override
^
8 errors
:app:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':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
Total time: 6.098 secs