Rover12421's Blog

The End.

Xcode 4.4.1找不到 ‘com.apple.product-type.library.dynamic’类型解决

        开发越狱插件需要在低版本的iOS上运行,所以又下了个Xcode 4.4.1,这个版本可以支持到iOS3.0,但是编译iOSOpenDev项目的时候包错了:

target specifies product type ‘com.apple.product-type.library.dynamic’, but there’s no such product type for the ‘iphoneos’ platform

com.apple.product-type.library.dynamic

        找了下解决办法,也很简单,修改两个文件既可:
/Applications/Xcode4.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSProductTypes.xcspec
    // Dynamic library
    {   Type = ProductType;
        Identifier = com.apple.product-type.library.dynamic;
        Class = PBXDynamicLibraryProductType;
        Name = "Dynamic Library";
        Description = "Dynamic library";
        IconNamePrefix = "TargetPlugin";
        DefaultTargetName = "Dynamic Library";
        DefaultBuildProperties = {
            FULL_PRODUCT_NAME = "$(EXECUTABLE_NAME)";
            MACH_O_TYPE = "mh_dylib";
            REZ_EXECUTABLE = YES;
            EXECUTABLE_SUFFIX = ".$(EXECUTABLE_EXTENSION)";
            EXECUTABLE_EXTENSION = "dylib";
            PUBLIC_HEADERS_FOLDER_PATH = "/usr/local/include";
            PRIVATE_HEADERS_FOLDER_PATH = "/usr/local/include";
            INSTALL_PATH = "/usr/local/lib";
            DYLIB_INSTALL_NAME_BASE = "$(INSTALL_PATH)";
            LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)";
            DYLIB_COMPATIBILITY_VERSION = "1";
            DYLIB_CURRENT_VERSION = "1";
            FRAMEWORK_FLAG_PREFIX = "-framework";
            LIBRARY_FLAG_PREFIX = "-l";
            LIBRARY_FLAG_NOSPACE = YES;
            STRIP_STYLE = "debugging";
            GCC_INLINES_ARE_PRIVATE_EXTERN = YES;
            CODE_SIGNING_ALLOWED = NO;
        };
        PackageTypes = (
            com.apple.package-type.mach-o-dylib // default
        );
    },

/Applications/Xcode4.4.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Specifications/iPhoneOSPackageTypes.xcspec
    // Mach-O dynamic library
    {   Type = PackageType;
        Identifier = com.apple.package-type.mach-o-dylib;
        Name = "Mach-O Dynamic Library";
        Description = "Mach-O dynamic library";
        DefaultBuildSettings = {
            EXECUTABLE_PREFIX = "";
            EXECUTABLE_SUFFIX = "";
            EXECUTABLE_NAME = "$(EXECUTABLE_PREFIX)$(PRODUCT_NAME)$(EXECUTABLE_VARIANT_SUFFIX)$(EXECUTABLE_SUFFIX)";
            EXECUTABLE_PATH = "$(EXECUTABLE_NAME)";
        };
        ProductReference = {
            FileType = compiled.mach-o.dylib;
            Name = "$(EXECUTABLE_NAME)";
            IsLaunchable = NO;
        };
    },

        加到文件里的最后一行")"之前就可以了.重启Xcode成功编译
-------------------------------------------------------------------------------------
        发现这个不是问题的关键,这只能解决编译iOSOpenDev编译logos工程,如果是编译command-tools就不行了.最好的解决办法是重新安装iOSOpenDev,并且要让iOSOpenDev选择新版本的Xcode,执行下面的命令修改Xcode版本

xcode-select –switch /Applications/Xcode4.4.1.app/Contents/Developer

       然后再安装iOSOpenDev,一切正常了.

Comments