You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I am trying to use the lockToPortrait function and I keep get this error in console:
undefined is not an object (evaluating 'Orientation.lockToPortrait')
I imported your package, set its name to Orientation just as in your usage examples, and inside of componentDidMount I am just calling Orientation.lockToPortrait();
@bpolonia after you click on "Add Files to Project Name" there is a button called "Options" on the screen where you select the file(s). "Create Groups" is there.
@yamill@bpolonia I'm having the same error appear when I run my project on an Android device. I followed all of the instructions for Android setup in the README, plus I did the Xcode just in case. Any ideas?
EDIT: Nevermind, just had to rebuild via react-native run-android. Merely reloading the JS on my device was not enough!
@yamill this seems to be a recurrent issue for me. Any idea why I would have to rebuild periodically? I think it happens especially often when I switch from debugging the iOS simulator to debugging the android emulator and vice versa
@jctadios you cannot use this with Expo. You'll have to eject from your Expo build to be able to write native code, and thus integrate this package. Please refrain from commenting on closed tickets. Create a new one if you'd like further help/clarification.
Activity
yamill commentedon Feb 10, 2016
Did you import the files in xcode?
bpolonia commentedon Feb 10, 2016
Yes I did. I right clicked on my project name, selected Add Files to Project Name I selected RCTOrientation from node_module/react-native-orientation/
The only thing I didn't see was an option to have Create Groups selected.
Here is what it looks like.
tklivan commentedon Feb 11, 2016
@bpolonia after you click on "Add Files to Project Name" there is a button called "Options" on the screen where you select the file(s). "Create Groups" is there.
bpolonia commentedon Feb 12, 2016
@Nurdeen Thank you! That worked. 👍
courthead commentedon May 26, 2016
@yamill @bpolonia I'm having the same error appear when I run my project on an Android device. I followed all of the instructions for Android setup in the README, plus I did the Xcode just in case. Any ideas?
EDIT: Nevermind, just had to rebuild via
react-native run-android
. Merely reloading the JS on my device was not enough!mvayngrib commentedon Sep 26, 2016
@yamill this seems to be a recurrent issue for me. Any idea why I would have to rebuild periodically? I think it happens especially often when I switch from debugging the iOS simulator to debugging the android emulator and vice versa
mvayngrib commentedon Sep 26, 2016
nm, seems it has been fixed in #85. Could you republish the module to npm?
EDIT: installed from Github but still getting this occasionally...
jctadios commentedon Sep 5, 2017
same problem here but I'm using expo. Any idea?
andrerfneves commentedon Sep 11, 2017
@jctadios you cannot use this with Expo. You'll have to
eject
from your Expo build to be able to write native code, and thus integrate this package. Please refrain from commenting on closed tickets. Create a new one if you'd like further help/clarification.