error: cannot find symbol class ReactApplication












0















I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:



enter image description hereenter image description here



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;









share|improve this question

























  • 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
















0















I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:



enter image description hereenter image description here



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;









share|improve this question

























  • 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














0












0








0








I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:



enter image description hereenter image description here



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;









share|improve this question
















I can't run my react-native project because of this Java Compiler error. Below is an image of error logs attached for reference:



enter image description hereenter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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












1 Answer
1






active

oldest

votes


















0














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.






share|improve this answer


























  • I can't solve the same error with the above solution

    – Shubham1164
    Jan 31 at 7:27











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
});


}
});














draft saved

draft discarded


















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









0














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.






share|improve this answer


























  • I can't solve the same error with the above solution

    – Shubham1164
    Jan 31 at 7:27
















0














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.






share|improve this answer


























  • I can't solve the same error with the above solution

    – Shubham1164
    Jan 31 at 7:27














0












0








0







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.






share|improve this answer















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.







share|improve this answer














share|improve this answer



share|improve this answer








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



















  • 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




















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Xamarin.iOS Cant Deploy on Iphone

Glorious Revolution

Dulmage-Mendelsohn matrix decomposition in Python