Skip to content

IOS Build Crash #4

Description

@fto-dev

Bug Description

My target is build simple IOS app using with fetch any example api url, use gea store for fetched data and render store data tsx template.
I developed and build for web. It's working well. But IOS build is crashed. I tried remove features step by step but still have issues on IOS build.

I tried some solution. When you replace fetchResponse.json() to fetchResponse.text() and parse JSON different way and it's building. But still have issues.

Steps to Reproduce

  1. Create a new gea: gea create simple-app
  2. Choose: Blank application
  3. Choose: Web browser
  4. Use my source code below
  5. Change package.json ios target from false to true.
  6. Set icons to package.json file.
  7. Install apple package. npm i @geastack/apple
  8. Build app: npx gea build --target ios

Expected Behavior

CLI should build without error and When I run app on IOS device should be run without error.

Actual Behavior

While building IOS app CLI is crash and have error:

generate-gea-embedded-assets: 1 asset(s) -> dist/ios/.generated/e-demo-web/gea_embedded_assets_generated.cpp
compile: --plugin /node_modules/@geastack/geatsc-plugin-gea/dist/index.js: using built-in "gea" adapter for the legacy package
compile: no certificate; 1 capability refusal(s), 0 diagnostic(s)
  certify   fn|decl|f0|28: host-invocation:gea::host::FetchResponse.json: the target manifest registers no host-invocation "gea::host::FetchResponse.json"
command failed (1): node --max-old-space-size=32768 /node_modules/@geastack/compiler/dist/cli.js compile-module-graph /dist/ios/.generated/e-demo-web/module-graph/gea-module-graph.json --out-dir /dist/ios/.generated/e-demo-web --plugin /node_modules/@geastack/geatsc-plugin-gea/dist/index.js --plugin-option gea.ir=/dist/ios/.generated/e-demo-web/dist/gea-ir.json --plugin-option gea.microtasks-namespace=gea::framework::app::generated --entry /dist/ios/.generated/e-demo-web/gea-embedded-compat-src/src/index.tsx --module-graph-stage hybrid

My Source Code

import { Component } from '@geastack/core'

type Item = {
  userId: number,
  id: number,
  title: string,
  completed: boolean,
};

const fetchTodos = async () => {
  const fetchResponse = await fetch('https://jsonplaceholder.typicode.com/todos');
  const data = (await fetchResponse.json()) as Item[];
}

export class App extends Component {  
  template() {
    fetchTodos();
    return (
      <div>
        Fetch Demo
      </div>
    )
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions