Cole Mangio
Cole Mangio

Reputation: 79

create-react-native-app not working anymore?

I'm still new to anything to do with expo and create-react-native-app. So here's my question. While learning react-native I've always used create-react-native-app to do so and it works fine, until one day, I did create-react-native-app and it showed an expo template this time. So I went along with the 'blank project' option. Then I run npm run eject as I would normally, but now I get a :app:compileDebugJavaWithJavac FAILED exception.

Heres the exact prompt.

:app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard :app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:5: error: cannot find symbol import com.facebook.react.ReactApplication; ^ symbol: class ReactApplication location: package com.facebook.react E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:6: error: cannot find symbol import com.facebook.react.ReactNativeHost; ^ symbol: class ReactNativeHost location: package com.facebook.react E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:14: error: cannot find symbol public class MainApplication extends Application implements ReactApplication { ^ symbol: class ReactApplication E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:16: error: cannot find symbol private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { ^ symbol: class ReactNativeHost location: class MainApplication E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:36: error: cannot find symbol public ReactNativeHost getReactNativeHost() { ^ symbol: class ReactNativeHost location: class MainApplication E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainActivity.java:5: error: MainActivity is not abstract and does not override abstract method getPackages() in ReactActivity public class MainActivity extends ReactActivity { ^ E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:16: error: cannot find symbol private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { ^ symbol: class ReactNativeHost location: class MainApplication E:\A_PhoneApps\Tests\CoolProject\android\app\src\main\java\com\emptyprojecttemplate\MainApplication.java:35: error: method does not override or implement a method from a supertype @Override ^ 8 errors :app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 14.001 secs Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html

Now I have checked all the docs and went through the whole native code guide over and over again and I still can't fix it. I went into the projects package.json to see react-native' versions and it is set to:

"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz"

Before it would look like this:

"react-native": "~0.56.1"

I'm really really confused! what's happening here???

Upvotes: 0

Views: 777

Answers (1)

Tarreq
Tarreq

Reputation: 1365

Try to reinstall java jdk and make sure that JAVA_HOME environment variables are set correctly.

Upvotes: 0

Related Questions