Skip to content
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

Create android fails : "Could not find a template branch for Briefcase v0.3.12." #1114

Closed
infelicitatis opened this issue Feb 27, 2023 · 4 comments
Labels
bug A crash or error in behavior.

Comments

@infelicitatis
Copy link

infelicitatis commented Feb 27, 2023

Describe the bug

When building for Windows i had the Bug too, but it was resolved by running:
pip install --upgrade pip
pip install toga --upgrade
pip install briefcase --upgrade
pip install GitPython --upgrade

after that, creating building and packaging for windows worked (briefcase build)

however with briefcase create android I still get the following warning:

 "*************************************************************************
** WARNING: Unable to update template                                  **
*************************************************************************

   Briefcase is unable the update the application template. This
   may be because your computer is currently offline. Briefcase will
   use existing template without updating.

*************************************************************************

Could not find a template branch for Briefcase v0.3.12.

Log saved to"

I am not offline, when i open the git link in my browser, it works just fine.
I didnt really change anything since last time i worked on the project (~3 Months), it ran fine at that time

I think i have done everything right, i followed the docs, so I raise this as an Issue

BUT

I am by no means an Expert, maybe i have missed something, maybe i have done something wrong. I could not find the Error/How to resolve it elsewhere, so if someone could point out what i am doing wrong, it would be nice and maybe would help other newbies who try to google the Error later on.

Anyway thanks for the great work to the Beeware Team! The Toolkit is (other than this) really a bless.

Steps to reproduce

  1. Go to in your Project Folder
  2. run briefcase create android
  3. See error

Expected behavior

briefcase starts building the app for android deployment.

Screenshots

No response

Environment

  • Operating System: win 10
  • Python version: 3.10.5
  • Software versions:
    • Briefcase: 0.3.12
    • Toga: 0.3.0

Logs

Log
Date/Time:       2023-02-27 20:32:05 
Command line:    C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\Scripts\briefcase create android

OS Release:      Windows 10
OS Version:      10.0.19045
Architecture:    AMD64
Platform:        Windows-10-10.0.19045-SP0

Python exe:      C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\Scripts\python.exe
Python version:  3.10.5 (tags/v3.10.5:f377153, Jun  6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)]
Virtual env:     True
Conda env:       False

Briefcase:       0.3.12
Target platform: android
Target format:   gradle

Environment Variables:
    ALLUSERSPROFILE=C:\ProgramData
    AMDRMPATH=C:\Program Files\AMD\RyzenMaster\
    APPDATA=C:\Users\XXX\AppData\Roaming
    CHROME_CRASHPAD_PIPE_NAME=\\.\pipe\LOCAL\crashpad_22128_YKTBTUEBSOLHHZXV
    COLORTERM=truecolor
    COMMONPROGRAMFILES=C:\Program Files\Common Files
    COMMONPROGRAMFILES(X86)=C:\Program Files (x86)\Common Files
    COMMONPROGRAMW6432=C:\Program Files\Common Files
    COMPUTERNAME=XXX
    COMSPEC=C:\Windows\system32\cmd.exe
    DRIVERDATA=C:\Windows\System32\Drivers\DriverData
    GIT_ASKPASS=********************
    HOMEDRIVE=C:
    HOMEPATH=\Users\XXX
    LANG=en_US.UTF-8
    LOCALAPPDATA=C:\Users\XXX\AppData\Local
    LOGONSERVER=\\XXX
    NUMBER_OF_PROCESSORS=16
    ONEDRIVE=C:\Users\XXX\OneDrive
    ONEDRIVECONSUMER=C:\Users\XXX\OneDrive
    ORIGINAL_XDG_CURRENT_DESKTOP=undefined
    OS=Windows_NT
    PATH=C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\Scripts;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\qt-everywhere-src-6.3.2\Ruby31-x64\bin;C:\Users\XXX\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\XXX\AppData\Local\Programs\Python\Python310\;C:\Users\XXX\AppData\Local\Microsoft\WindowsApps;C:\ffmpeg\bin;G:\cmake\bin;G:\Microsoft VS Code\bin
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.RB;.RBW;.CPL
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=AMD64 Family 25 Model 33 Stepping 0, AuthenticAMD
    PROCESSOR_LEVEL=25
    PROCESSOR_REVISION=2100
    PROGRAMDATA=C:\ProgramData
    PROGRAMFILES=C:\Program Files
    PROGRAMFILES(X86)=C:\Program Files (x86)
    PROGRAMW6432=C:\Program Files
    PSMODULEPATH=C:\Users\XXX\Documents\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
    PUBLIC=C:\Users\Public
    SESSIONNAME=Console
    SYSTEMDRIVE=C:
    SYSTEMROOT=C:\Windows
    TEMP=C:\Users\XXX\AppData\Local\Temp
    TERM_PROGRAM=vscode
    TERM_PROGRAM_VERSION=1.75.1
    TMP=C:\Users\XXX\AppData\Local\Temp
    USERDOMAIN=XXX
    USERDOMAIN_ROAMINGPROFILE=XXX
    USERNAME=XXX
    USERPROFILE=C:\Users\XXX
    VIRTUAL_ENV=C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv
    VIRTUAL_ENV_PROMPT=beeware-venv
    VSCODE_GIT_ASKPASS_EXTRA_ARGS=********************
    VSCODE_GIT_ASKPASS_MAIN=********************
    VSCODE_GIT_ASKPASS_NODE=********************
    VSCODE_GIT_IPC_HANDLE=\\.\pipe\vscode-git-4591db8206-sock
    VSCODE_INJECTION=1
    WINDIR=C:\Windows
    _OLD_VIRTUAL_PATH=C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\PuTTY\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\qt-everywhere-src-6.3.2\Ruby31-x64\bin;C:\Users\XXX\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\XXX\AppData\Local\Programs\Python\Python310\;C:\Users\XXX\AppData\Local\Microsoft\WindowsApps;C:\ffmpeg\bin;G:\cmake\bin;G:\Microsoft VS Code\bin

Briefcase Log:
[20:32:04]                                                                                                                                                             create.py:789
           [xxx] Generating application template...                                                                                                               create.py:789
           Using app template: https://github.com/beeware/briefcase-android-gradle-template.git, branch v0.3.12                                                        create.py:285
                                                                                                                                                                         base.py:711
           *************************************************************************                                                                                     base.py:711
           ** WARNING: Unable to update template                                  **                                                                                     base.py:711
           *************************************************************************                                                                                     base.py:711
                                                                                                                                                                         base.py:711
              Briefcase is unable the update the application template. This                                                                                              base.py:711
              may be because your computer is currently offline. Briefcase will                                                                                          base.py:711
              use existing template without updating.                                                                                                                    base.py:711
                                                                                                                                                                         base.py:711
           *************************************************************************                                                                                     base.py:711
                                                                                                                                                                      __main__.py:30
           Could not find a template branch for Briefcase v0.3.12.                                                                                                    __main__.py:31

Main thread traceback:
╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\git\util.py:1095 in __getitem__                                                                │
│                                                                                                                                                                                  │
│   1092 │   │   │   raise ValueError("Index should be an int or str")                            ╭──────────────────────────────── locals ─────────────────────────────────╮      │
│   1093 │   │   else:                                                                            │ index = 'v0.3.12'                                                       │      │
│   1094 │   │   │   try:                                                                         │  self = [                                                               │      │
│ ❱ 1095 │   │   │   │   return getattr(self, index)                                              │         │   <git.RemoteReference "refs/remotes/origin/3.10">,           │      │
│   1096 │   │   │   except AttributeError as e:                                                  │         │   <git.RemoteReference "refs/remotes/origin/3.6">,            │      │
│   1097 │   │   │   │   raise IndexError("No item found with id %r" % (self._prefix + index)) fr │         │   <git.RemoteReference "refs/remotes/origin/3.7">,            │      │
│   1098 │   │   # END handle getattr                                                             │         │   <git.RemoteReference "refs/remotes/origin/3.8">,            │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/3.9">,            │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/HEAD">,           │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/localhost-http">, │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/main">,           │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/v0.3.10">,        │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/v0.3.11">         │      │
│                                                                                                 │         ]                                                               │      │
│                                                                                                 ╰─────────────────────────────────────────────────────────────────────────╯      │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\git\util.py:1083 in __getattr__                                                                │
│                                                                                                                                                                                  │
│   1080 │   │   │   if getattr(item, self._id_attr) == attr:                                     ╭──────────────────────────────── locals ────────────────────────────────╮       │
│   1081 │   │   │   │   return item                                                              │ attr = 'origin/v0.3.12'                                                │       │
│   1082 │   │   # END for each item                                                              │ item = <git.RemoteReference "refs/remotes/origin/v0.3.11">             │       │
│ ❱ 1083 │   │   return list.__getattribute__(self, attr)                                         │ self = [                                                               │       │
│   1084 │                                                                                        │        │   <git.RemoteReference "refs/remotes/origin/3.10">,           │       │
│   1085 │   def __getitem__(self, index: Union[SupportsIndex, int, slice, str]) -> T_IterableObj │        │   <git.RemoteReference "refs/remotes/origin/3.6">,            │       │
│   1086                                                                                          │        │   <git.RemoteReference "refs/remotes/origin/3.7">,            │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/3.8">,            │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/3.9">,            │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/HEAD">,           │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/localhost-http">, │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/main">,           │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/v0.3.10">,        │       │
│                                                                                                 │        │   <git.RemoteReference "refs/remotes/origin/v0.3.11">         │       │
│                                                                                                 │        ]                                                               │       │
│                                                                                                 ╰────────────────────────────────────────────────────────────────────────╯       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'IterableList' object has no attribute 'origin/v0.3.12'

