Skip to content

Building issues (Mac ARM) #514

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

Open
neoighodaro opened this issue Mar 12, 2025 · 1 comment
Open

Building issues (Mac ARM) #514

neoighodaro opened this issue Mar 12, 2025 · 1 comment
Labels
awaiting-input Further information is requested bug Something isn't working

Comments

@neoighodaro
Copy link

neoighodaro commented Mar 12, 2025

What were you trying to do?

Build a new app for arm on a Mac M2 Max.

What happened?

Hi, I am having a few issues building for a Mac arm (have not tried other platforms yet).

Disclaimer: its possible I missed something but I have looked through the documentation many times including Electons documentation.

I have set the environment variables required:

NATIVEPHP_APPLE_ID=xxx
NATIVEPHP_APPLE_ID_PASS=xxx
NATIVEPHP_APPLE_TEAM_ID=xxx

NATIVEPHP_APP_NAME="${APP_NAME}"
NATIVEPHP_APP_VERSION="0.0.1"
NATIVEPHP_APP_ID=
NATIVEPHP_DEEPLINK_SCHEME=
NATIVEPHP_APP_AUTHOR=
NATIVEPHP_UPDATER_ENABLED=false
NATIVEPHP_UPDATER_PROVIDER=github

When i try to build, first I get this output

===================================================================
                    Building for mac
===================================================================

Updater config {
  provider: 'github',
  repo: null,
  owner: null,
  vPrefixedTagName: true,
  private: false,
  channel: 'latest',
  releaseType: 'draft'
}

  • loaded configuration  file=...
 // ....
  • skipped macOS notarization  reason=`notarize` options were unable to be generated
aftersign hook triggered, start to notarize app.
skipping notarizing, NATIVEPHP_APPLE_ID, NATIVEPHP_APPLE_ID_PASS and NATIVEPHP_APPLE_TEAM_ID env variables must be set.
// ...

A few things are strange here,

  1. I have the updater disabled, yet it still tries to pull the values from the default updater (more on this later)
  2. It is skipping the notarization process even though i have all the right environment variables set.

When i try to remove the default updater from github to null, the build process fails entirely (I can probably send a PR for that if needed, but it's not so important for this issue)

 Command successful: php artisan optimize

  Pre-process commands completed.


  Updating Electron dependencies...


   InvalidArgumentException

  NativePHP updater provider [] is not defined.

For the second issue, I get around this by exporting the variables in my terminal session and this was the only way I got it to start the notarizing process (which failed still but that's a different issue also.

How to reproduce the bug

set these NATIVEPHP_APPLE_ID, NATIVEPHP_APPLE_ID_PASS and NATIVEPHP_APPLE_TEAM_ID and run a build.

Package Versions

{
    "installed": [
        {
            "name": "nativephp/electron",
            "direct-dependency": true,
            "homepage": "https://github.com/nativephp/electron",
            "source": "https://github.com/NativePHP/electron/tree/1.0.0-beta.5",
            "version": "1.0.0-beta.5",
            "description": "Electron wrapper for the NativePHP framework.",
            "abandoned": false
        },
        {
            "name": "nativephp/laravel",
            "direct-dependency": false,
            "homepage": "https://github.com/nativephp/laravel",
            "source": "https://github.com/NativePHP/laravel/tree/1.0.0-beta.2",
            "version": "1.0.0-beta.2",
            "description": "Laravel wrapper for the NativePHP framework.",
            "abandoned": false
        },
        {
            "name": "nativephp/php-bin",
            "direct-dependency": false,
            "homepage": "https://nativephp.com",
            "source": "https://github.com/NativePHP/php-bin/tree/0.6.0",
            "version": "0.6.0",
            "description": "PHP binaries used by the NativePHP framework",
            "abandoned": false
        }
    ]
}

PHP Version

8.4.4

Laravel Version

12.1.1

Node Version

22.11.0

Which operating systems have you seen this occur on?

macOS

OS version

15.4 beta

Notes

No response

@neoighodaro neoighodaro added the bug Something isn't working label Mar 12, 2025
@PeteBishwhip
Copy link
Member

This can happen if the config is cached as env then returns null.

Can you try to reproduce after running:

php artisan optimize:clear

Or

php artisan config:clear

Thanks!

@PeteBishwhip PeteBishwhip added the awaiting-input Further information is requested label Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-input Further information is requested bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants