Closed stefblokdijk closed 4 years ago
Thanks @stefblokdijk for raising the issue.
This error occurs when the library is not linked properly, basically at the shared line number it is trying to invoke native module API which apparently is undefined. Can you please validate the Android
setup steps defined in the README
.
Please let me know incase it does not works.
Thanks </ Pranav >
Hello prscX. I'm flowing 'Getting started' in your README file. and get the same error when I set 'state.sheetView' is true in IOS and working in Android. Thanks
\MainApplication.java:29: error: cannot find symbol
new RNBottomActionSheetPackage(),
^
symbol: class RNBottomActionSheetPackage
2 errors
FAILED
Cannot load module file 'node_modules/react-native-bottom-action-sheet/android/react-native-bottom-action-sheet.iml':
File node_modules\react-native-bottom-action-sheet\android\react-native-bottom-action-sheet.iml does not exist
Would you like to remove module 'react-native-bottom-action-sheet' from the project?
settings.gradle
include ':react-native-bottom-action-sheet'
project(':react-native-bottom-action-sheet').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-bottom-action-sheet/android')
build.gradle
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven { url 'https://jitpack.io' }
}
}
app/build.gradle
dependencies {
compile project(':react-native-vector-icons')
compile project(':react-native-config')
compile project(':react-native-bottom-action-sheet')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}
MainApplication
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNBottomActionSheetPackage(),
new ReactNativeConfigPackage(),
new VectorIconsPackage()
);
}
Versions
"react": "16.3.1",
"react-native": "~0.55.2",
"react-native-bottom-action-sheet": "^0.0.18",
"react-native-vector-icons": "^5.0.0",
@rochapablo you miss import ui.bottomactionsheet.RNBottomActionSheetPackage;
in MainApplication.java
Problem solve for me, just missing a few line in MainApplication.java
Thanks @arma7x for sharing the fix. Closing the issue.
Thanks </ Pranav >
Hey,
I just installed the package using the following npm command
npm install react-native-bottom-action-sheet --save --ignore-scripts
Because it was stuck onexecuting pod install command
. Since i'll only use this plugin for Android, i guess the pods are not needed. But i did link the package and edit the build.gradleSo on Android, I get this error:
undefined is not an object (evaluating 'RNBottomActionSheet.SheetView')
its coming fromSheetView.js:76:24
according to my error messageThis is my code:
Hopefully you can help me