error: cannot find symbol class ReactApplication
I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:
error: cannot find symbol class ReactNativeHost
error: cannot find symbol class ReactApplication
It seems like Android Studio doesn't recognize:
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
android-studio react-native
|
show 1 more comment
I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:
error: cannot find symbol class ReactNativeHost
error: cannot find symbol class ReactApplication
It seems like Android Studio doesn't recognize:
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
android-studio react-native
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03
|
show 1 more comment
I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:
error: cannot find symbol class ReactNativeHost
error: cannot find symbol class ReactApplication
It seems like Android Studio doesn't recognize:
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
android-studio react-native
I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:
error: cannot find symbol class ReactNativeHost
error: cannot find symbol class ReactApplication
It seems like Android Studio doesn't recognize:
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
android-studio react-native
android-studio react-native
edited Nov 15 '18 at 20:09
M L
asked Nov 15 '18 at 12:32
M LM L
12
12
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03
|
show 1 more comment
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03
|
show 1 more comment
1 Answer
1
active
oldest
votes
Check your package.json. If it looks something like:
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
(Currently this is the case after ejecting from Expo: npm run eject
)
Then reinstall react-native:
npm uninstall react-native
npm install react-native
You package.json looks like below now:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
Now try rebuilding your project in Android Studio, the error should go away.
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319605%2ferror-cannot-find-symbol-class-reactapplication%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Check your package.json. If it looks something like:
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
(Currently this is the case after ejecting from Expo: npm run eject
)
Then reinstall react-native:
npm uninstall react-native
npm install react-native
You package.json looks like below now:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
Now try rebuilding your project in Android Studio, the error should go away.
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
add a comment |
Check your package.json. If it looks something like:
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
(Currently this is the case after ejecting from Expo: npm run eject
)
Then reinstall react-native:
npm uninstall react-native
npm install react-native
You package.json looks like below now:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
Now try rebuilding your project in Android Studio, the error should go away.
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
add a comment |
Check your package.json. If it looks something like:
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
(Currently this is the case after ejecting from Expo: npm run eject
)
Then reinstall react-native:
npm uninstall react-native
npm install react-native
You package.json looks like below now:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
Now try rebuilding your project in Android Studio, the error should go away.
Check your package.json. If it looks something like:
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz"
(Currently this is the case after ejecting from Expo: npm run eject
)
Then reinstall react-native:
npm uninstall react-native
npm install react-native
You package.json looks like below now:
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.1"
},
Now try rebuilding your project in Android Studio, the error should go away.
edited Jan 26 at 9:45
answered Jan 26 at 0:28
YuciYuci
4,2463137
4,2463137
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
add a comment |
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
I can't solve the same error with the above solution
– Shubham1164
Jan 31 at 7:27
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53319605%2ferror-cannot-find-symbol-class-reactapplication%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can anyone help with this one???
– M L
Nov 15 '18 at 12:55
is it working correctly when u run this with react-native run-android ?
– Lucefer
Nov 15 '18 at 15:18
No, @Lucefer . The thing is the project syncs correctly, but when I run it on the emulator, it gives that error.
– M L
Nov 15 '18 at 16:24
What version of RN are you using, and what does your MainApplication look like?
– Kai
Nov 15 '18 at 17:35
RN VERSION: react-native@0.57.5
– M L
Nov 15 '18 at 20:03