Error with pod install command
josmmv opened this issue ยท 29 comments
When I run the command RCT_NEW_ARCH_ENABLED=1 pod install
in the ios folder, I get this error:
[!] Invalid `Podfile` file:
[!] Invalid `react-native-keep-awake.podspec` file: undefined local variable or method `folly_compiler_flags' for Pod:Module.
# from /.../node_modules/@sayem314/react-native-keep-awake/react-native-keep-awake.podspec:24
# -------------------------------------------
# if ENV["RCT_NEW_ARCH_ENABLED"] == "1"
> s.compiler_flags = folly_compiler_flags + " -DRCT_NEW_ARCH_ENABLED=1"
# s.pod_target_xcconfig = {
@ErHarinderSingh @josmmv I dont have that with RN 0.71.10
What version of RN are you using?
OK, I've found the problem, it will happen on any RN version <= 0.70 with new architecture enabled.
I'll issue a PR to fix that.
the PR is open...
@zabojad, thank you for the prompt resolution.
@josmmv and @ErHarinderSingh, could you please review the new version 1.2.1 and provide us with your feedback?
Hi @sayem314 , @zabojad thanks for your solution. It's working fine as no error shown now. My build is not compiling right now as I am using react-native-share library and it also has same error.
Can we refer this fix to them as well?
@ErHarinderSingh I'll issue a PR on react-native-share as well...
@ErHarinderSingh here you go => react-native-share/react-native-share#1417
@ErHarinderSingh what version of react native are you using ?
@zabojad I am using 0.72.1 latest
@ErHarinderSingh I've just created a new 0.72.1 project, added react-native-keep-awake
, did RCT_NEW_ARCH_ENABLED=1 pod install
and ran it on device. It compiled and ran without any problem...
You might try to clean the build folder in XCode and retry to compile it...
Can you try compiling/running on a real device ๐ค ?
@ErHarinderSingh can you share your application podfile ? Is there anything you've customized there?
@ErHarinderSingh Can you also please share the output of npx react-native info
?
@josmmv Is the issue fixed at your end ?
@ErHarinderSingh I don't get it... I don't reproduce that error at my end and I tried.
I've also checked if the classes NativeKCKeepAwakeSpec
and NativeKCKeepAwakeSpecJSI
are actually generated by codeGen and they actually are:
@ErHarinderSingh thinking about that now, it would be interesting to see what codeGen does at your end.
Can you please show us what it generates in your project when you do this:
cd <path/to/your/app>
node node_modules/react-native/scripts/generate-codegen-artifacts.js \
--path <your app>/ \
--outputPath <an/output/path> \
Hi @zabojad , @sayem314 it also happened on fresh project for me.
Steps :
npx react-native init d
cd d
yarn add @sayem314/react-native-keep-awake
cd ios && bundle install && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install && cd ..
npx react-native run-ios --simulator="iPhone 14 Pro"
Still facing this error; strange.
Hi @ErHarinderSingh !
I've just reproduced the problem by installing the npm version of @sayem314/react-native-keep-awake
instead of my local version...
I thus can investigate on this. I keep you updated as soon as I've found why it's happening...
OK, I've found the cause of the problem: codeGen doesn't generate the JSI classes because of this commit: 5a22a8f
@sayem314 can you please revert it? The module specification should be kept as pure ts (or flow) as in my original PR... This is what allows codeGen to generate the JSI stuff correctly.
@ErHarinderSingh in the meantime, you can use my fork until @sayem314 fixes this...