The above exception was the direct cause of the following exception:

╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\base.py:726 in update_cookiecutter_cache                                    │
│                                                                                                                                                                                  │
│   723 │   │   │   │   │   )                                                                                                                                                      │
│   724 │   │   │   │   try:                                                                                                                                                       │
│   725 │   │   │   │   │   # Check out the branch for the required version tag.                                                                                                   │
│ ❱ 726 │   │   │   │   │   head = remote.refs[branch]                                                                                                                             │
│   727 │   │   │   │   │                                                                                                                                                          │
│   728 │   │   │   │   │   self.logger.info(                                                                                                                                      │
│   729 │   │   │   │   │   │   f"Using existing template (sha {head.commit.hexsha}, "                                                                                             │
│                                                                                                                                                                                  │
│ ╭────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────╮                                                           │
│ │          branch = 'v0.3.12'                                                                                        │                                                           │
│ │ cached_template = WindowsPath('C:/Users/XXX/.cookiecutters/briefcase-android-gradle-template')                   │                                                           │
│ │          remote = <git.Remote "origin">                                                                            │                                                           │
│ │            repo = <git.repo.base.Repo 'C:\\Users\\XXX\\.cookiecutters\\briefcase-android-gradle-template\\.git'> │                                                           │
│ │            self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30>            │                                                           │
│ │        template = 'https://github.com/beeware/briefcase-android-gradle-template.git'                               │                                                           │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                           │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\git\util.py:1097 in __getitem__                                                                │
│                                                                                                                                                                                  │
│   1094 │   │   │   try:                                                                         ╭──────────────────────────────── locals ─────────────────────────────────╮      │
│   1095 │   │   │   │   return getattr(self, index)                                              │ index = 'v0.3.12'                                                       │      │
│   1096 │   │   │   except AttributeError as e:                                                  │  self = [                                                               │      │
│ ❱ 1097 │   │   │   │   raise IndexError("No item found with id %r" % (self._prefix + index)) fr │         │   <git.RemoteReference "refs/remotes/origin/3.10">,           │      │
│   1098 │   │   # END handle getattr                                                             │         │   <git.RemoteReference "refs/remotes/origin/3.6">,            │      │
│   1099 │                                                                                        │         │   <git.RemoteReference "refs/remotes/origin/3.7">,            │      │
│   1100 │   def __delitem__(self, index: Union[SupportsIndex, int, slice, str]) -> None:         │         │   <git.RemoteReference "refs/remotes/origin/3.8">,            │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/3.9">,            │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/HEAD">,           │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/localhost-http">, │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/main">,           │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/v0.3.10">,        │      │
│                                                                                                 │         │   <git.RemoteReference "refs/remotes/origin/v0.3.11">         │      │
│                                                                                                 │         ]                                                               │      │
│                                                                                                 ╰─────────────────────────────────────────────────────────────────────────╯      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: No item found with id 'origin/v0.3.12'

The above exception was the direct cause of the following exception:

╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\__main__.py:20 in main                                                               │
│                                                                                                                                                                                  │
│   17 │   │   command = Command(logger=logger, console=console)                                                                                                                   │
│   18 │   │   options = command.parse_options(extra=extra_cmdline)                                                                                                                │
│   19 │   │   command.parse_config(Path.cwd() / "pyproject.toml")                                                                                                                 │
│ ❱ 20 │   │   command(**options)                                                                                                                                                  │
│   21 │   except HelpText as e:                                                                                                                                                   │
│   22 │   │   logger.info()                                                                                                                                                       │
│   23 │   │   logger.info(str(e))                                                                                                                                                 │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                        │
│ │       command = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30> │                                                                        │
│ │       Command = <class 'briefcase.platforms.android.gradle.GradleCreateCommand'>                      │                                                                        │
│ │       console = <briefcase.console.Console object at 0x000001F026FB4250>                              │                                                                        │
│ │             e = TemplateUnsupportedVersion('v0.3.12')                                                 │                                                                        │
│ │ extra_cmdline = []                                                                                    │                                                                        │
│ │        logger = <briefcase.console.Log object at 0x000001F026FF21D0>                                  │                                                                        │
│ │       options = {}                                                                                    │                                                                        │
│ │        result = 200                                                                                   │                                                                        │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                        │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\create.py:839 in __call__                                                   │
│                                                                                                                                                                                  │
│   836 │   │   else:                                                                                                                                                              │
│   837 │   │   │   state = None                                                                                                                                                   │
│   838 │   │   │   for app_name, app in sorted(self.apps.items()):                                                                                                                │
│ ❱ 839 │   │   │   │   state = self.create_app(app, **full_options(state, options))                                                                                               │
│   840 │   │                                                                                                                                                                      │
│   841 │   │   return state                                                                                                                                                       │
│   842                                                                                                                                                                            │
│                                                                                                                                                                                  │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                                                                             │
│ │      app = <com.xxx.xxxv0.0.1 AppConfig>                                              │                                                                             │
│ │ app_name = 'xxx'                                                                            │                                                                             │
│ │  options = {}                                                                                    │                                                                             │
│ │     self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30> │                                                                             │
│ │    state = None                                                                                  │                                                                             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                             │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\create.py:790 in create_app                                                 │
│                                                                                                                                                                                  │
│   787 │   │   │   self.tools.shutil.rmtree(bundle_path)                                                                                                                          │
│   788 │   │                                                                                                                                                                      │
│   789 │   │   self.logger.info("Generating application template...", prefix=app.app_name)                                                                                        │
│ ❱ 790 │   │   self.generate_app_template(app=app)                                                                                                                                │
│   791 │   │                                                                                                                                                                      │
│   792 │   │   self.logger.info("Installing support package...", prefix=app.app_name)                                                                                             │
│   793 │   │   self.install_app_support_package(app=app)                                                                                                                          │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────────── locals ───────────────────────────────────────────────────╮                                                                 │
│ │         app = <com.xxx.xxxv0.0.1 AppConfig>                                                       │                                                                 │
│ │ bundle_path = WindowsPath('C:/Users/XXX/Documents/code/gui/xxx/xxx/android/gradle/xxx') │                                                                 │
│ │     options = {}                                                                                             │                                                                 │
│ │        self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30>          │                                                                 │
│ │   test_mode = False                                                                                          │                                                                 │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                 │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\create.py:288 in generate_app_template                                      │
│                                                                                                                                                                                  │
│   285 │   │   │   self.logger.info(                                                                                                                                              │
│   286 │   │   │   │   f"Using app template: {template}, branch {template_branch}"                                                                                                │
│   287 │   │   │   )                                                                                                                                                              │
│ ❱ 288 │   │   │   self.generate_template(                                                                                                                                        │
│   289 │   │   │   │   template=template,                                                                                                                                         │
│   290 │   │   │   │   branch=template_branch,                                                                                                                                    │
│   291 │   │   │   │   output_path=output_path,                                                                                                                                   │
│                                                                                                                                                                                  │
│ ╭──────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮                                                                      │
│ │             app = <com.xxx.xxxv0.0.1 AppConfig>                                              │                                                                      │
│ │   extra_context = {                                                                                     │                                                                      │
│ │                   │   'project_name': 'xxx',                                                       │                                                                      │
│ │                   │   'license': 'BSD license',                                                         │                                                                      │
│ │                   │   'app_name': 'xxx',                                                           │                                                                      │
│ │                   │   'version': '0.0.1',                                                               │                                                                      │
│ │                   │   'bundle': 'com.xxx',                                                         │                                                                      │
│ │                   │   'description': 'Control your xxxDevices',                                      │                                                                      │
│ │                   │   'sources': ['src/xxx'],                                                      │                                                                      │
│ │                   │   'formal_name': 'xxx',                                                        │                                                                      │
│ │                   │   'url': 'https://xxx.com/xxx',                                           │                                                                      │
│ │                   │   'author': '',                                                     │                                                                      │
│ │                   │   ... +17                                                                           │                                                                      │
│ │                   }                                                                                     │                                                                      │
│ │     output_path = WindowsPath('C:/Users/XXX/Documents/code/gui/xxx/xxx/android/gradle') │                                                                      │
│ │            self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30> │                                                                      │
│ │        template = 'https://github.com/beeware/briefcase-android-gradle-template.git'                    │                                                                      │
│ │ template_branch = 'v0.3.12'                                                                             │                                                                      │
│ │         version = <Version('0.3.12')>                                                                   │                                                                      │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                      │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\base.py:761 in generate_template                                            │
│                                                                                                                                                                                  │
│   758 │   │   """                                                                                                                                                                │
│   759 │   │   # Make sure we have an updated cookiecutter template,                                                                                                              │
│   760 │   │   # checked out to the right branch                                                                                                                                  │
│ ❱ 761 │   │   cached_template = self.update_cookiecutter_cache(                                                                                                                  │
│   762 │   │   │   template=template, branch=branch                                                                                                                               │
│   763 │   │   )                                                                                                                                                                  │
│   764                                                                                                                                                                            │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                        │
│ │        branch = 'v0.3.12'                                                                             │                                                                        │
│ │ extra_context = {                                                                                     │                                                                        │
│ │                 │   'project_name': 'xxx',                                                       │                                                                        │
│ │                 │   'license': 'BSD license',                                                         │                                                                        │
│ │                 │   'app_name': 'xxx',                                                           │                                                                        │
│ │                 │   'version': '0.0.1',                                                               │                                                                        │
│ │                 │   'bundle': 'com.xxx',                                                         │                                                                        │
│ │                 │   'description': 'Control your xxxDevices',                                      │                                                                        │
│ │                 │   'sources': ['src/xxx'],                                                      │                                                                        │
│ │                 │   'formal_name': 'xxx',                                                        │                                                                        │
│ │                 │   'url': 'https://xxx.com/xxx',                                           │                                                                        │
│ │                 │   'author': 'xxx',                                                     │                                                                        │
│ │                 │   ... +17                                                                           │                                                                        │
│ │                 }                                                                                     │                                                                        │
│ │   output_path = WindowsPath('C:/Users/XXX/Documents/code/gui/xxx/xxx/android/gradle') │                                                                        │
│ │          self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30> │                                                                        │
│ │      template = 'https://github.com/beeware/briefcase-android-gradle-template.git'                    │                                                                        │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                        │
│                                                                                                                                                                                  │
│ C:\Users\XXX\Documents\code\gui\beeware-tutorial\beeware-venv\lib\site-packages\briefcase\commands\base.py:735 in update_cookiecutter_cache                                    │
│                                                                                                                                                                                  │
│   732 │   │   │   │   │   head.checkout()                                                                                                                                        │
│   733 │   │   │   │   except IndexError as e:                                                                                                                                    │
│   734 │   │   │   │   │   # No branch exists for the requested version.                                                                                                          │
│ ❱ 735 │   │   │   │   │   raise TemplateUnsupportedVersion(branch) from e                                                                                                        │
│   736 │   │   │   except self.tools.git.exc.NoSuchPathError:                                                                                                                     │
│   737 │   │   │   │   # Template cache path doesn't exist.                                                                                                                       │
│   738 │   │   │   │   # Just use the template directly, rather than attempting an update.                                                                                        │
│                                                                                                                                                                                  │
│ ╭────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────╮                                                           │
│ │          branch = 'v0.3.12'                                                                                        │                                                           │
│ │ cached_template = WindowsPath('C:/Users/XXX/.cookiecutters/briefcase-android-gradle-template')                   │                                                           │
│ │          remote = <git.Remote "origin">                                                                            │                                                           │
│ │            repo = <git.repo.base.Repo 'C:\\Users\\XXX\\.cookiecutters\\briefcase-android-gradle-template\\.git'> │                                                           │
│ │            self = <briefcase.platforms.android.gradle.GradleCreateCommand object at 0x000001F02743EB30>            │                                                           │
│ │        template = 'https://github.com/beeware/briefcase-android-gradle-template.git'                               │                                                           │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                           │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TemplateUnsupportedVersion: Could not find a template branch for Briefcase v0.3.12.
                                                                                                                                                                      console.py:279
           >>> Extra information:                                                                                                                                     console.py:280
                                                                                                                                                                   subprocess.py:664
           >>> Running Command:                                                                                                                                    subprocess.py:665
           >>>     'C:\Users\XXX\AppData\Local\BeeWare\briefcase\Cache\tools\android_sdk\cmdline-tools\latest\bin\sdkmanager.bat' --list_installed               subprocess.py:666
           >>> Working Directory:                                                                                                                                  subprocess.py:673
           >>>     C:\Users\XXX\Documents\code\gui\xxx\xxxsubprocess.py:674
           >>> Environment Overrides:                                                                                                                              subprocess.py:683
           >>>     ANDROID_SDK_ROOT=C:\Users\XXX\AppData\Local\BeeWare\briefcase\Cache\tools\android_sdk                                                         subprocess.py:685
           >>>     JAVA_HOME=C:\Users\XXX\AppData\Local\BeeWare\briefcase\Cache\tools\java                                                                       subprocess.py:685
[20:32:05] >>> Command Output:                                                                                                                                     subprocess.py:690
           >>>     Loading package information...                                                                                                                  subprocess.py:692
           >>>     Loading local repository...                                                                                                                     subprocess.py:692
           >>>     [=========                              ] 25% Loading local repository...                                                                       subprocess.py:692
           >>>     [=========                              ] 25% Fetch remote repository...                                                                        subprocess.py:692
           >>>     [=======================================] 100% Fetch remote repository...                                                                       subprocess.py:692
           >>>     Installed packages:                                                                                                                             subprocess.py:692
           >>>       Path                                     | Version      | Description                             | Location                                  subprocess.py:692
           >>>       -------                                  | -------      | -------                                 | -------                                   subprocess.py:692
           >>>       build-tools;30.0.2                       | 30.0.2       | Android SDK Build-Tools 30.0.2          | build-tools\30.0.2                        subprocess.py:692
           >>>       cmake;3.10.2.4988404                     | 3.10.2       | CMake 3.10.2.4988404                    | cmake\3.10.2.4988404                      subprocess.py:692
           >>>       emulator                                 | 32.1.11      | Android Emulator                        | emulator                                  subprocess.py:692
           >>>       ndk;21.4.7075529                         | 21.4.7075529 | NDK (Side by side) 21.4.7075529         | ndk\21.4.7075529                          subprocess.py:692
           >>>       patcher;v4                               | 1            | SDK Patch Applier v4                    | patcher\v4                                subprocess.py:692
           >>>       platform-tools                           | 34.0.0       | Android SDK Platform-Tools              | platform-tools                            subprocess.py:692
           >>>       platforms;android-32                     | 1            | Android SDK Platform 32                 | platforms\android-32                      subprocess.py:692
           >>>       system-images;android-29;google_apis;x86 | 12           | Google APIs Intel x86 Atom System Image | system-images\android-29\google_apis\x86  subprocess.py:692
           >>>       system-images;android-31;default;x86_64  | 4            | Intel x86 Atom_64 System Image          | system-images\android-31\default\x86_64   subprocess.py:692
           >>>                                                                                                                                                     subprocess.py:692
           >>> Return code: 0                                                                                                                                      subprocess.py:701

Additional context

No response

@infelicitatis infelicitatis added the bug A crash or error in behavior. label Feb 27, 2023
@rmartin16
Copy link
Member

Briefcase is logging the warning Unable to update template because GitPython cannot fetch the repo for beeware/briefcase-android-gradle-template.

Are you able to manually clone the repo?

git clone https://github.com/beeware/briefcase-android-gradle-template.git

@infelicitatis
Copy link
Author

infelicitatis commented Feb 28, 2023

Hello Martin,
thanks for the reply,
yes cloning the repo manually works just fine
(same venv, same console, same folder etc.)

LOG:

PS C:\Users\XXX\Documents\code\gui\XXX\XXX> briefcase create android

[XXX] Generating application template...
Using app template: https://github.com/beeware/briefcase-android-gradle-template.git, branch v0.3.12

*************************************************************************
** WARNING: Unable to update template                                  **
*************************************************************************

   Briefcase is unable the update the application template. This
   may be because your computer is currently offline. Briefcase will
   use existing template without updating.
*************************************************************************

Could not find a template branch for Briefcase v0.3.12.

Log saved to C:\Users\XXX\Documents\code\gui\XXX\XXX\logs\briefcase.2023_02_28-21_42_14.create.log

(beeware-venv) PS C:\XXX\XXX\Documents\code\gui\XXX\XXX> git clone https://github.com/beeware/briefcase-android-gradle-template.git
Cloning into 'briefcase-android-gradle-template'...
remote: Enumerating objects: 1291, done.
remote: Counting objects: 100% (424/424), done.
remote: Compressing objects: 100% (190/190), done.
Receiving objects:  93% (1201/1291)sed 356 (delta 162), pack-reused 867
Receiving objects: 100% (1291/1291), 3.08 MiB | 6.37 MiB/s, done.
Resolving deltas: 100% (586/586), done.
(beeware-venv) PS C:\Users\XXX\Documents\code\gui\XXX\XXX> briefcase create android

[XXX] Generating application template...
Using app template: https://github.com/beeware/briefcase-android-gradle-template.git, branch v0.3.12

*************************************************************************
** WARNING: Unable to update template                                  **
*************************************************************************

   Briefcase is unable the update the application template. This
   may be because your computer is currently offline. Briefcase will
   use existing template without updating.

*************************************************************************

Could not find a template branch for Briefcase v0.3.12.

Log saved to C:\Users\XXX\Documents\code\gui\XXX\XXX\logs\briefcase.2023_02_28-21_44_25.create.log

@rmartin16
Copy link
Member

hmm....perhaps something is corrupted about the cookiecutter cache. You could attempt to update the cache directory with cd ~/.cookiecutters/briefcase-android-gradle-template; git fetch -v. Alternatively, you could rename the cookiecutter cache with mv ~/.cookiecutters ~/.cookiecutters.bak and re-running the briefcase command. If that fails, something much more fundamental must be wrong.

@infelicitatis
Copy link
Author

infelicitatis commented Mar 1, 2023

FIXED: SOLUTION BELOW

Hey, thanks for the Input!

the commands you provided didn't work, but the Error they left gave a bit more Insight on what (propably) went wrong.

It seems like there was some ownership issue, as the error of the git command was: (i changed out the current user because i am not quite sure if this is security relevant, but the difference is still visible by the length)

(beeware-venv) PS C:\Users\XXX\.cookiecutters\briefcase-android-gradle-template> git fetch -v
fatal: detected dubious ownership in repository at 'C:/Users/XXX/.cookiecutters/briefcase-android-gradle-template'
'C:/Users/XXX/.cookiecutters/briefcase-android-gradle-template' is owned by:
        'S-1-5-32-544'
but the current user is:
        'S-1-5-21-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX-XXXXXXXXXX'
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/XXX/.cookiecutters/briefcase-android-gradle-template

So to me it looks like this is just some dumb mistake on my side like installing beeware in a shell running with admin priviliges and trying to use it in a shell without admin priveliges. But maybe there was some corruption by a win update or something like that.

The fact, that the user 'S-1-5-32-544' is referenced as "DOMAIN_ALIAS_RID_ADMINS" on this site https://learn.microsoft.com/en-us/windows/win32/secauthz/well-known-sids lets me think it is the dumb mistake on my side, but i am not deep enough into the matter to really be sure.

Anyway, here is the

SOLUTION

Delete the folder android-gradle-template under C://Users/XXX/.cookiecutters
(I just did it from the GUI Windows Explorer, but a shell with Admin priviliges should work too)

Done! After that it works like normal again when running the briefcase create android command

Conclusion

most of the time the Problem sits in front of the PC

Thanks a lot for your help dear martin, I hope this didn't bother you to much, I really appreciate your Input, I dont't know if I would have found this by myself.
Maybe it will help other newbies like me in the future, if they run into this thread.

Have a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

2 participants