-
Notifications
You must be signed in to change notification settings - Fork 17
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
Multiple commands produce Assets.car in xcode11 #19
Comments
I also have experienced this and am currently trying to find a workaround. |
Workaround: In Xcode you have to go into File > Workspace Settings... and set the build system to the legacy build system. |
Hey, |
Did anyone resolve it? |
I found a solution where you parse // There is an issue in the xcodeproj file where the Assets.car file is not being copied to the correct location. Run this to fix the issue
const fs = require('fs');
const plist = require('plist');
const { parse, build } = require('@bacons/xcode/json');
const projectPath = './ios/.../project.pbxproj';
const main = () => {
const pbxproj = parse(fs.readFileSync(projectPath, 'utf8'));
if (!pbxproj) return;
let pbxprojClone = pbxproj;
const objectsKeys = Object.keys(pbxprojClone.objects);
const objectKeyWithCPR = objectsKeys.find((el) => pbxprojClone.objects[el].name === '[CP] Copy Pods Resources');
const value = pbxprojClone.objects[objectKeyWithCPR];
const stringEndingWithAssetsIndex = value?.outputPaths?.findIndex((el) => el?.endsWith('Assets.car'));
if (stringEndingWithAssetsIndex) {
if (value?.inputPaths && value?.outputPaths) {
const assetsString = value.outputPaths[stringEndingWithAssetsIndex];
value.outputPaths.splice(stringEndingWithAssetsIndex, 1);
value.inputPaths.push(assetsString);
}
}
const pbxprojString = build(pbxprojClone);
fs.writeFileSync(projectPath, pbxprojString, 'utf8');
};
main(); |
After I updated to xcode11, the new build system didn't work. An error occurred with below message
"Multiple commands produce '~/Library/Developer/Xcode/DerivedData/LIKE-hgpysltcapxaaqbkjnoggrxhteud/Build/Products/Debug-iphoneos/xxx.app/Assets.car' "
I think the reason is "s.resources = [ "TrueSDK/**/Assets.xcassets"] " in podspec file, which will lead pod create a copy script like this "${PODS_ROOT}/TrueSDK/TrueSDK/External/Assets.xcassets". And the name of "Assets" is multiple with the main target's image xcassets.
I think you should remove the "s.resources = [ "TrueSDK/**/Assets.xcassets"] ", and put the Assets.xcassets into the "resource_bundles" tag, which will create a bundle to fold the assets.xcassets.
The text was updated successfully, but these errors were encountered: