权限没有,则隐藏 function forum_list_access_filter($forumlist, $gid, $allow = 'allowread') { global $grouplist; if (empty($forumlist)) return array(); if (1 == $gid) return $forumlist; $forumlist_filter = $forumlist; $group = $grouplist[$gid]; foreach ($forumlist_filter as $fid => $forum) { if (empty($forum['accesson']) && empty($group[$allow]) || !empty($forum['accesson']) && empty($forum['accesslist'][$gid][$allow])) { unset($forumlist_filter[$fid]); } unset($forumlist_filter[$fid]['accesslist']); } return $forumlist_filter; } function forum_filter_moduid($moduids) { $moduids = trim($moduids); if (empty($moduids)) return ''; $arr = explode(',', $moduids); $r = array(); foreach ($arr as $_uid) { $_uid = intval($_uid); $_user = user_read($_uid); if (empty($_user)) continue; if ($_user['gid'] > 4) continue; $r[] = $_uid; } return implode(',', $r); } function forum_safe_info($forum) { //unset($forum['moduids']); return $forum; } function forum_filter($forumlist) { foreach ($forumlist as &$val) { unset($val['brief'], $val['announcement'], $val['seo_title'], $val['seo_keywords'], $val['create_date_fmt'], $val['icon_url'], $val['modlist']); } return $forumlist; } function forum_format_url($forum) { global $conf; if (0 == $forum['category']) { // 列表URL $url = url('list-' . $forum['fid'], '', FALSE); } elseif (1 == $forum['category']) { // 频道 $url = url('category-' . $forum['fid'], '', FALSE); } elseif (2 == $forum['category']) { // 单页 $url = url('read-' . trim($forum['brief']), '', FALSE); } if ($conf['url_rewrite_on'] > 1 && $forum['well_alias']) { if (0 == $forum['category'] || 1 == $forum['category']) { $url = url($forum['well_alias'], '', FALSE); } elseif (2 == $forum['category']) { // 单页 $url = ($forum['threads'] && $forum['brief']) ? url($forum['well_alias'] . '-' . trim($forum['brief']), '', FALSE) : url($forum['well_alias'], '', FALSE); } } return $url; } function well_forum_alias() { $forumlist = forum_list_cache(); if (empty($forumlist)) return ''; $key = 'forum-alias'; static $cache = array(); if (isset($cache[$key])) return $cache[$key]; $cache[$key] = array(); foreach ($forumlist as $val) { if ($val['well_alias']) $cache[$key][$val['fid']] = $val['well_alias']; } return array_flip($cache[$key]); } function well_forum_alias_cache() { global $conf; $key = 'forum-alias-cache'; static $cache = array(); // 用静态变量只能在当前 request 生命周期缓存,跨进程需要再加一层缓存:redis/memcached/xcache/apc if (isset($cache[$key])) return $cache[$key]; if ('mysql' == $conf['cache']['type']) { $arr = well_forum_alias(); } else { $arr = cache_get($key); if (NULL === $arr) { $arr = well_forum_alias(); !empty($arr) AND cache_set($key, $arr); } } $cache[$key] = empty($arr) ? '' : $arr; return $cache[$key]; } ?>javascript - error: exportArchive: The data couldn’t be read because it isn’t in the correct format - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - error: exportArchive: The data couldn’t be read because it isn’t in the correct format - Stack Overflow

programmeradmin9浏览0评论

I have this script that I did not write, that is supposed to build .ipas of different build flavours:

import path from "path";
import { execSync } from "child_process";
import { name, iosDirectory } from "../../app.json";
import { version } from "../../package.json";
import { resolveFromRoot, distDir, createLogger } from "../build";

const getProcessOptions = () => {
  return {
    env: Object.assign({}, process.env, {
      // used to skip packager, since we default to release bundler is built in
      RCT_NO_LAUNCH_PACKAGER: true,
      CI_IOS_VERSION_NAME: version
      // CI_IOS_BUILD_NUMBER: build,
    })
  };
};

const buildProcess = ({ xcodebuildArgs }) => {
  return `xcodebuild ${xcodebuildArgs.join(" ")}`;
};

const archiveProject = ({
  xcodeProject,
  scheme,
  configuration = "Release",
  buildPath,
  archivePath
}) => {
  const xcodebuildArgs = [
    xcodeProject.isWorkspace ? "-workspace" : "-project",
    xcodeProject.name,
    "-configuration",
    configuration,
    "-scheme",
    scheme,
    "-derivedDataPath",
    buildPath,
    "-archivePath",
    archivePath,
    "archive",
    "-UseModernBuildSystem=NO"
  ];

  return buildProcess({
    xcodebuildArgs
  });
};

const exportProject = ({ archivePath, exportOptionsPlist }) => {
  const xcodebuildArgs = [
    "-archivePath",
    archivePath,
    "-exportPath",
    distDir,
    "-exportOptionsPlist",
    exportOptionsPlist,
    "-exportArchive"
  ];

  return buildProcess({
    xcodebuildArgs
  });
};

const run = () => {
  const logger = createLogger("ios builds");

  const projectPath = resolveFromRoot(
    path.join(iosDirectory, `${name}.xcworkspace`)
  );

  const release = process.env.GitVersion_MajorMinorPatch || "1.0.0";
  const buildNumber = process.env.Build || 1;
  const fullAppVersion = `${release}-${buildNumber}`;

  const setVersion = `agvtool new-marketing-version ${release}`;
  const setBuild = `agvtool new-version -all ${buildNumber}`;

  const setBuildAndVersion = `cd ios && ${setVersion} && ${setBuild} && cd ..`;

  execSync(setBuildAndVersion, {}, error => {
    logger.logHeader("Error setting version and build numbers iOS", {
      repeatChar: "#"
    });
    logger.log(error);
  });

  const flavours = [
    {
      endpoint: "dv",
      flavour: "DEV",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "in",
      flavour: "INTG",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "qa",
      flavour: "QA",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "ua",
      flavour: "UA",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "prod",
      flavour: "PROD",
      appcenterKey: "<hash>"
    }
  ];

  const devFlav = flavours.find(f => f.flavour.toLocaleLowerCase() === "dev");

  const buildFlavour = process.env.GitVersion_BranchName.startsWith("release/")
    ? flavours
    : [devFlav];

  buildFlavour.forEach(f => {
    const scheme = f.flavour;

    const devPList = path.resolve(__dirname, "dev.plist");
    const appStorePList = path.resolve(__dirname, "app-store.plist");
    // if PROD scheme, then use app-store.plist.  Else, dev.list
    const exportOptionsPlist = scheme === "PROD" ? appStorePList : devPList;

    logger.logHeader(`${scheme} Build IOS Start`, { repeatChar: "#" });
    const buildPath = path.resolve(iosDirectory, "build");
    const archivePath =
      path.resolve(buildPath, "Archive", scheme) + ".xcarchive";

    //prettier-ignore
    const engaInfo = `ENGAGE_VERSION=${fullAppVersion}`;
    const engaEndpoint = `ENGAGE_ENDPOINT=${f.endpoint}`;
    const engaCenter = `APPCENTER_KEY=${f.appcenterKey}`;
    const engaPlatform = "APPCENTER_PLATFORM=ios";
    //prettier-ignore
    const prepare = `${engaEndpoint} ${engaCenter} ${engaInfo} ${engaPlatform} npm run setup`;
    const archiveCmd = archiveProject({
      xcodeProject: {
        name: path.relative(".", projectPath),
        isWorkspace: path.extname(projectPath) === ".xcworkspace"
      },
      scheme,
      buildPath,
      archivePath
    });
    const exportCmd = exportProject({
      archivePath,
      exportOptionsPlist
    });

    logger.logHeader(`${prepare} && ${archiveCmd} && ${exportCmd}`, {
      repeatChar: "#"
    });

    execSync(
      `${prepare} && ${archiveCmd} && ${exportCmd}`,
      getProcessOptions,
      error => {
        logger.logHeader(`Error --- ${scheme} IOS `, { repeatChar: "#" });
        logger.log(error);
      }
    );
  });
};

run();

I do not know if there is a problem with the script, but it fails with the error below:

nps is executing `ios.build` : node node_modules/rimraf/bin.js dist/*.ipa && babel-node scripts/ios/build.js
############################# DEV Build IOS Start #############################
ENGAGE_ENDPOINT=dv APPCENTER_KEY=<hash> ENGAGE_VERSION=1.0.0-1 APPCENTER_PLATFORM=ios npm run setup && xcodebuild -workspace ios/NFIBEngage.xcworkspace -configuration Release -scheme DEV -derivedDataPath path/to/ios/build -archivePath path/to/ios/build/Archive/DEV.xcarchive archive -UseModernBuildSystem=NO && xcodebuild -archivePath path/to/ios/build/Archive/DEV.xcarchive -exportPath path/to/dist -exportOptionsPlist path/to/scripts/ios/dev.plist -exportArchive
 2019-10-07 10:23:07.730 xcodebuild[15084:16992455] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/nd/6b67gs7n3wg6714rx36q0r140000gn/T/ENGAL-DEV_2019-10-07_10-23-07.728.xcdistributionlogs'.
error: exportArchive: The data couldn’t be read because it isn’t in the correct format.

What does it mean by the data is not in the correct format? Where should I be looking to debug this in?

When I look at the logs I get this obscure error:

Error Domain=NSCocoaErrorDomain Code=3840 "No value."

I saw one answer that said I needed a pileBitcode added but I have that in my dev.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" ".0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>enterprise</string>
    <key>teamID</key>
    <string>1234ABCD</string>
    <key>uploadBitcode</key>
    <true/>
    <key>pileBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
    <key>signingStyle</key>
    <string>manual</string>
    <key>signingCertificate</key>
    <string>iOS Distribution</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>.nfib-enterprise.engage-dv</key>
        <string>ENGA - DEV - Dist</string>
        <key>.nfib-enterprise.engage-in</key>
        <string>ENGA - INT - Dist</string>
        <key>.nfib-enterprise.engage-qa</key>
        <string>ENGA - QA - Dist</string>
        <key>.nfib-enterprise.engage-ua</key>
        <string>ENGA - UA - Dist</string>
    </dict>
</dict>
</plist>

I have this script that I did not write, that is supposed to build .ipas of different build flavours:

import path from "path";
import { execSync } from "child_process";
import { name, iosDirectory } from "../../app.json";
import { version } from "../../package.json";
import { resolveFromRoot, distDir, createLogger } from "../build";

const getProcessOptions = () => {
  return {
    env: Object.assign({}, process.env, {
      // used to skip packager, since we default to release bundler is built in
      RCT_NO_LAUNCH_PACKAGER: true,
      CI_IOS_VERSION_NAME: version
      // CI_IOS_BUILD_NUMBER: build,
    })
  };
};

const buildProcess = ({ xcodebuildArgs }) => {
  return `xcodebuild ${xcodebuildArgs.join(" ")}`;
};

const archiveProject = ({
  xcodeProject,
  scheme,
  configuration = "Release",
  buildPath,
  archivePath
}) => {
  const xcodebuildArgs = [
    xcodeProject.isWorkspace ? "-workspace" : "-project",
    xcodeProject.name,
    "-configuration",
    configuration,
    "-scheme",
    scheme,
    "-derivedDataPath",
    buildPath,
    "-archivePath",
    archivePath,
    "archive",
    "-UseModernBuildSystem=NO"
  ];

  return buildProcess({
    xcodebuildArgs
  });
};

const exportProject = ({ archivePath, exportOptionsPlist }) => {
  const xcodebuildArgs = [
    "-archivePath",
    archivePath,
    "-exportPath",
    distDir,
    "-exportOptionsPlist",
    exportOptionsPlist,
    "-exportArchive"
  ];

  return buildProcess({
    xcodebuildArgs
  });
};

const run = () => {
  const logger = createLogger("ios builds");

  const projectPath = resolveFromRoot(
    path.join(iosDirectory, `${name}.xcworkspace`)
  );

  const release = process.env.GitVersion_MajorMinorPatch || "1.0.0";
  const buildNumber = process.env.Build || 1;
  const fullAppVersion = `${release}-${buildNumber}`;

  const setVersion = `agvtool new-marketing-version ${release}`;
  const setBuild = `agvtool new-version -all ${buildNumber}`;

  const setBuildAndVersion = `cd ios && ${setVersion} && ${setBuild} && cd ..`;

  execSync(setBuildAndVersion, {}, error => {
    logger.logHeader("Error setting version and build numbers iOS", {
      repeatChar: "#"
    });
    logger.log(error);
  });

  const flavours = [
    {
      endpoint: "dv",
      flavour: "DEV",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "in",
      flavour: "INTG",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "qa",
      flavour: "QA",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "ua",
      flavour: "UA",
      appcenterKey: "<hash>"
    },
    {
      endpoint: "prod",
      flavour: "PROD",
      appcenterKey: "<hash>"
    }
  ];

  const devFlav = flavours.find(f => f.flavour.toLocaleLowerCase() === "dev");

  const buildFlavour = process.env.GitVersion_BranchName.startsWith("release/")
    ? flavours
    : [devFlav];

  buildFlavour.forEach(f => {
    const scheme = f.flavour;

    const devPList = path.resolve(__dirname, "dev.plist");
    const appStorePList = path.resolve(__dirname, "app-store.plist");
    // if PROD scheme, then use app-store.plist.  Else, dev.list
    const exportOptionsPlist = scheme === "PROD" ? appStorePList : devPList;

    logger.logHeader(`${scheme} Build IOS Start`, { repeatChar: "#" });
    const buildPath = path.resolve(iosDirectory, "build");
    const archivePath =
      path.resolve(buildPath, "Archive", scheme) + ".xcarchive";

    //prettier-ignore
    const engaInfo = `ENGAGE_VERSION=${fullAppVersion}`;
    const engaEndpoint = `ENGAGE_ENDPOINT=${f.endpoint}`;
    const engaCenter = `APPCENTER_KEY=${f.appcenterKey}`;
    const engaPlatform = "APPCENTER_PLATFORM=ios";
    //prettier-ignore
    const prepare = `${engaEndpoint} ${engaCenter} ${engaInfo} ${engaPlatform} npm run setup`;
    const archiveCmd = archiveProject({
      xcodeProject: {
        name: path.relative(".", projectPath),
        isWorkspace: path.extname(projectPath) === ".xcworkspace"
      },
      scheme,
      buildPath,
      archivePath
    });
    const exportCmd = exportProject({
      archivePath,
      exportOptionsPlist
    });

    logger.logHeader(`${prepare} && ${archiveCmd} && ${exportCmd}`, {
      repeatChar: "#"
    });

    execSync(
      `${prepare} && ${archiveCmd} && ${exportCmd}`,
      getProcessOptions,
      error => {
        logger.logHeader(`Error --- ${scheme} IOS `, { repeatChar: "#" });
        logger.log(error);
      }
    );
  });
};

run();

I do not know if there is a problem with the script, but it fails with the error below:

nps is executing `ios.build` : node node_modules/rimraf/bin.js dist/*.ipa && babel-node scripts/ios/build.js
############################# DEV Build IOS Start #############################
ENGAGE_ENDPOINT=dv APPCENTER_KEY=<hash> ENGAGE_VERSION=1.0.0-1 APPCENTER_PLATFORM=ios npm run setup && xcodebuild -workspace ios/NFIBEngage.xcworkspace -configuration Release -scheme DEV -derivedDataPath path/to/ios/build -archivePath path/to/ios/build/Archive/DEV.xcarchive archive -UseModernBuildSystem=NO && xcodebuild -archivePath path/to/ios/build/Archive/DEV.xcarchive -exportPath path/to/dist -exportOptionsPlist path/to/scripts/ios/dev.plist -exportArchive
 2019-10-07 10:23:07.730 xcodebuild[15084:16992455] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/nd/6b67gs7n3wg6714rx36q0r140000gn/T/ENGAL-DEV_2019-10-07_10-23-07.728.xcdistributionlogs'.
error: exportArchive: The data couldn’t be read because it isn’t in the correct format.

What does it mean by the data is not in the correct format? Where should I be looking to debug this in?

When I look at the logs I get this obscure error:

Error Domain=NSCocoaErrorDomain Code=3840 "No value."

I saw one answer that said I needed a pileBitcode added but I have that in my dev.plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple./DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>enterprise</string>
    <key>teamID</key>
    <string>1234ABCD</string>
    <key>uploadBitcode</key>
    <true/>
    <key>pileBitcode</key>
    <true/>
    <key>uploadSymbols</key>
    <true/>
    <key>signingStyle</key>
    <string>manual</string>
    <key>signingCertificate</key>
    <string>iOS Distribution</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>.nfib-enterprise.engage-dv</key>
        <string>ENGA - DEV - Dist</string>
        <key>.nfib-enterprise.engage-in</key>
        <string>ENGA - INT - Dist</string>
        <key>.nfib-enterprise.engage-qa</key>
        <string>ENGA - QA - Dist</string>
        <key>.nfib-enterprise.engage-ua</key>
        <string>ENGA - UA - Dist</string>
    </dict>
</dict>
</plist>
Share Improve this question edited Oct 7, 2019 at 19:45 Daniel asked Oct 7, 2019 at 15:29 DanielDaniel 15.5k19 gold badges112 silver badges181 bronze badges 4
  • Did you get it resolved yet? – der_michael Commented Oct 22, 2019 at 18:42
  • @der_michael, I did get this resolved with lots of help. – Daniel Commented Oct 22, 2019 at 19:08
  • 1 @Daniel can you please add some solution, I am also stuck with the same issue. – Satish Mavani Commented Dec 18, 2019 at 7:48
  • @SatishMavani, I could never 100% pinpoint what the problem was, but it seemed that it had to do with not having the correct cer files and pem files. As I mentioned before I got a lot of help from the people who originated these files. They went in and installed the correct files. – Daniel Commented Dec 18, 2019 at 14:50
Add a ment  | 

1 Answer 1

Reset to default 10

I fixed this issue by running the following mands:

gem list | grep sqlite3
gem install sqlite3 --platform=ruby
rvm use system --default

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论