-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS: Failure to build with --configuration Release #49
Comments
Since you're including // app.config.js
{
"expo": {
"..."
"plugins": [
["expo-community-flipper", "0.175.0"]
]
}
} 0.175.0 is verified as working over here so it might just be a config issue as part of the setup. |
I'm testing that solution now, but 8 hours in EAS build queue until I can report back. |
The Asking because the With react-native including a flipper version by default, this might become more of an issue and be worth including in the readme. |
I think the key here is that In that case, I don't think we need to specify the version - but since EAS isn't even accepting new builds and I'm still 4 hours away from mine starting, I can't report back until tomorrow (a wildly optimistic projection.) The error wasn't TypeScript, it was the below: |
💯 likely the cause. This is because Flipper's on 0.x.y, meaning any The only time you really need to specify the version is when you need JS plugin functionality (such as the redux inspector) inside of Flipper. If all you need is layout & debugging, you can just use plugin w/o a version (and no react-native-flipper in package.json) and it should work using the RN defaults. |
I'm having the same issue. We are using JS plugin functionality (react-query-native-devtools) so we need to have react-native-flipper inside package.json. Relevant parts of our setup:
app.config.js
eas.json
|
Just documenting some discoveries:
The good news is, we can test this fix locally. Here's a stripped down JS version of the plugin, specifically for iOS. I'll see about adding this with tests in the meantime. // flipper.js
// install locally @expo/config-plugins, expo
// use this instead of the community plugin for testing
import path from "path";
import fs from "fs";
import { withDangerousMod } from "expo/config-plugins";
import {
mergeContents,
removeContents,
} from "@expo/config-plugins/build/utils/generateCode";
// set flipper here or `false` for default version
const FLIPPER_VERSION = "0.163.0";
/** In iOS, this is the line we anchor to for adding args to use_react_native!() */
export const IOS_URN_ARG_ANCHOR =
/:fabric_enabled => flags\[:fabric_enabled\],/;
/** In a Podfile, this regex tells us the :production arg is already there */
export const IOS_HAS_PRODUCTION_ARG =
/use_react_native!\([\s\S]*:production\s+=>/gm;
/** In a Podfile, this regex tells us the :flipper_configuration arg is already there */
export const IOS_HAS_FLIPPER_ARG =
/use_react_native!\([\s\S]*^\s*:flipper_configuration\s+=>/gm;
// make a flipper arg
const createFlipperArgument = () => {
const active = FLIPPER_VERSION
? `FlipperConfiguration.enabled(["Debug", "Dev.Debug", "Release"], { 'Flipper' => '${FLIPPER_VERSION }' }),`
: `FlipperConfiguration.enabled(["Debug", "Dev.Debug", "Release"]),`;
return `:flipper_configuration => ${active}`;
};
// strips tagged content
const removeTaggedContent = (contents, ns) => {
return removeContents({ src: contents, tag: tag(ns) });
};
// get last mutation result
const last = (arr) => {
const l = arr[arr.length - 1];
if (typeof l === "undefined") {
throw new Error(
"No prior results. This is a bug in expo-community-flipper and should be reported"
);
}
return l;
};
// edit podfile step
export function updatePodfileContentsWithFlipper(
contents
) {
const results = [];
results.push(removeTaggedContent(contents, "urn"));
const preexisting = IOS_HAS_FLIPPER_ARG.test(last(results).contents);
if (!preexisting) {
results.push(
mergeContents({
tag: tag("urn"),
src: last(results).contents,
newSrc: createFlipperArgument(),
anchor: IOS_URN_ARG_ANCHOR,
offset: 1,
comment: "#",
})
);
}
if (!last(results).didMerge) {
throw new Error(
"Cannot add flipper arguments to the project's ios/Podfile. Please report this with a copy of your project Podfile. You can generate this with the `expo prebuild` command."
);
}
return last(results).contents;
}
// update podfile mod
function withFlipperPodfile(config) {
config = withDangerousMod(config, [
"ios",
async (c) => {
const filePath = path.join(c.modRequest.platformProjectRoot, "Podfile");
const contents = fs.readFileSync(filePath, "utf-8");
const updatedContents = updatePodfileContentsWithFlipper(contents, cfg);
fs.writeFileSync(filePath, updatedContents);
return c;
},
]);
return config;
}
// plugin entry point
export default function withFlipperIOS(config) {
config = withFlipperPodfile(config);
return config;
} // app.config.js
module.exports = {
"expo": {
"..."
"plugins": [
"./path/to/flipper.js"
]
} |
I've just pushed v 47.0.1 which is backward compatible with 47.0.0 and should address the most likely culprits:
|
@all-contributors |
With the
This is my Podfile, and removing
|
I'll get a fix out today with only debug & release profiles for metro. I don't think we need to configure the profiles, but I'm surprised there's a whitelist now |
Update: 47.0.2 is out with only the |
I can confirm that 47.0.2 fixes the issue and a |
I am having the same issue, still with version 47.0.2 |
Hello!
I'm trying to use
expo-community-flipper
in combination with Expoprebuild
/run:ios
and seeing the below error when runningexpo run:ios --configuration Release
- simply runningexpo run:ios
(akaDebug
configuration) works fine and the Flipper integration works great 💯.I tried using
FLIPPER_DISABLE=1
but was seeing the same error. I also tried aexpo prebuild -p ios --clean
after installingexpo-community-flipper
.The error
Here's my
app.config.js
file:And finally, here's my
package.json
dependencies:Thank you for all the hard work you do on this plugin 🙏
The text was updated successfully, but these errors were encountered: