I have created project using expo ie expo init helloworld
then ejected it using expo eject
.
And then I tried to run in emulator with yarn run android
.
I got the following error.
$ yarn run android
yarn run v1.3.2
$ react-native run-android
Scanning folders for symlinks in D:\gajurlab\helloworld\node_modules (25ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee081Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore081Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline081Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp081Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0201Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:5: error: cannot find symbol
import com.facebook.react.ReactApplication;
^
symbol: class ReactApplication
location: package com.facebook.react
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:6: error: cannot find symbol
import com.facebook.react.ReactNativeHost;
^
symbol: class ReactNativeHost
location: package com.facebook.react
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:14: error: cannot find symbol
public class MainApplication extends Application implements ReactApplication {
^
symbol: class ReactApplication
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:16: error: cannot find symbol
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
symbol: class ReactNativeHost
location: class MainApplication
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:36: error: cannot find symbol
public ReactNativeHost getReactNativeHost() {
^
symbol: class ReactNativeHost
location: class MainApplication
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainActivity.java:5: error: MainActivity is not abstract and does not override abstract method getPackages() in ReactActivi
ty
public class MainActivity extends ReactActivity {
^
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\MainApplication.java:16: error: cannot find symbol
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
symbol: class ReactNativeHost
location: class MainApplication
D:\gajurlab\helloworldandroidappsrcmain\java\commynewproject\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.
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: 9.46 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
Done in 12.38s.
$ react-native info
Scanning folders for symlinks in D:\gajurlab\helloworld\node_modules (25ms)
Environment:
OS: Windows 8.1
Node: 8.9.4
Yarn: 1.3.2
npm: 5.6.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 3.1.0.0 AI-173.4720617
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
I have the same issue. Seems like "android" folder is missing referenced here:
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
same problem here ... please help us
I have the same problem...and I looked into node_modules/react-native and there is no "android" folder like it used to be in previous version, did you find any solution?
I solved it by:
change the line below in android/app/build.gradle file from
implementation "com.facebook.react:react-native:+" // From node_modules
to specific version of my react-native as in package.json
implementation "com.facebook.react:react-native:0.57.5" // From node_modules
@phorvicheka doesnt works
Could not find com.facebook.react:react-native:0.57.1.
Searched in the following locations:
file:/home/username/Android/Sdk/extras/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
Edit
This was the reason
https://github.com/facebook/react-native/issues/21722#issuecomment-438819200
I had the same problem - adding the following block to allprojects.repositories
in the project's build.gradle
fixed it for me:
maven {
url "$rootDir/../node_modules/react-native/android"
}
Versions
Android Studio: 3.4 Canary 10
gradle: 5.1
react-navive: 0.57.8
I have the same problem, and i have tried suggested solutions here and even in stack overflow, but none worked for me. Also i couldn't find "android" folder in node_modules/react-native folder
At the end, I stopped trying using expo and then eject the app, instead of that, I used the option "Build Projects with native code" from React Native official page, https://facebook.github.io/react-native/docs/getting-started...and It worked like expected
I also have same problem. I follow all the suggestions which are provided here.
@brien-givens "allprojects.repositories" is already present in my build.gradle. Please suggest.
I do not find 'android' folder under node_modules/react-native.
Running _npm_: 6.7.0 and _node_: v11.8.0
I see ReactAndroid folder under $rootDir/../node_modules/react-native/
. Perhaps update it in build.gradle
?
Any update on this?
Just updated from 0.57.8
to the latest version - I'm seeing the same issue, but can build by replacing implementation "com.facebook.react:react-native:+"
with implementation "com.facebook.react:react-native:0.58.3"
OK, I've figured out the problem, at least in my case.
Running ./gradlew app:dependencies
shows that react-native-sound
specifies an ancient RN version, and that's taking precedence.
What I can't work out is why it resolves correctly if I go back to the commit before the upgrade:
+--- project :react-native-sound
| \--- com.facebook.react:react-native:0.12.+ -> 0.57.8 (*)
+--- project :react-native-sound
| \--- com.facebook.react:react-native:0.12.+ -> 0.12.0 (*)
Maybe a change in resolution rules on the newer gradle version that ships with 0.58?
I had the same problem, follow the link: node_modules/react-native/android/com.facebbok.react/react-native.
You can see the react-native version.
after: change (build.gradle(app)):
(implementation "com.facebook.react:react-native:+") -> (implementation "com.facebook.react:react-native:0.58.4")
My version: 0.58.4
it worked for me.
didn't work for me..
first of all i couldn't find android folder inside react-native
second, it kept telling me this
Could not find com.facebook.react:react-native:0.57.1.
Searched in the following locations:
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/google/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/google/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/android/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
file:/C:/Users/Fahmy/AppData/Local/Android/Sdk/extras/android/m2repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
file:/C:/Users/Fahmy/.m2/repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
file:/C:/Users/Fahmy/.m2/repository/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
https://jcenter.bintray.com/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
https://jcenter.bintray.com/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
file:/C:/Users/Fahmy/Desktop/dex_Spring/maxApp/node_modules/react-native/android/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
file:/C:/Users/Fahmy/Desktop/dex_Spring/maxApp/node_modules/react-native/android/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
https://dl.google.com/dl/android/maven2/com/facebook/react/react-native/0.57.1/react-native-0.57.1.pom
https://dl.google.com/dl/android/maven2/com/facebook/react/react-native/0.57.1/react-native-0.57.1.jar
Required by:
project :app
Same as ChaabaneFahmi for me!
Same here. No android folder in react-native/
Java compiler displays : cannot find symbol class ReactApplication and cannot find symbol ReactNativeHost.
Any update ?
In my case:
react-native link --> solved the error.
If when you do it you get problems with the glob run first:
npm install --save glob
Getting very similar error within packageList (also get in MainApplication if link in there):
--/proj/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:75: error: cannot find symbol
new AppCenterReactNativePackage(MainApplication.this),
^
symbol: class MainApplication
location: class PackageList
--/proj/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:76: error: cannot find symbol
new AppCenterReactNativeAnalyticsPackage(MainApplication.this, getResources().getString(R.string.appCenterAnalytics_whenToEnableAnalytics)),
^
symbol: class MainApplication
location: class PackageList
--/proj/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:77: error: cannot find symbol
new AppCenterReactNativeCrashesPackage(MainApplication.this, getResources().getString(R.string.appCenterCrashes_whenToSendCrashes)),
^
symbol: class MainApplication
location: class PackageList
3 errors
(For now removed as not essential)
After many attempts, this error came back to me all the time, I created new projects and nothing. At the end I saw in a video that instead of using expo eject they used the command react-native eject.
It seemed silly but I tried it and it seems that I must work in another way since I managed to make the mistake. I wanted to do the eject to work with realm and I got it installed and it worked ^^
Sorry if you do not understand, use google translator.
Summary use react-native eject instead of expo eject. Good luck
@aronedwards91 did you find any solution?
I don't know if I'm the only one but my error looks like this:
````
Task :app:compileReleaseJavaWithJavac FAILED
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:5: error: package android.support.multidex does not exist
import android.support.multidex.MultiDexApplication;
^
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:7: error: cannot find symbol
import com.facebook.react.PackageList;
^
symbol: class PackageList
location: package com.facebook.react
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:41: error: cannot find symbol
public class MainApplication extends MultiDexApplication implements ReactApplication {
^
symbol: class MultiDexApplication
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:5: error: package android.support.v7.app does not exist
import android.support.v7.app.AppCompatActivity;
^
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:7: error: cannot find symbol
public class SplashActivity extends AppCompatActivity {
^
symbol: class AppCompatActivity
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:43: error: incompatible types: MainApplication cannot be converted to Application
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:52: error: cannot find symbol
Listpackages = new PackageList(this).getPackages();
^
symbol: class PackageList
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:54: error: no suitable method found for add(SvgPackage,RNFSPackage,RNDeviceInfo,PickerPackage,RNSentryPackage,RNLocationPackage,ReactVideoPackage,RNFirebasePackage,RNFetchBlobPackage,VectorIconsPackage,RNGooglePlacesPackage,RNFirebaseAuthPackage,LinearGradientPackage,RNGoogleSigninPackage,RNFirebaseAdMobPackage,SplashScreenReactPackage,RNFirebaseFirestorePackage,RNFirebaseMessagingPackage,RNFirebaseNotificationsPackage,ReactNativeLocalizationPackage)
packages.add(
^
method Collection.add(ReactPackage) is not applicable
(actual and formal argument lists differ in length)
method List.add(ReactPackage) is not applicable
(actual and formal argument lists differ in length)
method List.add(int,ReactPackage) is not applicable
(actual and formal argument lists differ in length)
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:43: error: cannot find symbol
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
^
symbol: constructor (MainApplication)
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:90: error: method does not override or implement a method from a supertype
@Override
^
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:92: error: cannot find symbol
super.onCreate();
^
symbol: variable super
location: class MainApplication
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:93: error: cannot find symbol
AppEventsLogger.activateApp(this);
^
symbol: variable AppEventsLogger
location: class MainApplication
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainApplication.java:94: error: no suitable method found for init(MainApplication,boolean)
SoLoader.init(this, /* native exopackage */ false);
^
method SoLoader.init(Context,int) is not applicable
(argument mismatch; MainApplication cannot be converted to Context)
method SoLoader.init(Context,boolean) is not applicable
(argument mismatch; MainApplication cannot be converted to Context)
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/MainActivity.java:13: error: cannot find symbol
MainApplication.getCallbackManager().onActivityResult(requestCode, resultCode, data);
^
symbol: method getCallbackManager()
location: class MainApplication
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:8: error: method does not override or implement a method from a supertype
@Override
^
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:10: error: cannot find symbol
super.onCreate(savedInstanceState);
^
symbol: variable super
location: class SplashActivity
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:12: error: no suitable constructor found for Intent(SplashActivity,Class)
Intent intent = new Intent(this, MainActivity.class);
^
constructor Intent.Intent(String,Uri) is not applicable
(argument mismatch; SplashActivity cannot be converted to String)
constructor Intent.Intent(Context,Class>) is not applicable
(argument mismatch; SplashActivity cannot be converted to Context)
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:13: error: cannot find symbol
startActivity(intent);
^
symbol: method startActivity(Intent)
location: class SplashActivity
/Users/waltermonecke/Documents/Code/React-Native2/moodPixel/android/app/src/main/java/com/moodpixel/SplashActivity.java:14: error: cannot find symbol
finish();
^
symbol: method finish()
location: class SplashActivity
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
19 errors
````
i also getting error while build android package error
Task :app:compileDebugJavaWithJavac FAILED
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:5: error: cannot find symbol
import com.airbnb.android.react.lottie.LottiePackage;
^
symbol: class LottiePackage
location: package com.airbnb.android.react.lottie
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:11: error: cannot find symbol
import com.oblador.vectoricons.VectorIconsPackage;
^
symbol: class VectorIconsPackage
location: package com.oblador.vectoricons
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:12: error: cannot find symbol
import com.reactnative.ivpusic.imagepicker.PickerPackage;
^
symbol: class PickerPackage
location: package com.reactnative.ivpusic.imagepicker
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:13: error: cannot find symbol
import com.reactnativecommunity.netinfo.NetInfoPackage;
^
symbol: class NetInfoPackage
location: package com.reactnativecommunity.netinfo
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:14: error: cannot find symbol
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
^
symbol: class RNGestureHandlerPackage
location: package com.swmansion.gesturehandler.react
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainActivity.java:6: error: cannot find symbol
import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
^
symbol: class RNGestureHandlerEnabledRootView
location: package com.swmansion.gesturehandler.react
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:31: error: cannot find symbol
packages.add(new NetInfoPackage());
^
symbol: class NetInfoPackage
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:32: error: cannot find symbol
packages.add(new LottiePackage());
^
symbol: class LottiePackage
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:33: error: cannot find symbol
packages.add(new RNGestureHandlerPackage());
^
symbol: class RNGestureHandlerPackage
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:34: error: cannot find symbol
packages.add(new PickerPackage());
^
symbol: class PickerPackage
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainApplication.java:35: error: cannot find symbol
packages.add(new VectorIconsPackage());
^
symbol: class VectorIconsPackage
/Users/laptop-obs-31/subash/Projects/pharmabox/15:7:19/android/app/src/main/java/com/pharmabox/MainActivity.java:24: error: cannot find symbol
return new RNGestureHandlerEnabledRootView(MainActivity.this);
^
symbol: class RNGestureHandlerEnabledRootView
12 errors
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. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 22s
82 actionable tasks: 2 executed, 80 up-to-date
I'm having this error:
android/app/src/main/java/com/emphy/MainApplication.java:7: error: cannot find symbol
import com.facebook.react.PackageList;
^
symbol: class PackageList
location: package com.facebook.react
/Users/irynapolishchuk/mobile/android/app/src/main/java/com/emphy/MainApplication.java:45: error: cannot find symbol
List<ReactPackage> packages = new PackageList(this).getPackages();
^
symbol: class PackageList
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDevDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
[email protected]
└── @react-native-community/[email protected]
com.android.tools.build:gradle:3.4.1
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
....
}
I've been updating RN 0.55.4 -> 0.60.4
@juroMin me too, any fix?
I am too facing a similar issue.. while upgrading my app from RN 0.57 to RN 0.60. After making
required changes to the packages, all I see is this:
I'm having this error:
android/app/src/main/java/com/emphy/MainApplication.java:7: error: cannot find symbol import com.facebook.react.PackageList; ^ symbol: class PackageList location: package com.facebook.react /Users/irynapolishchuk/mobile/android/app/src/main/java/com/emphy/MainApplication.java:45: error: cannot find symbol List<ReactPackage> packages = new PackageList(this).getPackages(); ^ symbol: class PackageList 2 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDevDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7[email protected]
└── @react-native-community/[email protected]com.android.tools.build:gradle:3.4.1
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
....
}I've been updating RN 0.55.4 -> 0.60.4
facing same issue while upgrade from RN 0.59.9 to 0.60.5.
I'm having this error:
android/app/src/main/java/com/emphy/MainApplication.java:7: error: cannot find symbol import com.facebook.react.PackageList; ^ symbol: class PackageList location: package com.facebook.react /Users/irynapolishchuk/mobile/android/app/src/main/java/com/emphy/MainApplication.java:45: error: cannot find symbol List<ReactPackage> packages = new PackageList(this).getPackages(); ^ symbol: class PackageList 2 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDevDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7[email protected]
└── @react-native-community/[email protected]com.android.tools.build:gradle:3.4.1
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
....
}I've been updating RN 0.55.4 -> 0.60.4
having the same issue while upgrade from RN 0.59 to 0.60
@juroMin were you able to find any solution?
while upgrading to from RN 0.59.9 to 0.60.5 using https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.60.5 i forgot to make changes in android/app/build.gradle file, after making the following changes my issue was solved
Note: by default android/app/build.gradle is not expanded.
@basha777 try adding to the bottom of your app/build.gradle
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle")
applyNativeModulesAppBuildGradle(project)
@basha777 try adding to the bottom of your app/build.gradle
task copyDownloadableDepsToLibs(type: Copy) { from configurations.compile into 'libs' } apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle") applyNativeModulesAppBuildGradle(project)
@ckOfor my issue is solved now.
I'm having this error:
android/app/src/main/java/com/emphy/MainApplication.java:7: error: cannot find symbol import com.facebook.react.PackageList; ^ symbol: class PackageList location: package com.facebook.react /Users/irynapolishchuk/mobile/android/app/src/main/java/com/emphy/MainApplication.java:45: error: cannot find symbol List<ReactPackage> packages = new PackageList(this).getPackages(); ^ symbol: class PackageList 2 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:compileDevDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details.
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.4 => 0.60.4
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-git-upgrade: 0.2.7
[email protected]
└── @react-native-community/[email protected]
com.android.tools.build:gradle:3.4.1
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"
....
}
I've been updating RN 0.55.4 -> 0.60.4having the same issue while upgrade from RN 0.59 to 0.60
@juroMin were you able to find any solution?
@SameeraMadushan refer my comment
while upgrading to from RN 0.59.9 to 0.60.5 using https://react-native-community.github.io/upgrade-helper/?from=0.59.9&to=0.60.5 i forgot to make changes in android/app/build.gradle file, after making the following changes my issue was solved
Note: by default android/app/build.gradle is not expanded.
In my case, the problem is solved by appending apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
at the bottom of android/app/build.gradle
.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Most helpful comment
I solved it by:
change the line below in android/app/build.gradle file from
implementation "com.facebook.react:react-native:+" // From node_modules
to specific version of my react-native as in package.json
implementation "com.facebook.react:react-native:0.57.5" // From node_modules