Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 使用ShareExtension分发颤振应用程序时缺少CbundleShortVersionString_Ios_Xcode_Flutter - Fatal编程技术网

Ios 使用ShareExtension分发颤振应用程序时缺少CbundleShortVersionString

Ios 使用ShareExtension分发颤振应用程序时缺少CbundleShortVersionString,ios,xcode,flutter,Ios,Xcode,Flutter,我有一个使用软件包的颤振应用程序,根据插件的要求,我创建了一个共享扩展 我的应用和扩展构建和工作正常,但当我存档和分发我的应用(app Store Connect)时,在上载结束时,我会收到以下错误消息: 错误ITMS-90057:“捆绑包'Payload/Runner.app/PlugIns/ShareExtension.appex'缺少plist键。Info.plist缺少所需的键:CbundleShortVersionString。” 错误ITMS-90056:“此捆绑包'Payload/

我有一个使用软件包的颤振应用程序,根据插件的要求,我创建了一个共享扩展

我的应用和扩展构建和工作正常,但当我存档和分发我的应用(app Store Connect)时,在上载结束时,我会收到以下错误消息:

错误ITMS-90057:“捆绑包'Payload/Runner.app/PlugIns/ShareExtension.appex'缺少plist键。Info.plist缺少所需的键:CbundleShortVersionString。”

错误ITMS-90056:“此捆绑包'Payload/Runner.app/PlugIns/ShareExtension.appex'无效。Info.plist缺少必需的密钥:CbundLeverVersion。”

错误ITMS-90360:“缺少Info.plist值。需要bundle Payload/Runner.app/PlugIns/ShareExtension.appex中的键'CbundLeverVersion'的值。”

错误ITMS-90360:“缺少Info.plist值。需要bundle Payload/Runner.app/PlugIns/ShareExtension.appex中的键'CFBundleShortVersionString'的值。”

但在我的
ios/ShareExtension/Info.plist文件中,我有:

CbundleShortVersionString
$(颤振\u构建\u名称)
循环流化床锅炉
$(颤振/建造/编号)
我还尝试了:

CbundleShortVersionString
$(市场推广版)
循环流化床锅炉
$(当前项目版本)
这将删除
CbundLeverVersion
的错误,但
CbundleShortVersionString
仍然无效

通过在扩展列表中显式设置我的应用版本和内部版本号,上传成功。
但是有没有办法在扩展plist中使用
flatter\u BUILD\u NAME
flatter\u BUILD\u NUMBER
变量

注意:


我正在按照@Aidan David请求使用Xcode 11.6来共享我的C程序,但是:

  • 我认为这不是正确的解决方案,但只是一个解决办法
  • 自担风险使用:-)
  • 还添加了我用来注入所需plist值的zsh脚本
ZSH脚本:

C程序,plist\u replace\u值。C:

#包括
#包括
#定义最大值第256行
无效打印使用(字符*程序名)
{
printf(“\n用法:\n%s\n”,程序名);
}
int main(int argc,char*argv[])
{
文件*plist\u文件,*output\u文件;
int=0;
字符行[最大行];
printf(“Plist键值分析器。支持替换值。\n”);
fflush(stdout);
如果(argc<4)
{
fprintf(stderr,“参数数量不足”);
打印使用(argv[0]);
返回1;
}
plist_file=fopen(argv[1],“r+”);
if(plist_file==NULL)
{
fprintf(stderr,“无法打开%s,正在中止…\n”,argv[1]);
返回1;
}
输出文件=fopen(“temp.plist”,“w”);
if(输出文件==NULL)
{
fprintf(stderr,“无法创建临时文件,正在中止…\n”);
返回1;
}
fgets(直线、最大直线、plist_文件);
而(!feof(plist_文件)&&!已替换)
{
fprintf(输出_文件,“%s”,行);
if(strstr(行,argv[2])!=NULL)
{
fprintf(输出文件“\t%s\n”,argv[3]);
//跳过下一个输出行
fgets(直线、最大直线、plist_文件);
}
fgets(直线、最大直线、plist_文件);
}
fclose(输出文件);
fclose(plist_文件);
移除(argv[1]);
重命名(“临时plist”,argv[1]);
返回0;
}

当应用程序版本没有版本代码时,我也遇到了同样的问题。对于类似于1.0.0ios的版本,应用程序缺少plist键错误。尝试添加版本代码,如1.0.0+0

找到解决方案了吗?还没有,作为一种解决方法,我在plist文件中手动设置了版本字符串,用于我的构建…此处相同。编写了一个简短的C程序,我在构建过程中调用该程序,并用pubspec.yaml中的相应版本号替换这些值。@YanivShaked您介意共享该C程序吗?我也有这个问题。@AidanDavis,我已经发布了C程序源代码以及我目前在构建过程中使用的ZSH脚本,作为这个问题的答案(见下文)
./plist_replace_value ./NotificationService/Info.plist CFBundleVersion `grep ^version: ../pubspec.yaml | awk -F'[\+ ]' '{print $3}'`
./plist_replace_value ./NotificationService/Info.plist CFBundleShortVersionString `grep ^version: ../pubspec.yaml | awk -F'[\+ ]' '{print $2}'`
./plist_replace_value ./Share\ Extension/Info.plist CFBundleVersion `grep ^version: ../pubspec.yaml | awk -F'[\+ ]' '{print $3}'`
./plist_replace_value ./Share\ Extension/Info.plist CFBundleShortVersionString `grep ^version: ../pubspec.yaml | awk -F'[\+ ]' '{print $2}'`
#include <string.h>
#include <stdio.h>

#define MAX_LINE 256

void print_usage(char *programName)
{
    printf("\nUsage:\n%s <plist file> <key> <value>\n", programName);
}

int main(int argc, char *argv[])
{
    FILE *plist_file, *output_file;
    int replaced = 0;
    char line[MAX_LINE];
    printf("Plist key-value parser. Supports replacing values.\n");
    fflush(stdout);
    if (argc < 4)
    {
        fprintf(stderr, "Insufficient number of parameters.");
        print_usage(argv[0]);
        return 1;
    }
    
    plist_file = fopen(argv[1], "r+");
    if (plist_file == NULL)
    {
        fprintf(stderr, "Unable to open %s, aborting...\n", argv[1]);
        return 1;
    }

    output_file = fopen("temp.plist", "w");
    if (output_file == NULL)
    {
        fprintf(stderr, "Unable to create temporary file, aborting...\n");
        return 1;
    }

    fgets(line, MAX_LINE, plist_file);
    while (!feof(plist_file) && !replaced)
    {
        fprintf(output_file, "%s", line);
        if (strstr(line, argv[2]) != NULL)
        {
            fprintf(output_file, "\t<string>%s</string>\n", argv[3]);
            // Skip the next output line
            fgets(line, MAX_LINE, plist_file);
        }
        fgets(line, MAX_LINE, plist_file);
    }

    fclose(output_file);
    fclose(plist_file);
    remove(argv[1]);
    rename("temp.plist", argv[1]);

    return 0;
}