-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
briefcase run
fails after briefcase create
when using stub app templates
#1729
Comments
When reporting a bug, it's really important that you provide full reproduction instructions. You've given 3 commands - but haven't provided any details about the other inputs you've used (such as the name of your app), or the system where you're running (including operating system versions, briefcase versions, etc). The bug template asks for these details for reason - if you don't provide these details, it can be very difficult for us to diagnose the problem. I've updated your report to include some of the details you've omitted. In this case, the problem is that the As a workaround, you can manually run:
This will only be needed on the initial build. Once the metadata has been set once, no additional builds will be required. I believe the specific issue is caused because you did run The same problem exists for both the macOS One fix would be to modify the app template so that the stub binary generated by the template is literally |
briefcase run
fails after briefcase create
when using stub app templates
Thank you |
On my Macbook Air (M1) I see that the stub file generated is called "Stub.0" while it looks for a file called "Stub" (which doesn't exist). On Windows I don't have this problem. |
@rbrecheisen Can you clarify what you're doing to generate that behavior? As I've noted above, saying "I see behavior X" isn't very helpful unless we know all the details of how you're generating that behavior. Is it exactly the instructions presented above? If I follow those instructions, I don't see the problem you're describing - and I'm not sure I see how you'd end up with a file named If it's not exactly the instructions above, then it's very likely a different problem - so you should open a new ticket with the instructions of what you need to do in order to replicate the problem you're seeing. We can always close that ticket as a duplicate if it turns out the problem is the same as another one. |
Yes of course, you're right. I just though perhaps my remark might trigger someone's memory. I have just built the helloworld app in a new virtual environment, went through all the steps, including briefcase package and it seems to work. So I have to go back to my original project and see what's different. The original app is definitely not called "Stub.0" so it has to be something else. To give you an idea how I approach creating the helloworld app, I'm listing the full output below but, as I said, this works fine. Given this helloworld app, I will start to copy in pieces of code from the original project and see at what point I start running into this stub error, if it persists. RalphPlatform:Hardware Overview: Model Name: MacBook Air Project output:~/dev/tools$ mkdir testbriefcase Briefcase configuration error: Configuration file not found. Did you run Briefcase in a project directory that contains 'pyproject.toml'? Let's build a new Briefcase app! -- Formal Name --------------------------------------------------------------- First, we need a formal name for your application. This is the name that will be displayed to humans whenever the name of the Formal Name [Hello World]: -- App Name ------------------------------------------------------------------ Next, we need a name that can serve as a machine-readable Python package name This name must be PEP508-compliant - that means the name may only contain Based on your formal name, we suggest an app name of 'helloworld', but you can App Name [helloworld]: -- Bundle Identifier --------------------------------------------------------- Now we need a bundle identifier for your application. App stores need to protect against having multiple applications with the same For example, if you are writing an application for Example Corp, whose website Bundle Identifier [com.example]: -- Project Name -------------------------------------------------------------- Briefcase can manage projects that contain multiple applications, so we need a If you're only planning to have one application in this project, you can use Project Name [Hello World]: -- Description --------------------------------------------------------------- Now, we need a one line description for your application. Description [My first application]: -- Author -------------------------------------------------------------------- Who do you want to be credited as the author of this application? This could be your own name, or the name of your company you work for. Author [Jane Developer]: -- Author's Email ------------------------------------------------------------ What email address should people use to contact the developers of this This might be your own email address, or a generic contact address you set up Author's Email [jane@example.com]: -- Application URL ----------------------------------------------------------- What is the website URL for this application? If you don't have a website set up yet, you can put in a dummy URL. Application URL [https://example.com/helloworld]: -- Project License ----------------------------------------------------------- What license do you want to use for this project's code?
Project License [1]: -- GUI Framework ------------------------------------------------------------- What GUI toolkit do you want to use for this project? Additional GUI bootstraps are available from the community. Check them out at https://beeware.org/bee/briefcase-bootstraps
GUI Framework [1]: 2 [helloworld] Generating a new application 'Hello World' [helloworld] Generated new application 'Hello World' To run your application, type:
(testbriefcase) ~/dev/tools/testbriefcase$ cd helloworld [helloworld] Installing requirements... [helloworld] Starting in dev mode...2025-02-08 08:00:28.702 Python[21676:3126458] +[IMKClient subclass]: chose IMKClient_Modern [helloworld] Generating application template... [helloworld] Installing support package... [helloworld] Installing stub binary... [helloworld] Installing application code... [helloworld] Installing requirements... [helloworld] Installing application resources... [helloworld] Removing unneeded app content... [helloworld] Created build/helloworld/macos/app [helloworld] Building App... [helloworld] Ad-hoc signing app... [helloworld] Built build/helloworld/macos/app/Hello World.app [helloworld] Starting app...(testbriefcase) ~/dev/tools/testbriefcase/helloworld$ briefcase package [helloworld] Signing app... -- Application Signing Identity ---------------------------------------------- Select application signing identity to use:
Application Signing Identity: 1 In future, you could specify this signing identity by using:
** WARNING: Signing with an ad-hoc identity **
Signing app with ad-hoc identity... [helloworld] Building DMG... [helloworld] Packaged dist/Hello World-0.0.1.dmg |
Just to give a bit more output from my original project, see below. It's probably not enough for you to pinpoint the problem so I will be copying pieces of this code, like I said, into the previously mentioned helloworld app. Ralph~/dev/tools/MosamaticDesktop2.0$ cd mosamaticdesktop [mosamaticdesktop] Updating application code... [mosamaticdesktop] Removing unneeded app content... [mosamaticdesktop] Application updated. [mosamaticdesktop] Building App... [mosamaticdesktop] Ad-hoc signing app... [mosamaticdesktop] Built build/mosamaticdesktop/macos/app/Mosamatic Desktop 2.0.app [mosamaticdesktop] Starting app... Unable to start app mosamaticdesktop. Log saved to /Users/ralph/dev/tools/MosamaticDesktop2.0/mosamaticdesktop/logs/briefcase.2025_02_08-08_15_32.run.log (MosamaticDesktop2.0) ~/dev/tools/MosamaticDesktop2.0/mosamaticdesktop$ briefcase create Application 'mosamaticdesktop' already exists; overwrite [y/N]? y [mosamaticdesktop] Removing old application bundle... [mosamaticdesktop] Generating application template... [mosamaticdesktop] Installing support package... [mosamaticdesktop] Installing stub binary... Log saved to /Users/ralph/dev/tools/MosamaticDesktop2.0/mosamaticdesktop/logs/briefcase.2025_02_08-08_15_55.create.log Traceback (most recent call last): |
Ok, my bad. Turns out that my project's name "Mosamatic Desktop 2.0" was causing the problem because of the trailing ".0" in this name. I renamed the project to "Mosamatic Desktop 2" and it works... :) Ralph |
Ok - That's an interesting result, and definitely a bug. I've opened #2151 to track the issue. The fix is reasonably straightforward, if you'd like to try your hand at fixing the problem. |
Describe the bug
When running an app on macOS or Windows,
briefcase run
will fail if abuild
step hasn't been executed.On Windows, the error manifests as:
On macOS, it is
Steps to reproduce
Expected behavior
App should start without error. The
run
should imply the need for abuild
on the macOS/Windows app templates, but because the template and binary both exist, the need for a build isn't detected.Screenshots
No response
Environment
Logs
Additional context
The briefcase dev is normal, but the briefcase run is abnormal.
If you invoke
briefcase run
on a clean project, the app works.If you invoke
briefcase build
before invokingbriefcase run
, the app works.This only affects the
app
targets; theXcode
/VisualStudio
templates do the right thing, because they require an explicit compilation step to create the binary.The text was updated successfully, but these errors were encountered: