The web explore didn't give me specific device IDs. Let me think about this differently. The error says "Invalid device id specified: 'fenix5'". This strongly suggests that the SDK doesn't have the fenix5 device file installed. The SDK Manager downloads device files separately from the SDK itself. The user needs to install device files.

Since the user has a fenix 5 Plus, I should:
1. Tell them to open SDK Manager and install the fēnix 5 Plus device file.
2. Update the build script to build only fenix5plus for now to avoid errors for other uninstalled devices.
3. The manifest already includes fenix5plus, so that's fine.

I should also update the build script to detect which device files are installed and only build those, or at least make it easy to build just the user's device.

Let me update the build script to:
- Check if device files are installed
- Default to building only fenix5plus if that's the user's device
- Provide a way to build all installed devices
- Or better, detect installed devices and build those

The SDK itself is installed, but the **device files are missing**. The error `Invalid device id specified: 'fenix5'` means `monkeyc` has never seen the fēnix 5 device profile because it wasn’t downloaded through the SDK Manager.

Since you have a **fēnix 5 Plus**, here is the corrected plan:

## 1. Install the fēnix 5 Plus device file

Open the SDK Manager on your GUI machine:

```bash
connectiq-sdk-manager
```

In the SDK Manager:

- Find **Devices** / **Device Files**.
- Install the device file for **fēnix 5 Plus** (and any other fēnix 5 variants you want to build for).
- Wait for the download to finish.

This creates files under `~/.Garmin/ConnectIQ/Devices/`.

## 2. Update the build script to build only your device

I will change `build_fenix5.sh` so it defaults to building **only the fēnix 5 Plus** (`fenix5plus`), which is the device you actually own. You can uncomment other variants later if you install them.

mkdir -p bin

# Default build: only fēnix 5 Plus (the device the user owns).
# Uncomment additional variants if you install their device files via the SDK Manager.
BUILD_VARIANTS="fenix5plus"

# Example: build all fēnix 5 variants (requires all device files installed):
# BUILD_VARIANTS="fenix5 fenix5s fenix5x fenix5plus fenix5splus fenix5xplus"

for device in $BUILD_VARIANTS; do
    echo "Building for $device..."
    "$SDK/bin/monkeyc" \
        -d "$device" \
        -f monkey_fenix5.jungle \
        -o "bin/Freedive_${device}.prg" \
        -y "$DEV_KEY" || {
            echo "ERROR: Failed to build for $device. Make sure the $device device file is installed in the SDK Manager."
            exit 1
        }
    echo "Built: bin/Freedive_${device}.prg"
done

echo ""
echo "To sideload, copy the .PRG for your watch to GARMIN/APPS/ over USB."
echo "For fēnix 5 Plus: cp bin/Freedive_fenix5plus.prg /path/to/GARMIN/APPS/"

mkdir -p bin

echo "Building for fēnix 5..."
"$SDK/bin/monkeyc" \
    -d fenix5 \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5.prg \
    -y "$DEV_KEY"

echo "Building for fēnix 5S..."
"$SDK/bin/monkeyc" \
    -d fenix5s \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5s.prg \
    -y "$DEV_KEY"

echo "Building for fēnix 5X..."
"$SDK/bin/monkeyc" \
    -d fenix5x \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5x.prg \
    -y "$DEV_KEY"

echo "Building for fēnix 5 Plus..."
"$SDK/bin/monkeyc" \
    -d fenix5plus \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5plus.prg \
    -y "$DEV_KEY"

echo "Building for fēnix 5S Plus..."
"$SDK/bin/monkeyc" \
    -d fenix5splus \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5splus.prg \
    -y "$DEV_KEY"

echo "Building for fēnix 5X Plus..."
"$SDK/bin/monkeyc" \
    -d fenix5xplus \
    -f monkey_fenix5.jungle \
    -o bin/Freedive_fenix5xplus.prg \
    -y "$DEV_KEY"

echo ""
echo "Built:"
ls -1 bin/Freedive_fenix5*.prg


Successfully replaced 1 block(s) in /home/liph/code/garmin-freedive-app/build_fenix5.sh.

    ...
 36 fi
 37
 38 mkdir -p bin
 39
-40 echo "Building for fēnix 5..."
-41 "$SDK/bin/monkeyc" \
-42     -d fenix5 \
-43     -f monkey_fenix5.jungle \
-44     -o bin/Freedive_fenix5.prg \
-45     -y "$DEV_KEY"
+40 # Default build: only fēnix 5 Plus (the device the user owns).
+41 # Uncomment additional variants if you install their device files via the SDK Manager.
+42 BUILD_VARIANTS="fenix5plus"
 46
-47 echo "Building for fēnix 5S..."
-48 "$SDK/bin/monkeyc" \
-49     -d fenix5s \
-50     -f monkey_fenix5.jungle \
-51     -o bin/Freedive_fenix5s.prg \
-52     -y "$DEV_KEY"
+44 # Example: build all fēnix 5 variants (requires all device files installed):
+45 # BUILD_VARIANTS="fenix5 fenix5s fenix5x fenix5plus fenix5splus fenix5xplus"
 53
-54 echo "Building for fēnix 5X..."
-55 "$SDK/bin/monkeyc" \
-56     -d fenix5x \
-57     -f monkey_fenix5.jungle \
-58     -o bin/Freedive_fenix5x.prg \
-59     -y "$DEV_KEY"
+47 for device in $BUILD_VARIANTS; do
+48     echo "Building for $device..."
+49     "$SDK/bin/monkeyc" \
+50         -d "$device" \
+51         -f monkey_fenix5.jungle \
+52         -o "bin/Freedive_${device}.prg" \
+53         -y "$DEV_KEY" || {
+54             echo "ERROR: Failed to build for $device. Make sure the $device device file is installed in the SDK Manager."
+55             exit 1
+56         }
+57     echo "Built: bin/Freedive_${device}.prg"
+58 done
 60
-61 echo "Building for fēnix 5 Plus..."
-62 "$SDK/bin/monkeyc" \
-63     -d fenix5plus \
-64     -f monkey_fenix5.jungle \
-65     -o bin/Freedive_fenix5plus.prg \
-66     -y "$DEV_KEY"
-67
-68 echo "Building for fēnix 5S Plus..."
-69 "$SDK/bin/monkeyc" \
-70     -d fenix5splus \
-71     -f monkey_fenix5.jungle \
-72     -o bin/Freedive_fenix5splus.prg \
-73     -y "$DEV_KEY"
-74
-75 echo "Building for fēnix 5X Plus..."
-76 "$SDK/bin/monkeyc" \
-77     -d fenix5xplus \
-78     -f monkey_fenix5.jungle \
-79     -o bin/Freedive_fenix5xplus.prg \
-80     -y "$DEV_KEY"
-81
 82 echo ""
-83 echo "Built:"
-84 ls -1 bin/Freedive_fenix5*.prg
+61 echo "To sideload, copy the .PRG for your watch to GARMIN/APPS/ over USB."
+62 echo "For fēnix 5 Plus: cp bin/Freedive_fenix5plus.prg /path/to/GARMIN/APPS/"

--- /home/liph/code/garmin-freedive-app/build_fenix5.sh
+++ /home/liph/code/garmin-freedive-app/build_fenix5.sh
@@ -36,49 +36,27 @@
 fi

 mkdir -p bin

-echo "Building for fēnix 5..."
-"$SDK/bin/monkeyc" \
-    -d fenix5 \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5.prg \
-    -y "$DEV_KEY"
+# Default build: only fēnix 5 Plus (the device the user owns).
+# Uncomment additional variants if you install their device files via the SDK Manager.
+BUILD_VARIANTS="fenix5plus"

-echo "Building for fēnix 5S..."
-"$SDK/bin/monkeyc" \
-    -d fenix5s \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5s.prg \
-    -y "$DEV_KEY"
+# Example: build all fēnix 5 variants (requires all device files installed):
+# BUILD_VARIANTS="fenix5 fenix5s fenix5x fenix5plus fenix5splus fenix5xplus"

-echo "Building for fēnix 5X..."
-"$SDK/bin/monkeyc" \
-    -d fenix5x \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5x.prg \
-    -y "$DEV_KEY"
+for device in $BUILD_VARIANTS; do
+    echo "Building for $device..."
+    "$SDK/bin/monkeyc" \
+        -d "$device" \
+        -f monkey_fenix5.jungle \
+        -o "bin/Freedive_${device}.prg" \
+        -y "$DEV_KEY" || {
+            echo "ERROR: Failed to build for $device. Make sure the $device device file is installed in the SDK Manager."
+            exit 1
+        }
+    echo "Built: bin/Freedive_${device}.prg"
+done

-echo "Building for fēnix 5 Plus..."
-"$SDK/bin/monkeyc" \
-    -d fenix5plus \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5plus.prg \
-    -y "$DEV_KEY"
-
-echo "Building for fēnix 5S Plus..."
-"$SDK/bin/monkeyc" \
-    -d fenix5splus \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5splus.prg \
-    -y "$DEV_KEY"
-
-echo "Building for fēnix 5X Plus..."
-"$SDK/bin/monkeyc" \
-    -d fenix5xplus \
-    -f monkey_fenix5.jungle \
-    -o bin/Freedive_fenix5xplus.prg \
-    -y "$DEV_KEY"
-
 echo ""
-echo "Built:"
-ls -1 bin/Freedive_fenix5*.prg
+echo "To sideload, copy the .PRG for your watch to GARMIN/APPS/ over USB."
+echo "For fēnix 5 Plus: cp bin/Freedive_fenix5plus.prg /path/to/GARMIN/APPS/"


Now I should also think about whether the manifest should be trimmed to only fenix5plus. If the manifest lists devices that don't have device files installed, it might cause issues during build or package creation. However, monkeyc with -d flag builds for a specific device and doesn't necessarily require all manifest devices to be installed. But to be safe and avoid confusion, I can create a separate manifest for fenix5plus only, or just tell the user the manifest already includes fenix5plus and that's fine.

Actually, the manifest lists all fenix 5 variants. When building for fenix5plus specifically with -d fenix5plus, the manifest product list isn't checked against installed devices. The build should work once fenix5plus device file is installed.

But to be cleaner, I should maybe make the build script also check if device files are installed and give a clearer message. Also, I could provide a way to list installed devices.

Let me also check if there's any issue with the manifest. The manifest is fine.

I should tell the user to:
1. Install fenix5plus device file in SDK Manager
2. Re-run build_fenix5.sh
3. If it still fails, check ~/.Garmin/ConnectIQ/Devices/fenix5plus exists

Also, I should mention that if they want to build for all variants, they need all device files installed.

Updated `build_fenix5.sh` to build **only fēnix 5 Plus** by default, since that is the watch you own. It now also prints a clear error if a device file is missing.

## What to do now

1. **Open the SDK Manager on your GUI machine** and install the **fēnix 5 Plus** device file:
   ```bash
   connectiq-sdk-manager
   ```
   Go to the device files section, find **fēnix 5 Plus**, and install it.

2. **Verify it downloaded**:
   ```bash
   ls ~/.Garmin/ConnectIQ/Devices/ | grep fenix5plus
   ```
   You should see a `fenix5plus` directory.

3. **Re-run the build**:
   ```bash
   cd ~/garmin-freedive-app
   ./build_fenix5.sh
   ```

If you later install the other fēnix 5 device files, you can uncomment the `BUILD_VARIANTS` line in `build_fenix5.sh` to build all variants.

Let me know what happens after installing the fēnix 5 Plus device file.


❯ ls ~/.Garmin/ConnectIQ/Devices
-  fenix5plus
❯ ./build_fenix5.sh
Building for fenix5plus...
ERROR: Could not read manifest file '/mnt/flash1/code/garmin-freedive-app/manifest_fenix5.xml': Problem validating the manifest file: cvc-elt.1.a: Cannot find the declaration of element 'iq:manifest'.
ERROR: Failed to build for fenix5plus. Make sure the fenix5plus device file is installed in the SDK Manager.


The user provided the manifest file content earlier, and it looked correct. The error is:
`Cannot find the declaration of element 'iq:manifest'`

This typically means the XML namespace declaration is wrong or the manifest doesn't validate against the schema. Let me re-read the manifest file carefully.

I need to:
1. Read the manifest file
2. Check if namespace is correct
3. Maybe try with or without namespace prefix
4. Maybe the schema location needs to be declared

Let me use ctx_execute_file to check the manifest file content, and then fix it.

console.log(FILE_CONTENT);
console.log('\n--- Analysis ---');
console.log('First line:', FILE_CONTENT.split('\n')[0]);
console.log('Has iq:manifest:', FILE_CONTENT.includes('<iq:manifest'));
console.log('Has xmlns:iq:', FILE_CONTENT.includes('xmlns:iq='));


File access blocked: "/home/liph/code/garmin-freedive-app/manifest_fenix5.xml" resolves outside the project root (/home/liph). context-mode confines ctx_execute_file to the workspace so it cannot be used to bypass the host's sandbox/permission controls (issue #852). To intentionally process a file outside the project, add a host allow rule, e.g. "permissions": { "allow": ["Read(/home/liph/code/garmin-freedive-app/manifest_fenix5.xml)"] } in your settings.


The file is outside project root? Wait, current working directory is /home/liph, and the file is /home/liph/code/... which is inside /home/liph. But the tool says it resolves outside project root. Maybe the project root is more restrictive. Let me just use read tool instead.


<?xml version="1.0"?>
<iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minApiLevel="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:permission id="Sensor"/>
            <iq:permission id="ActivityRecording"/>
            <iq:permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>


The manifest XML namespace looks correct. The error "Cannot find the declaration of element 'iq:manifest'" typically occurs when the manifest schema validation fails because of a missing schema location. The newer SDK may require `xmlns:xsi` and `xsi:schemaLocation` attributes, or perhaps the version attribute needs to be different.

Let me check the original manifest.xml that works with fēnix 3 to compare. The original one had the same structure. Maybe the issue is that with newer SDK, we need to specify schema location.

Actually, I think the issue might be that the manifest validation is stricter and needs:
```xml
<iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.garmin.com/connect-iq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1.xsd">
```

But actually, the SDK should have its own schema. Let me search online for the exact issue.

Actually, a common cause is that the XML declaration line needs to be:
```xml
<?xml version="1.0" encoding="UTF-8"?>
```

Or the namespace might need to be exactly right.

Let me search for this specific error with Garmin manifest.

Question: Garmin Connect IQ manifest cvc-elt.1.a Cannot find the declaration of element 'iq:manifest' schemaLocation


Reviewed 4 sources · synthesized answer with 5 findings

- [web_fetch] Community/practical context: source https://developer.garmin.com/connect-iq/core-topics/manifest-and-permissions/ sdk 9.1.0 fetched 2026-05-30 generated auto-converted from SDK doc/docs/Core_Topics/Manifest_an
- [web_fetch] Community/practical context: I wanted to create my first data field for the Garmin Edge 1040.I'm having trouble compiling the project.Problem validating the manifest file: cvc-elt.1.a: Cannot find the declarat
- [web_fetch] Community/practical context: Question What does the error "CVC-ELT.1: Cannot find the declaration of element" mean in XSD validation? Answer The error message "CVC-ELT.1: Cannot find the declaration of element
- [web_fetch] Community/practical context: Last Updated: Jan 16, 2026 How to Fix cvc-elt.1.a: Cannot Find Declaration of Element 'project' in Maven Projects Maven is the backbone of build automation for Java projects, simpl
- [web_explore] Community/practical context: AI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate

Internal research: web_search ×4, web_fetch ×10, web_fetch_headless ×0

Findings
- [web_fetch] Community/practical context: source https://developer.garmin.com/connect-iq/core-topics/manifest-and-permissions/ sdk 9.1.0 fetched 2026-05-30 generated auto-converted from SDK doc/docs/Core_Topics/Manifest_an
- [web_fetch] Community/practical context: I wanted to create my first data field for the Garmin Edge 1040.I'm having trouble compiling the project.Problem validating the manifest file: cvc-elt.1.a: Cannot find the declarat
- [web_fetch] Community/practical context: Question What does the error "CVC-ELT.1: Cannot find the declaration of element" mean in XSD validation? Answer The error message "CVC-ELT.1: Cannot find the declaration of element
- [web_fetch] Community/practical context: Last Updated: Jan 16, 2026 How to Fix cvc-elt.1.a: Cannot Find Declaration of Element 'project' in Maven Projects Maven is the backbone of build automation for Java projects, simpl
- [web_explore] Community/practical context: AI CODE CREATIONGitHub CopilotWrite better code with AIGitHub Copilot appDirect agents from issue to mergeMCP RegistryNewIntegrate external toolsDEVELOPER WORKFLOWSActionsAutomate

Sources
- [web_fetch] garmin-dev-skills/skills/garmin-dev/references/connect-iq-docs/portal/core-topics/manifest-and-permissions.md at main · athitupakan/garmin-dev-skills: https://github.com/athitupakan/garmin-dev-skills/blob/main/skills/garmin-dev/references/connect-iq-docs/portal/core-topics/manifest-and-permissions.md
- [web_fetch] Beginner's mistake: manifest.xml': Problem validating the manifest file: cvc-elt.1.a: Cannot find the declaration of element 'iq:manifest'.: https://forums.garmin.com/developer/connect-iq/f/discussion/438917/beginner-s-mistake-manifest-xml-problem-validating-the-manifest-file-cvc-elt-1-a-cannot-find-the-declaration-of-element-iq-manifest/2041533
- [web_fetch] How to Resolve XSD Validation Error: CVC-ELT.1 - Cannot Find the Declaration of Element: https://codingtechroom.com/question/-xsd-validation-cvc-elt1-error-resolution
- [web_fetch] How to Fix cvc-elt.1.a: Cannot Find Declaration of Element 'project' in Maven Projects — javathinking.com: https://www.javathinking.com/blog/cvc-elt-1-a-cannot-find-the-declaration-of-element-project/

Internal tools
Internal research: web_search ×4, web_fetch ×10, web_fetch_headless ×0

Caveat
Evidence is partial: the strongest readable sources were mostly community/practical context.


The web explore gave me results but not directly shown in context. Let me try a more targeted search for the exact error and manifest schema.

Question: Connect IQ manifest cvc-elt.1.a Cannot find declaration element iq:manifest schemaLocation xmlns:xsi


1. SDK 9.1.0 manifest validation error: cvc-elt.1.a on Windows - Connect IQ Bug Reports - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/i/bug-reports/sdk-9-1-0-manifest-validation-error-cvc-elt-1-a-on-windows
   SDK 9.1.0 manifest validation error: cvc-elt.1.a on Windows - Connect IQ Bug Reports - Connect IQ - Garmin Forums

Acknowledged

- View Status History
- More
- Cancel

CIQQA-3966

# SDK 9.1.0 manifest validation error: cvc-elt.1.a on Windows

Getting this error when building for Edge 840:`ERROR: Could not read manifest file: Problem validating the manifest file: cvc-elt.1.a: Deklaration des Elements "iq:manifest" kann nicht gefunden werden`

SDK: 9.1.0 on Windows, VS Code with Monkey C extension Fresh SDK install, project path has no spaces (C:\KickrClimb) resources.xsd exists in bin folder

Any fix?

- Mar 28, 2026
- View Status History
- More
- Cancel

Can you provide the manifest.xml? Since it's not able to validate the manifest file, it sounds like something may be incorrectly specified in your project manifest, but it's tough to tell without the file itself.

2. XML Schema Validation : Cannot find the declaration of element
   URL: https://stackoverflow.com/questions/15642046/xml-schema-validation-cannot-find-the-declaration-of-element
   # XML Schema Validation : Cannot find the declaration of element

Tags: xml, xsd, xml-validation, xml-error

- Score: 36
- Views: 180150
- Answers: 4
- Answered: yes
- Asked by: Nerdio (1013 rep)
- Asked: 2013-03-26
- Edited: 2017-04-14
- Site: stackoverflow

## Question

I am still a bit new to XML Schema etc. and have been working to develop some XML, Schema and a Stylesheet (XSLT). I have made reasonable progress, but then realized that my Schema had stopped working, so I have taken it back to a simpler non-descript example.

Here is my XML:

<?xml version="1.0" encoding="UTF-8"?>
<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="Test.Namespace"
 schemaLocation="http://myNameSpace.com Test1.xsd">
 <element1 id="001">
 <element2 id="001.1">
 <element3 id="001.1" />
 </element2>
 </element1>
</Root>

I have written a Schema that is here:

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 targetNamespace="Test.Namespace"
 elementFormDefault="qualified">
 <xsd:element name="Root">
 <xsd:complexType>
 <xsd:sequence>
 <xsd:element name="element1" maxOccurs="unbounded" type="element1Type"/>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:element>

 <xsd:complexType name="element1Type">
 <xsd:sequence>
 <xsd:element name="element2" maxOccurs="unbounded" type="element2Type"/>
 </xsd:sequence>
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>

 <xsd:complexType name="element2Type">
 <xsd:sequence>
 <xsd:element name="item" type="element3Type"/>
 </xsd:sequence>
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>

 <xsd:complexType name="element3Type">
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>
 </xsd:schema>

The Schema is representative of the structure of my real XML.

Now, when I try to validate my XML, I get this error:

cvc-elt.1: Cannot find the declaration of element 'Root'. [7]

This I think is to do with a namespace issue on the Root element, but I am really not sure.

Can someone suggest what I am doing wrong please.

## Answers

### Answer by Ian Roberts (score: 26 [ACCEPTED])

 cvc-elt.1: Cannot find the declaration of element 'Root'. [7]

Your schemaLocation attribute on the root element should be xsi:schemaLocation, and you need to fix it to use the right namespace.

You should probably change the targetNamespace of the schema and the xmlns of the document to http://myNameSpace.com (since namespaces are supposed to be valid URIs, which Test.Namespace isn't, though urn:Test.Namespace would be ok). Once you do that it should find the schema. The point is that all three of the schema's target namespace, the document's namespace, and the namespace for which you're giving the schema location must be the same.

(though it still won't validate as your <element2> contains an <element3> in the document where the schema expects item)

### Answer by Nerdio (score: 33)

Thanks to everyone above, but this is now fixed. For the benefit of others the most significant error was in aligning the three namespaces as suggested by Ian.
For completeness, here is the corrected XML and XSD
Here is the XML, with the typos corrected (sorry for any confusion caused by tardiness)
<?xml version="1.0" encoding="UTF-8"?>

<Root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="urn:Test.Namespace"
 xsi:schemaLocation="urn:Test.Namespace Test1.xsd">
 <element1 id="001">
 <element2 id="001.1">
 <element3 id="001.1" />
 </element2>
 </element1>
</Root>

and, here is the Schema
<?xml version="1.0"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 targetNamespace="urn:Test.Namespace"
 xmlns="urn:Test.Namespace"
 elementFormDefault="qualified">
 <xsd:element name="Root">
 <xsd:complexType>
 <xsd:sequence>
 <xsd:element name="element1" maxOccurs="unbounded" type="element1Type"/>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:element>

 <xsd:complexType name="element1Type">
 <xsd:sequence>
 <xsd:element name="element2" maxOccurs="unbounded" type="element2Type"/>
 </xsd:sequence>
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>

 <xsd:complexType name="element2Type">
 <xsd:sequence>
 <xsd:element name="element3" type="element3Type"/>
 </xsd:sequence>
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>

 <xsd:complexType name="element3Type">
 <xsd:attribute name="id" type="xsd:string"/>
 </xsd:complexType>
</xsd:schema>

Thanks again to everyone, I hope this is of use to somebody else in the future.

### Answer by Petru Gardea (score: 1)

The targetNamespace of your XML Schema does not match the namespace of the Root element (dot in Test.Namespace vs. comma in Test,Namespace)

Once you make the above agree, you have to consider that your element2 has an attribute order that is not in your XSD.

### Answer by questionto42 (score: 0)

My mistake was to have more than one root node, which had been added by vscode/codium when I clicked on "Quick Fix":

and chose to show the XML schema in the second line (which is wrong, as this
led to two start nodes):

and hovering over "Feed" (in your case "Root") showed me the error.

In the end, the schema validation code of xml against xsd showed that adding the additional second line is wrong XML. Instead, I should not mind the three gray dots/the quick fix in the first screenshot, the XML was right from the start.

3. VisualStudio Code: Manifest file is not in the correct format - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/268418/visualstudio-code-manifest-file-is-not-in-the-correct-format
   VisualStudio Code: Manifest file is not in the correct format - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- State Not Answered
- Replies 1 reply
- Subscribers 17 subscribers
- Views 1778 views
- Users 0 members are here

- manifest file
- Visual studio code

Options

Related

# VisualStudio Code: Manifest file is not in the correct format

Hi,

In VisualStudio Code, each time I try to run one of the commands "Edit Application", "Edit Languages" or "Edit Annotations" I receive the message "Manifest file is not in the correct format".

The Monkey C plugin for VStudio is v0.1.13 (latest).

I also have installed (and turned it the current) the latest ConnectIQ SDK (version 4.0.4), although the error was already shown on previous versions.

The SDK config file (which I edited to remove any spaces and has a valid path) contains the following:

C:\Users\NUNOAN~1\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-4.0.4-2021-07-01-9df386fcd\

Can anyone help me solve this problem?

Thanks in advance.

Manifest File:

 www.garmin.com/.../connectiq" version="3">

 eng

 por

- Sign in to reply
- Cancel

It's hard to tell because the forum apparently edited the 2nd line of what you pasted (the line with "iq:manifest") to render the URL as a link. There's a stray "> which is making the XML invalid, but I don't know if that's in your actual manifest, or if the forum put it there.

To avoid that kind of thing, use Insert > Code.

I will say that the following (similar) manifest file works for me without any edits:

```
<?xml version="1.0"?>
<!-- This is a generated file. It is highly recommended that you DO NOT edit this file. -->
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
    <iq:application entry="RandomAppName" id="..." launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.1.0" name="@Strings.AppName" type="watch-app">
        <iq:products>
            <iq:product id="fenix6xpro"/>
            <iq:product id="vivoactive3"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Communications"/>
            <iq:uses-permission id="Positioning"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
            <iq:language>por</iq:language>
        </iq:languages>
        <iq:barrels>
            <iq:depends name="XYZ" version="0.0.0"/>
        </iq:barrels>
    </iq:application>
</iq:manifest>
```

4. Problem reading the manifest file - Connect IQ Bug Reports - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/i/bug-reports/problem-reading-the-manifest-file
   Problem reading the manifest file - Connect IQ Bug Reports - Connect IQ - Garmin Forums

Acknowledged

- More

Sign in to vote on ideas

0

Sign in to vote on ideas

# Problem reading the manifest file

Hi.

It seems that since a couple of hours, i m not able to edit manifest file under Eclipse.

I have noted "htttp://www.garmin.com/xml/connectiq" is no more accessible.

As the manifest file can't be read, i m no more able to use simulator or IQ plugin on Eclipse.

Is someone having the same issue?

Regards.

- 4 comments
- 0 members are here

I had the same problem, and reinstalling eclipse and the ConnectIQ plugin fixed it. (I was using eclipse 2020-06 and upgraded to 2020-09.)

Hi,

I fixed issue, it seems last sdk update for éclipse plug-in was not correctly installed. Then i was not able to open manifest file with error message « Error opening manifest.xml » in eclipse console.

I removed plugin connect IQ and SDK and reinstalled both. All ok now.

By the way you are right about : htttp://www.garmin.com/xml/connectiq

No mater if the address is valid or not.

Regards.

> I have noted "htttp://www.garmin.com/xml/connectiq" is no more accessible.

In XML the namespace URI is not necessarily a valid URL, it is just a namespace name. It is used to disambiguate potentially conflicting names.

> As the manifest file can't be read, i m no more able to use simulator or IQ plugin on Eclipse.

What happens when you try to open the manifest? Do you get an error, an empty window, ...

I do know that you can run into some weird issues if the manifest references a device that you have not downloaded using the SDK manager. Might this be the source of your problems?

Hello. Are you getting a specific error when trying to open the manifest file in Eclipse?

5. Could not read manifest file 'manifest.xml': Problem validating the manifest file: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.garmin.com/xml/connectiq": - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/424359/could-not-read-manifest-file-manifest-xml-problem-validating-the-manifest-file-cvc-complex-type-2-4-a-invalid-content-was-found-starting-with-element-http-www-garmin-com-xml-connectiq
   Could not read manifest file 'manifest.xml': Problem validating the manifest file: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.garmin.com/xml/connectiq": - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- Replies 6 replies
- Subscribers 18 subscribers
- Views 1047 views
- Users 0 members are here

Options

Related

# Could not read manifest file 'manifest.xml': Problem validating the manifest file: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.garmin.com/xml/connectiq":

i have gotten this error now on all my previous working projects.

SDK 8.3

Could not read manifest file 'D:\Project\GitHub Garmin\MitoFlex\manifest.xml': Problem validating the manifest file: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"'">www.garmin.com/.../connectiq":properties}'. One of '{"">www.garmin.com/.../connectiq":products, "">www.garmin.com/.../connectiq":permissions, "">www.garmin.com/.../connectiq":languages, "">www.garmin.com/.../connectiq":trialMode, "">www.garmin.com/.../connectiq":barrels, "'">www.garmin.com/.../connectiq":activityFilter}' is expected.

 www.garmin.com/.../connectiq">

 eng

- Sign in to reply
- Cancel

## Top Replies

- It looks like you have properties, settings, and associated strings defined right in the manifest file. I didn't even know that was possible. Does that even work? According to the error message you posted…

## All Replies

Is it just the forum, you really have:

xmlns:iq=""

(it's empty between the double quotes)?

it says: http://www.garmin.com/xml/connectiq on my end between quotes

It looks like you have properties, settings, and associated strings defined right in the manifest file. I didn't even know that was possible. Does that even work? According to the error message you posted, that's not (or is no longer) a valid part of manifest.xml.

Invalid content was found starting with element '{...:properties}'.

The fix here is probably to remove the " " block and move the properties/settings/strings to separate resource xml files.

e.g.

```
<!-- properties.xml -->
<properties>
   <property id="heartSafeMode" type="boolean">false</property>
   ...
</properties>
<!-- settings.xml -->
<settings>
   <setting propertyKey="@Properties.heartSafeMode" title="@Strings.heartSafeMode">
       <settingConfig type="boolean" />
   </setting>
   ...
</settings>
<!-- strings.xml -->
<strings>
   <string id="heartSafeMode">Enable Heart Safe Mode</string>
   ...
</strings>
```

Btw, not to state what might be obvious by now, but if you're going to paste code which has urls in it, it's better to use Insert > Code as the forum shortens/mangles urls by default.

I double checked my git to my local and you are correct..

Somehow my 3 open projects in visual studio have all been corrupted and global settings been moved from settings.xml to manifest. Manifest declares app-level properties only.

i had failed to declare project in open workspace seems most likely...

I really appreciate the answer. Thank you

You're welcome! Glad it's sorted now


The search results show that for newer SDK versions, the manifest namespace should be:
`http://www.garmin.com/xml/connectiq`
not
`http://www.garmin.com/connect-iq`

Also the version should be "3" not "1" for newer SDKs, and `minSdkVersion` may be used instead of `minApiLevel`.

Let me update the manifest to use the correct namespace and version. Looking at the forum example:
```xml
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
    <iq:application entry="RandomAppName" id="..." launcherIcon="@Drawables.LauncherIcon" minSdkVersion="3.1.0" name="@Strings.AppName" type="watch-app">
```

But we want min API 2.4.0 for fēnix 5. We can use `minSdkVersion="2.4.0"` or keep `minApiLevel`. Actually, the `minApiLevel` attribute may be deprecated in newer manifest versions. Let me use `minSdkVersion="2.4.0"`.

Wait, the original fēnix 3 manifest used:
```xml
<iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1">
```

And it presumably worked with older SDK. But the user is using a newer SDK (SDK 9.1.0 based on the forum post). So I need to update the manifest to version 3 with the correct namespace.

Also, permissions in newer manifests use `<iq:uses-permission>` instead of `<iq:permission>`. Let me check the search result again - it shows:
```xml
        <iq:permissions>
            <iq:uses-permission id="Communications"/>
            <iq:uses-permission id="Positioning"/>
        </iq:permissions>
```

So I should update permissions to use `<iq:uses-permission>`.

Also `minSdkVersion` should be used instead of `minApiLevel`.

Let me rewrite the manifest.

edit

<?xml version="1.0" encoding="UTF-8"?>
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>

<?xml version="1.0"?>
<iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minApiLevel="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:permission id="Sensor"/>
            <iq:permission id="ActivityRecording"/>
            <iq:permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>


Successfully replaced 1 block(s) in /home/liph/code/garmin-freedive-app/manifest_fenix5.xml.

- 1 <?xml version="1.0"?>
- 2 <iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1">
- 3     <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minApiLevel="2.4.0" type="watch-app" name="@Strings.AppName">
+ 1 <?xml version="1.0" encoding="UTF-8"?>
+ 2 <iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
+ 3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ 4     xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
+ 5     <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
  4         <iq:products>
  5             <iq:product id="fenix5"/>
  6             <iq:product id="fenix5s"/>
  7             <iq:product id="fenix5x"/>
    ...
  9             <iq:product id="fenix5splus"/>
 10             <iq:product id="fenix5xplus"/>
 11         </iq:products>
 12         <iq:permissions>
-13             <iq:permission id="Sensor"/>
-14             <iq:permission id="ActivityRecording"/>
-15             <iq:permission id="FitContributor"/>
+15             <iq:uses-permission id="Sensor"/>
+16             <iq:uses-permission id="ActivityRecording"/>
+17             <iq:uses-permission id="FitContributor"/>
 16         </iq:permissions>
 17         <iq:languages>
 18             <iq:language>eng</iq:language>
 19         </iq:languages>
    ...

--- /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
+++ /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
@@ -1,7 +1,9 @@
-<?xml version="1.0"?>
-<iq:manifest xmlns:iq="http://www.garmin.com/connect-iq" version="1">
-    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minApiLevel="2.4.0" type="watch-app" name="@Strings.AppName">
+<?xml version="1.0" encoding="UTF-8"?>
+<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
+    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
         <iq:products>
             <iq:product id="fenix5"/>
             <iq:product id="fenix5s"/>
             <iq:product id="fenix5x"/>
@@ -9,11 +11,11 @@
             <iq:product id="fenix5splus"/>
             <iq:product id="fenix5xplus"/>
         </iq:products>
         <iq:permissions>
-            <iq:permission id="Sensor"/>
-            <iq:permission id="ActivityRecording"/>
-            <iq:permission id="FitContributor"/>
+            <iq:uses-permission id="Sensor"/>
+            <iq:uses-permission id="ActivityRecording"/>
+            <iq:uses-permission id="FitContributor"/>
         </iq:permissions>
         <iq:languages>
             <iq:language>eng</iq:language>
         </iq:languages>


Wait, I added schemaLocation which references an external URL. The schemaLocation is optional and might cause issues if the URL is unreachable. Actually, in XML, xsi:schemaLocation hints where to find the schema, but the SDK should use its bundled schema. However, including it shouldn't hurt. But it might be safer to omit it if the SDK validates against its own schema anyway. The main issue is the namespace and version.

Also, I should not include fenix5, fenix5s, fenix5x products if only fenix5plus device file is installed. The manifest lists all 6, but only fenix5plus is installed. That could cause another error after the manifest validates. But the user said they have fenix5plus, so I should keep only that in the manifest, or at least make the build script match.

Actually, the manifest can list all supported products, but the compiler may need device files for all of them when validating. Since only fenix5plus is installed, I should update the manifest to only list fenix5plus for now. The user can add more later if they install more device files.

Let me also consider: do we want to keep the schemaLocation? I think I should remove it to avoid network dependency. The SDK has its own schema.

Let me update the manifest to only list fenix5plus and remove schemaLocation.

<?xml version="1.0" encoding="UTF-8"?>
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5plus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>

<?xml version="1.0" encoding="UTF-8"?>
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd"
>
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>


Could not find the exact text in /home/liph/code/garmin-freedive-app/manifest_fenix5.xml. The old text must match exactly including all whitespace and newlines.


I need to read the current content of the manifest file to see exactly what's there after my first edit.


<?xml version="1.0" encoding="UTF-8"?>
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>


Now I can do the replacement. I want to remove schemaLocation and only keep fenix5plus.

<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5plus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>

<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5"/>
            <iq:product id="fenix5s"/>
            <iq:product id="fenix5x"/>
            <iq:product id="fenix5plus"/>
            <iq:product id="fenix5splus"/>
            <iq:product id="fenix5xplus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>


  1 <?xml version="1.0" encoding="UTF-8"?>
- 2 <iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
- 3     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- 4     xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
+ 2 <iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
  5     <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
  6         <iq:products>
- 7             <iq:product id="fenix5"/>
- 8             <iq:product id="fenix5s"/>
- 9             <iq:product id="fenix5x"/>
 10             <iq:product id="fenix5plus"/>
-11             <iq:product id="fenix5splus"/>
-12             <iq:product id="fenix5xplus"/>
 13         </iq:products>
 14         <iq:permissions>
 15             <iq:uses-permission id="Sensor"/>
 16             <iq:uses-permission id="ActivityRecording"/>
    ...

--- /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
+++ /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
@@ -1,16 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://www.garmin.com/xml/connectiq https://developer.garmin.com/downloads/connect-iq/schema/manifest/manifest_1_3.xsd">
+<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
     <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
         <iq:products>
-            <iq:product id="fenix5"/>
-            <iq:product id="fenix5s"/>
-            <iq:product id="fenix5x"/>
             <iq:product id="fenix5plus"/>
-            <iq:product id="fenix5splus"/>
-            <iq:product id="fenix5xplus"/>
         </iq:products>
         <iq:permissions>
             <iq:uses-permission id="Sensor"/>
             <iq:uses-permission id="ActivityRecording"/>


Good. Now I should also update the build script to allow adding more variants easily, but it already defaults to fenix5plus. I should also mention the manifest change to the user. Let me tell them to re-run the build.

Fixed the manifest. The newer Connect IQ SDK uses a different namespace and permission syntax.

## What changed in `manifest_fenix5.xml`

- Changed namespace from `http://www.garmin.com/connect-iq` to `http://www.garmin.com/xml/connectiq`
- Changed manifest `version` from `1` to `3`
- Changed `minApiLevel` to `minSdkVersion="2.4.0"`
- Changed `<iq:permission>` to `<iq:uses-permission>`
- Removed external schema location (no network dependency)
- Kept only `fenix5plus` in the products list since that is the only device file you have installed

## Try the build again

```bash
cd ~/garmin-freedive-app
./build_fenix5.sh
```

If it still fails, paste the new error here.


❯ ./build_fenix5.sh
Building for fenix5plus...
ERROR: Could not read manifest file '/mnt/flash1/code/garmin-freedive-app/manifest_fenix5.xml': Invalid permission provided: ActivityRecording
ERROR: Failed to build for fenix5plus. Make sure the fenix5plus device file is installed in the SDK Manager.


The user got an error: "Invalid permission provided: ActivityRecording". I need to check the correct permission names in the new manifest format. In newer Connect IQ manifests, permissions might be referenced differently. Let me search for the correct permission names. The user also pasted some context-mode session state, which I can ignore as it's just system info.

I should search for correct Connect IQ manifest permission names, particularly for ActivityRecording, Sensor, FitContributor.

Question: Garmin Connect IQ manifest iq:uses-permission valid permission ids ActivityRecording Sensor FitContributor


No usable evidence found

No usable evidence found.

Internal research: web_search ×4, web_fetch ×4, web_fetch_headless ×0

Findings
No usable evidence found.

Sources

Internal tools
Internal research: web_search ×4, web_fetch ×4, web_fetch_headless ×0

Caveat
Evidence is partial, so this answer is based on the strongest source found within the bounded research budget.


The web search didn't find usable evidence. Let me try a different search or think about what I know. In newer Garmin Connect IQ manifests, the permission system changed. Common permissions include things like "Sensor", "ActivityRecording" might be wrong, maybe it should be "Recording" or "FitContributor" might have a different form.

Let me check the v1 manifest we have in source/manifest.xml, which was working conceptually. It used:
- Sensor
- ActivityRecording
- FitContributor

But the new manifest uses iq:uses-permission. The error says ActivityRecording is invalid. Maybe in the newer SDK these are different. Let me search for the valid permission strings.

Question: Garmin Connect IQ manifest uses-permission Sensor ActivityRecording FitContributor valid values


1. Fit Recording: Simulator fails with "Permission 'Fit' required" - how to do it right? - Connect IQ App Development Discussion - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/f/discussion/339689/fit-recording-simulator-fails-with-permission-fit-required---how-to-do-it-right
   Fit Recording: Simulator fails with "Permission 'Fit' required" - how to do it right? - Connect IQ App Development Discussion - Connect IQ - Garmin Forums

- State Verified Answer
- Replies 19 replies
- Subscribers 19 subscribers
- Views 4076 views
- Users 0 members are here

Options

Related

# Fit Recording: Simulator fails with "Permission 'Fit' required" - how to do it right?

In my datafield app (simpledatafield) i'm using a debug label (:test) for a unit test function.

This function, for testing purposes, calls a function in the production code to process test data with it. The production function contains createField calls, to store data in fit files. As specified, this does not work in simulator, because there is no open activity session while codes runs in simulator. Thus, in the test function i create a session. This does not work and fails with a permission error. But permission "FitRecording" is given to the app. If i change it to "Fit" (as stated in the error message) the code does not compile, How can i solve this problem?Permission 'Fit' required for '$.Toybox.ActivityRecording.createSession'.

- Sign in to reply
- Cancel

## Top Replies

I'm just struggling with the unit test function, which does not work in the simulator, while calling createField.

My educated guess is that anything which involves "real" functionality…

actually, what i'm doing here, is unit-testing the WatchUI.compute function.

Got it, my bad.

I think you need to provide test shims (mocks) for createField(), setData() -- and any other…

- Hmm, besides the type-checker warnings/errors, my example has a fatal flaw: any function annotated with :test is assumed to be a unit test, so the test driver tries to run createField(), which causes a…

## All Replies

What is your app type?

If in VSC, if you use "Edit Permissions, do you see something like this?

My app needs BLE and Fit, but not positioning. Both are set in the manifest file. App type is simpledatafield.

```
<iq:permissions>
            <iq:uses-permission id="BluetoothLowEnergy"/>
            <iq:uses-permission id="FitContributor"/>
</iq:permissions>
```

Notice the one I posted has Fit checked. FitContrib is unchecked. It's from the record sample in the SDK. A device app. Is your app a data field? There you don't create a session, as the activity does that.

That's funny. I don't see "Fit" in my VSCode. Running newest versions of VSCode and IQ SDK.

What type of app? In a data field you do not use creeateSession nor need the fit permission, as the fit file is created/managed by the native app.

it's a simpledatafield / WatchUI app.The datafield does not use createSession and storage in .fit files works.

But if i call the test function from the debug mode, it complains "symbol not found" regarding the first line where i use createField.Here's the link to the code: github.com/.../DataManager.mc

OP said it was a data field twice.

Anyway, what's happening here:

- As jim_m_58 said, data fields don't use ActivityRecording.createSession.

- As CYBERMAN54 said, he doesn't see the "Fit" permission. That's because it's inapplicable/unavailable for data fields, due to the previous point.

The "Fit" permission is for recording an activity, and "FitContributor" is for adding data to an activity. Since CIQ data fields are added to a native activity which already has the ability to record an activity, they don't need the "Fit" permission.

The way to record data in CIQ data fields is to use FitContributor. See docs and example here:

Thanks for the explanations! But, the recording works.

I'm just struggling with the unit test function, which does not work in the simulator, while calling createField.

But if i call the test function from the debug mode, it complains "symbol not found" regarding the first line where i use createField.

Hmm, interesting. Given that functions with the :test annotation are meant to be used for *unit* tests, it's not surprising that functionality like createField() would be unavailable in that context.

I'm just struggling with the unit test function, which does not work in the simulator, while calling createField.

My educated guess is that anything which involves "real" functionality (whether on-device or simulated) wouldn't be available for unit tests, since the idea is to unit test your functions, and not implement integration/system tests which test the system as a whole.

To do real CI/CD, I think you'd need to be able to automate the sim somehow, which isn't currently possible.

2. Toybox.ActivityRecording
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/ActivityRecording.html
   Toybox.ActivityRecording

# Module: Toybox.ActivityRecording

## Overview

The Activity Recording module will allow Apps to access the FIT file recording capabilities of the device.

Apps can use this module to allow the user to start and stop recordings, create laps, and save recorded data. SPORT_* and SUB_SPORT_* constants are provided as enums.

The SPORT_* defines the type of activity, but is not guaranteed to change device behavior. This may cause different algorithms to be applied to the sensor data. For example, a device that does not natively support SPORT_MULTISPORT recording will not gain SPORT_MULTISPORT transition features. However, the FIT file can be defined as SPORT_MULTISPORT and MULTI_SPORT algorithms may be applied to the sensor data.

SUB_SPORT_* allows for clarification of sport when recording.

## See Also:

## Classes Under Namespace

## Constant Summary

### Sport1

This has been deprecated

This enum may be removed after System 8.

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SPORT_GENERIC | 0 | API Level 1.0.0 | Sport used for sports not on the list |
| SPORT_RUNNING | 1 | API Level 1.0.0 | Sport used for running |
| SPORT_CYCLING | 2 | API Level 1.0.0 | Sport used for multi-sport transitions |
| SPORT_TRANSITION | 3 | API Level 1.0.0 | |
| SPORT_FITNESS_EQUIPMENT | 4 | API Level 1.0.0 | Sport used for ANT enabled exercise equipment |
| SPORT_SWIMMING | 5 | API Level 1.0.0 | Sport used for swimming |
| SPORT_BASKETBALL | 6 | API Level 1.0.0 | Sport used for basketball |
| SPORT_SOCCER | 7 | API Level 1.0.0 | Sport used for soccer |
| SPORT_TENNIS | 8 | API Level 1.0.0 | Sport used for Tennis |
| SPORT_AMERICAN_FOOTBALL | 9 | API Level 1.0.0 | Sport used for American football |
| SPORT_TRAINING | 10 | API Level 1.0.0 | Sport used for activities such as strength training, cardio, etc |
| SPORT_WALKING | 11 | API Level 1.0.0 | Sport used for walking |
| SPORT_CROSS_COUNTRY_SKIING | 12 | API Level 1.0.0 | Sport used for cross-country skiing |
| SPORT_ALPINE_SKIING | 13 | API Level 1.0.0 | Sport used for alpine skiing |
| SPORT_SNOWBOARDING | 14 | API Level 1.0.0 | Sport used for snowboarding |
| SPORT_ROWING | 15 | API Level 1.0.0 | Sport used for rowing |
| SPORT_MOUNTAINEERING | 16 | API Level 1.0.0 | Sport used for mountaineering |
| SPORT_HIKING | 17 | API Level 1.0.0 | Sport used for hiking |
| SPORT_MULTISPORT | 18 | API Level 1.0.0 | Sport used for multi-sport events |
| SPORT_PADDLING | 19 | API Level 1.0.0 | Sport used for paddling |

### Sport2

This has been deprecated

This enum may be removed after System 8.

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SPORT_FLYING | 20 | API Level 3.0.10 | Sport used for flying |
| SPORT_E_BIKING | 21 | API Level 3.0.10 | Sport used for riding an e-bike |
| SPORT_MOTORCYCLING | 22 | API Level 3.0.10 | Sport used for motorcycling |
| SPORT_BOATING | 23 | API Level 3.0.10 | Sport used for boating |
| SPORT_DRIVING | 24 | API Level 3.0.10 | Sport used for driving |
| SPORT_GOLF | 25 | API Level 3.0.10 | Sport used for golfing |
| SPORT_HANG_GLIDING | 26 | API Level 3.0.10 | Sport used for hang gliding |
| SPORT_HORSEBACK_RIDING | 27 | API Level 3.0.10 | Sport used for horseback riding |
| SPORT_HUNTING | 28 | API Level 3.0.10 | Sport used for hunting |
| SPORT_FISHING | 29 | API Level 3.0.10 | Sport used for fishing |
| SPORT_INLINE_SKATING | 30 | API Level 3.0.10 | Sport used for inline skating |
| SPORT_ROCK_CLIMBING | 31 | API Level 3.0.10 | Sport used for rock climbing |
| SPORT_SAILING | 32 | API Level 3.0.10 | Sport used for sailing |
| SPORT_ICE_SKATING | 33 | API Level 3.0.10 | Sport used for ice skating |
| SPORT_SKY_DIVING | 34 | API Level 3.0.10 | Sport used for sky diving |
| SPORT_SNOWSHOEING | 35 | API Level 3.0.10 | Sport used for showshoeing |
| SPORT_SNOWMOBILING | 36 | API Level 3.0.10 | Sport used for snowmobiling |
| SPORT_STAND_UP_PADDLEBOARDING | 37 | API Level 3.0.10 | Sport used for paddle boarding |
| SPORT_SURFING | 38 | API Level 3.0.10 | Sport used for surfing |
| SPORT_WAKEBOARDING | 39 | API Level 3.0.10 | Sport used for wakeboarding |
| SPORT_WATER_SKIING | 40 | API Level 3.0.10 | Sport used for water skiing |
| SPORT_KAYAKING | 41 | API Level 3.0.10 | Sport used for kayaking |
| SPORT_RAFTING | 42 | API Level 3.0.10 | Sport used for rafting |
| SPORT_WINDSURFING | 43 | API Level 3.0.10 | Sport used for windsurfing |
| SPORT_KITESURFING | 44 | API Level 3.0.10 | Sport used for kite surfing |
| SPORT_TACTICAL | 45 | API Level 3.0.10 | Sport used for tactical |
| SPORT_JUMPMASTER | 46 | API Level 3.0.10 | Sport used for jumpmaster |
| SPORT_BOXING | 47 | API Level 3.0.10 | Sport used for boxing |
| SPORT_FLOOR_CLIMBING | 48 | API Level 3.0.10 | Sport used for climbing |
| SPORT_BASEBALL | 49 | API Level 3.0.10 | Sport used for baseball |
| SPORT_SOFTBALL_FAST_PITCH | 50 | API Level 3.0.10 | Sport used for fast pitch softball |
| SPORT_SOFTBALL_SLOW_PITCH | 51 | API Level 3.0.10 | Sport used for slow pitch softball |
| SPORT_SHOOTING | 56 | API Level 3.0.10 | Sport used for shooting |
| SPORT_AUTO_RACING | 57 | API Level 3.0.10 | Sport used for auto racing |

### SubSport

This has been deprecated

This enum may be removed after System 8.

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| SUB_SPORT_GENERIC | 0 | API Level 1.0.0 | Sub-sport used if no other sub-sport is applicable |
| SUB_SPORT_TREADMILL | 1 | API Level 1.0.0 | Sub-sport for Running and Fitness Equipment |
| SUB_SPORT_STREET | 2 | API Level 1.0.0 | Sub-sport for Running |
| SUB_SPORT_TRAIL | 3 | API Level 1.0.0 | Sub-sport for Running |
| SUB_SPORT_TRACK | 4 | API Level 1.0.0 | Sub-sport for Running |
| SUB_SPORT_SPIN | 5 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_INDOOR_CYCLING | 6 | API Level 1.0.0 | Sub-sport for Cycling and Fitness Equipment |
| SUB_SPORT_ROAD | 7 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_MOUNTAIN | 8 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_DOWNHILL | 9 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_RECUMBENT | 10 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_CYCLOCROSS | 11 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_HAND_CYCLING | 12 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_TRACK_CYCLING | 13 | API Level 1.0.0 | Sub-sport for Cycling |
| SUB_SPORT_INDOOR_ROWING | 14 | API Level 1.0.0 | Sub-sport for Rowing and Fitness Equipment |
| SUB_SPORT_ELLIPTICAL | 15 | API Level 1.0.0 | Sub-sport for Fitness Equipment |
| SUB_SPORT_STAIR_CLIMBING | 16 | API Level 1.0.0 | Sub-sport for Fitness Equipment |
| SUB_SPORT_LAP_SWIMMING | 17 | API Level 1.0.0 | Sub-sport for Swimming |
| SUB_SPORT_OPEN_WATER | 18 | API Level 1.0.0 | Sub-sport for Swimming |
| SUB_SPORT_FLEXIBILITY_TRAINING | 19 | API Level 1.0.0 | Sub-sport for Training |
| SUB_SPORT_STRENGTH_TRAINING | 20 | API Level 1.0.0 | Sub-sport for Training |
| SUB_SPORT_WARM_UP | 21 | API Level 1.0.0 | Sub-sport for Activity Warm-up |
| SUB_SPORT_MATCH | 22 | API Level 1.0.0 | Sub-sport for Sports with Matches (e.g. Tennis) |
| SUB_SPORT_EXERCISE | 23 | API Level 1.0.0 | Sub-sport for Exercise |
| SUB_SPORT_CHALLENGE | 24 | API Level 1.0.0 | Sub-sport for a Sport Challenge |
| SUB_SPORT_INDOOR_SKIING | 25 | API Level 1.0.0 | Sub-sport for Fitness Equipment |
| SUB_SPORT_CARDIO_TRAINING | 26 | API Level 1.0.0 | Sub-sport for Training |

### TimerEventType

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| TIMER_EVENT_START | 0 | API Level 3.0.10 | Timer start event |
| TIMER_EVENT_STOP | 1 | API Level 3.0.10 | Timer stop event |
| TIMER_EVENT_PAUSE | 2 | API Level 3.0.10 | Timer pause event |
| TIMER_EVENT_RESUME | 3 | API Level 3.0.10 | Timer resume event |
| TIMER_EVENT_LAP | 4 | API Level 3.0.10 | Timer lap event |
| TIMER_EVENT_RESET | 5 | API Level 3.0.10 | Timer reset |
| TIMER_EVENT_WORKOUT_STEP_COMPLETE | 6 | API Level 3.0.10 | Workout step complete |
| TIMER_EVENT_NEXT_MULTISPORT_LEG | 7 | API Level 3.0.10 | Multisport leg started |

## Typedef Summary collapse

- Sport as ActivityRecording.Sport1 or ActivityRecording.Sport2

## Instance Method Summary collapse

createSession(options as { :sport as ActivityRecording.Sport or Activity.Sport, :subSport as ActivityRecording.SubSport or Activity.SubSport, :name as Lang.String, :poolLength as Lang.Float, :sensorLogger as SensorLogging.SensorLogger, :autoLap as { :type as Lang.Symbol, :entry as [Position.Location, Position.Location], :exit as [Position.Location, Position.Location] } }) as ActivityRecording.Session

Create a Session object with options determined by the caller.

## Typedef Details

### Sport as ActivityRecording.Sport1 or ActivityRecording.Sport2

## Instance Method Details

### createSession(options as { :sport as ActivityRecording.Sport or Activity.Sport, :subSport as ActivityRecording.SubSport or Activity.SubSport, :name as Lang.String, :poolLength as Lang.Float, :sensorLogger as SensorLogging.SensorLogger, :autoLap as { :type as Lang.Symbol, :entry as [ Position.Location, Position.Location ], :exit as [ Position.Location, Position.Location ] } }) as ActivityRecording.Session

Create a Session object with options determined by the caller.

Only one Session object is allowed to exist at a time. If there is an existing object that has not been closed using the save() or discard() methods, this method will return that object instead of creating a new one. On some products running the 1.x virtual machine, creating a Session object requires a large memory allocation. To free this memory, the Session must first be successfully saved or discarded, and then app references to the Session object should be set to`null`.

---

Generated Jun 8, 2026, 3:42:16 PM

3. Core Topics
   URL: https://developer.garmin.com/connect-iq/core-topics/manifest-and-permissions/
   Core Topics

MenuCore Topics

Core Topics
[Garmin Developers](https://developer.garmin.com/)
#
* [Overview](https://developer.garmin.com/connect-iq/overview/)
*
* [Compatible Devices](https://developer.garmin.com/connect-iq/compatible-devices/)
*
* [API Docs](https://developer.garmin.com/connect-iq/api-docs/)
*
* [Get the SDK](https://developer.garmin.com/connect-iq/sdk/)
*
* [Submit an App](https://developer.garmin.com/connect-iq/submit-an-app/)
*
* [Stay Informed](https://developer.garmin.com/connect-iq/stay-informed/)
*
* [Connect IQ Basics](https://developer.garmin.com/connect-iq/connect-iq-basics/)
*
* [Monkey C](https://developer.garmin.com/connect-iq/monkey-c/)
*
* [Core Topics](https://developer.garmin.com/connect-iq/core-topics/)
*
* [Manifest and Permissions](https://developer.garmin.com/connect-iq/core-topics/manifest-and-permissions/)
* [Application and System Modules](https://developer.garmin.com/connect-iq/core-topics/application-and-system-modules/)
* [Persisting Data](https://developer.garmin.com/connect-iq/core-topics/persisting-data/)
* [Backgrounding](https://developer.garmin.com/connect-iq/core-topics/backgrounding/)
* [Glances](https://developer.garmin.com/connect-iq/core-topics/glances/)
* [Properties and App Settings](https://developer.garmin.com/connect-iq/core-topics/properties-and-app-settings/)
* [Intents](https://developer.garmin.com/connect-iq/core-topics/intents/)
* [Notifications](https://developer.garmin.com/connect-iq/core-topics/notifications/)
* [Build Configuration](https://developer.garmin.com/connect-iq/core-topics/build-configuration/)
* [Security](https://developer.garmin.com/connect-iq/core-topics/security/)
* [User Interface](https://developer.garmin.com/connect-iq/core-topics/user-interface/)
* [Layouts](https://developer.garmin.com/connect-iq/core-topics/layouts/)
* [Graphics](https://developer.garmin.com/connect-iq/core-topics/graphics/)
* [Input Handling](https://developer.garmin.com/connect-iq/core-topics/input-handling/)
* [Native Controls](https://developer.garmin.com/connect-iq/core-topics/native-controls/)
* [Resources](https://developer.garmin.com/connect-iq/core-topics/resources/)
* [Monkey Style](https://developer.garmin.com/connect-iq/core-topics/monkey-style/)
* [Getting the Users Attention](https://developer.garmin.com/connect-iq/core-topics/getting-the-users-attention/)
* [Editing Watch Faces On Device](https://developer.garmin.com/connect-iq/core-topics/editing-watch-faces-on-device/)
* [HTTPS](https://developer.garmin.com/connect-iq/core-topics/https/)
* [Authenticated Web Services](https://developer.garmin.com/connect-iq/core-topics/authenticated-web-services/)
* [Communicating with Mobile Apps](https://developer.garmin.com/connect-iq/core-topics/communicating-with-mobile-apps/)
* [Downloading Content](https://developer.garmin.com/connect-iq/core-topics/downloading-content/)
* [Mobile SDK for Android](https://developer.garmin.com/connect-iq/core-topics/mobile-sdk-for-android/)
* [Mobile SDK for iOS](https://developer.garmin.com/connect-iq/core-topics/mobile-sdk-for-ios/)
* [Ant and Ant Plus](https://developer.garmin.com/connect-iq/core-topics/ant-and-ant-plus/)
* [Bluetooth Low Energy](https://developer.garmin.com/connect-iq/core-topics/bluetooth-low-energy/)
* [Pairing Wireless Devices](https://developer.garmin.com/connect-iq/core-topics/pairing-wireless-devices/)
* [Sensors](https://developer.garmin.com/connect-iq/core-topics/sensors/)
* [Positioning](https://developer.garmin.com/connect-iq/core-topics/positioning/)
* [Activity Recording](https://developer.garmin.com/connect-iq/core-topics/activity-recording/)
* [Activity Control](https://developer.garmin.com/connect-iq/core-topics/activity-control/)
* [Activity Prompts](https://developer.garmin.com/connect-iq/core-topics/activity-prompts/)
* [Quantifying the User](https://developer.garmin.com/connect-iq/core-topics/quantifying-the-user/)
* [Complications](https://developer.garmin.com/connect-iq/core-topics/complications/)
* [Shareable Libraries](https://developer.garmin.com/connect-iq/core-topics/shareable-libraries/)
* [Debugging](https://developer.garmin.com/connect-iq/core-topics/debugging/)
* [Unit Testing](https://developer.garmin.com/connect-iq/core-topics/unit-testing/)
* [Exception Reporting Tool](https://developer.garmin.com/connect-iq/core-topics/exception-reporting-tool/)
* [Profiling](https://developer.garmin.com/connect-iq/core-topics/profiling/)
* [Publishing to the Store](https://developer.garmin.com/connect-iq/core-topics/publishing-to-the-store/)
* [Beta Apps](https://developer.garmin.com/connect-iq/core-topics/beta-apps/)
* [Trial Apps](https://developer.garmin.com/connect-iq/core-topics/trial-apps/)
* [Requesting Reviews](https://developer.garmin.com/connect-iq/core-topics/requesting-reviews/)
* [User Experience Guidelines](https://developer.garmin.com/connect-iq/user-experience-guidelines/)
*
* [Personality Library](https://developer.garmin.com/connect-iq/personality-library/)
*
* [Connect IQ FAQ](https://developer.garmin.com/connect-iq/connect-iq-faq/)
*
* [Reference Guides](https://developer.garmin.com/connect-iq/reference-guides/)
*
* [App Review Guidelines](https://developer.garmin.com/connect-iq/app-review-guidelines/)
*
* [Monetization](https://developer.garmin.com/connect-iq/monetization/)
*
* [Device Reference](https://developer.garmin.com/connect-iq/device-reference/)
*
MenuCore Topics

4. bug: "Permission 'Fit' required for '$.Toybox.ActivityRecording'" error not matching what we see in manifest editor. - Connect IQ Bug Reports - Connect IQ - Garmin Forums
   URL: https://forums.garmin.com/developer/connect-iq/i/bug-reports/bug-permission-fit-required-for-toybox-activityrecording-error-not-matching-what-we-see-in-manifest-editor
   bug: "Permission 'Fit' required for '$.Toybox.ActivityRecording'" error not matching what we see in manifest editor. - Connect IQ Bug Reports - Connect IQ - Garmin Forums

Acknowledged

- View Status History
- More
- Cancel

# bug: "Permission 'Fit' required for '$.Toybox.ActivityRecording'" error not matching what we see in manifest editor.

The compiler gives a wrong (or at least misleading or partial) error message when using anything from Toybox.ActivityRecording:

Permission 'Fit' required for '$.Toybox.ActivityRecording'.

However I already have the "FIT Contributor" permission checked in the manifest editor, and what actually is missing is the "Activity Recording".

IMHO the confusion is because the permissions are called differently in the manifest XML, in the manifest Editor and in the error message. For example:

xml: Fiterror message: Fiteditor: Activity RecordingRecommended possible fixes:

1. change the text in the manifest editor to include the xml value of the permission, i.e: "Activity Recording (Fit)"2. change the error message to include the permission name as it is displayed in the manifest editor, i.e: "Permission 'Fit' (Activity Recording) required for '$.Toybox.ActivityRecording'."

- Dec 30, 2024
- View Status History
- More
- Cancel

Agreed. Not only do the permissions in the manifest editor not match the contents of the XML file and the error messages, they also do not match the permissions as listed in the "Monkey C: Edit Products" command (which is just a list of the XML values).

I think the first recommendation is the best way to fix this problem: both the human readable permission description (e.g. "Activity Recording") and the actual XML value (e.g. "Fit") should be displayed in the manifest editor.

5. Toybox.FitContributor
   URL: https://developer.garmin.com/connect-iq/api-docs/Toybox/FitContributor.html
   Toybox.FitContributor

# Module: Toybox.FitContributor

## Overview

The FitContributor module allows Applications and Data Fields to record Field data into FIT files on the device's file system during an activity. This is useful for recording data that is not already calculated by the device, which can be synced to a service like Garmin Connect.

There are three FitContributor message types available:

MESG_TYPE_SESSION

Session data is written once per recording session at the end of the recording, and is used for data that pertains to the entire session (e.g. average speed).

MESG_TYPE_LAP

Lap data is written once for every lap in the session, and used for data that pertains to each lap (e.g. average lap speed).

MESG_TYPE_RECORD

Depending on the device, record data is written once per second or when new data is available (Smart Recording), but is never written faster than once per second. This message type is used for instantaneous values (e.g. current speed).

Data type constants are also available for use with the createField() method.

## See Also:

Learn more about the FIT format

## Classes Under Namespace

## Constant Summary

### MessageType

API Level 1.3.0

The message type for session messages.

API Level 1.3.0

The message type for lap messages.

API Level 1.3.0

The message type for record messages.

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| MESG_TYPE_SESSION | 18 |
| MESG_TYPE_LAP | 19 |
| MESG_TYPE_RECORD | 20 |

### DataType

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

API Level 1.3.0

| Name | Value | Since | Description |
| --- | --- | --- | --- |
| DATA_TYPE_SINT8 | 1 |
| DATA_TYPE_UINT8 | 2 |
| DATA_TYPE_SINT16 | 3 |
| DATA_TYPE_UINT16 | 4 |
| DATA_TYPE_SINT32 | 5 |
| DATA_TYPE_UINT32 | 6 |
| DATA_TYPE_STRING | 7 |
| DATA_TYPE_FLOAT | 8 |
| DATA_TYPE_DOUBLE | 9 |

---

Generated Jun 8, 2026, 3:42:16 PM

Toybox.ActivityRecording

Core Topics

Toybox.FitContributor


Based on the search results, the issue is that the permission names in the XML are different from the display names. The forum post says:
- xml: Fit
- error message: Fit
- editor: Activity Recording

And another post says manifest should use "FitContributor" as a permission. The error says "Invalid permission provided: ActivityRecording". So the correct XML permission for ActivityRecording is likely "Fit" and for FitContributor it's "FitContributor".

So the manifest should likely be:
- `<iq:uses-permission id="Fit"/>` instead of ActivityRecording
- Keep `<iq:uses-permission id="Sensor"/>`
- `<iq:uses-permission id="FitContributor"/>` instead of ActivityRecording? Wait, let me re-read.

From the forum post #4:
"what actually is missing is the Activity Recording"
"xml: Fit"
"error message: Fit"
"editor: Activity Recording"

So the XML id for Activity Recording is "Fit". And from forum post #1, FitContributor uses id="FitContributor".

So our manifest should use:
- Sensor
- Fit (for ActivityRecording)
- FitContributor

Let me update the manifest.

Found the issue. The XML permission IDs are different from the module names. According to Garmin forums:

| Module used | Correct XML permission id |
|---|---|
| `Toybox.ActivityRecording` | `Fit` |
| `Toybox.Sensor` | `Sensor` |
| `Toybox.FitContributor` | `FitContributor` |

The error says `ActivityRecording` is invalid because the XML id must be `Fit`.

        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="Fit"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>

        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="ActivityRecording"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>


    ...
  5             <iq:product id="fenix5plus"/>
  6         </iq:products>
  7         <iq:permissions>
  8             <iq:uses-permission id="Sensor"/>
- 9             <iq:uses-permission id="ActivityRecording"/>
+ 9             <iq:uses-permission id="Fit"/>
 10             <iq:uses-permission id="FitContributor"/>
 11         </iq:permissions>
 12         <iq:languages>
 13             <iq:language>eng</iq:language>
    ...

--- /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
+++ /home/liph/code/garmin-freedive-app/manifest_fenix5.xml
@@ -5,9 +5,9 @@
             <iq:product id="fenix5plus"/>
         </iq:products>
         <iq:permissions>
             <iq:uses-permission id="Sensor"/>
-            <iq:uses-permission id="ActivityRecording"/>
+            <iq:uses-permission id="Fit"/>
             <iq:uses-permission id="FitContributor"/>
         </iq:permissions>
         <iq:languages>
             <iq:language>eng</iq:language>


Good. Now I should tell the user to try again. Also update the v1 manifest maybe? But the user is only building fēnix 5 now, so focus on that. The fēnix 3 manifest used the old-style `<iq:permission id="ActivityRecording"/>` which may have been valid for older SDK/manifest format. We don't need to change that unless asked.

I should give the user the command to re-run and explain what changed.

Fixed the permission IDs in `manifest_fenix5.xml`:

```xml
<iq:permissions>
    <iq:uses-permission id="Sensor"/>
    <iq:uses-permission id="Fit"/>
    <iq:uses-permission id="FitContributor"/>
</iq:permissions>
```

- `Fit` = required for `Toybox.ActivityRecording`
- `FitContributor` = required for `Toybox.FitContributor`
- `Sensor` = required for `Toybox.Sensor`

Now re-run:

```bash
cd ~/garmin-freedive-app
./build_fenix5.sh
```

Let me know what it prints next.


❯ ./build_fenix5.sh
Building for fenix5plus...
ERROR: A launcher icon must be specified in the application manifest.
ERROR: Failed to build for fenix5plus. Make sure the fenix5plus device file is installed in the SDK Manager.


The SDK now requires a launcher icon in the manifest for newer SDK versions. We need to add a `<iq:application launcherIcon="...">` attribute or create a simple drawable/icon resource. For a sideloaded-only app, any placeholder launcher icon will do.

We need to:
1. Create a simple launcher icon resource (XML drawable or bitmap).
2. Reference it in the manifest.
3. Update resources.xml to define the drawable.

For the simplest case, we can use a simple XML drawable as the launcher icon. Or better, create a tiny bitmap. But easiest is probably to add a launcher icon attribute pointing to a drawable defined in resources.

Let me check the current resources.xml and see what format to use.


<?xml version="1.0" encoding="utf-8"?>
<resources>
    <strings>
        <string id="AppName">Freedive Breath</string>
    </strings>
</resources>


<?xml version="1.0" encoding="UTF-8"?>
<iq:manifest version="3" xmlns:iq="http://www.garmin.com/xml/connectiq">
    <iq:application entry="Fenix5App" id="b896271ba7e04e12988fd03fb8714fc4" minSdkVersion="2.4.0" type="watch-app" name="@Strings.AppName">
        <iq:products>
            <iq:product id="fenix5plus"/>
        </iq:products>
        <iq:permissions>
            <iq:uses-permission id="Sensor"/>
            <iq:uses-permission id="Fit"/>
            <iq:uses-permission id="FitContributor"/>
        </iq:permissions>
        <iq:languages>
            <iq:language>eng</iq:language>
        </iq:languages>
    </iq:application>
</iq:manifest>