henrybbosa
henrybbosa

Reputation: 1125

Can not find symbol in MainActivity.java React-native Android

I am adding image upload in my react native application. I installed well via npm and also linked them very well

react-native link react-native-image-picker
react-native link react-native-image-resizer
react-native link react-native-fs

now everytime i try to run the project i get these Errors

Task :app:compileDebugJavaWithJavac C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:6: error: package com.rnfs does not exist import com.rnfs.RNFSPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:7: error: package fr.bamlab.rnimageresizer does not exist import fr.bamlab.rnimageresizer.ImageResizerPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:8: error: package com.imagepicker does not exist import com.imagepicker.ImagePickerPackage; ^ C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:30: error: cannot find symbol new RNFSPackage(), ^ symbol: class RNFSPackage C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:31: error: cannot find symbol new ImageResizerPackage(), ^ symbol: class ImageResizerPackage C:\projects\aurity\potatoo\potato\android\app\src\main\java\com\potato2\MainApplication.java:32: error: cannot find symbol new ImagePickerPackage(), ^

symbol: class ImagePickerPackage

When i check MainApplication.java and MainActivity.java I have the package lines there. Any one Help? I cant figure out why this is happening and the solution

Upvotes: 1

Views: 3201

Answers (1)

Sandupa Dalugoda
Sandupa Dalugoda

Reputation: 1159

Adding following lines to the app/build.gradle fixed my issue,

dependencies {
compile project(path: ':react-native-image-resizer')
compile project(path: ':react-native-fs')
compile project(path: ':react-native-image-picker')
}

Upvotes: 2

Related Questions