I am trying to create schema templete for recylerview extension but occurring the following error com.google.appinventor.components.runtime.CardView

this is my schema templete
{ “name”: “Updated CardView Schema”, “metadata-version”: 1, “author”: “JEWEL”, “platforms”: [ “Niotron” ], “extensions”: {}, “keys”: , “components”: [ { “id”: “MAIN_CONTAINER”, “type”: “VerticalArrangement”, “properties”: { “AlignHorizontal”: 3, “AlignVertical”: 2, “Width”: -2 }, “components”: [ { “id”: “INDEX_LABEL”, “type”: “Label”, “properties”: { “FontSize”: 16, “FontTypeface”: 0, “Text”: “0”, “TextColor”: -16777216 } }, { “id”: “CARD_FOR_TEXT_BOX”, “type”: “CardView”, “properties”: { “AlignHorizontal”: 3, “AlignVertical”: 2, “ContentPaddingBottom”: 0, “ContentPaddingLeft”: 0, “ContentPaddingRight”: 0, “ContentPaddingTop”: 0, “CornerRadius”: 10, “Elevation”: 2, “Width”: -2, “StrokeColor”: -6381922, “StrokeWidth”: 2, “Clickable”: false, “FullClickable”: false, “RippleEnabled”: false, “Visible”: true }, “components”: [ { “id”: “TEXT_BOX”, “type”: “TextBox”, “properties”: { “BackgroundColor”: 1048575, “FontSize”: 18, “FontTypeface”: 0, “Width”: -2, “Hint”: “0”, “HintColor”: -3355444, “InputType”: 5, “TextAlignment”: 1, “TextColor”: -16777216 } } ] } ] } ] }

in this Place use

NiotronCardView

I thing just confirm by dragging cardview in workplace and see properties that’s it.

2 Likes

I tried with NiotronCardView by doing so I got an undefined error and the app crushed.

Remove key array

use this JSON tool JSON Editor Online: edit JSON, format JSON, query JSON
select keys array right click and delete.

Example Native Ad code

{
  "name": "Schema_for_native_ad",
  "metadata-version": 1,
  "author": "kaps2",
  "platforms": [
    "builder.niotron.com"
  ],
  "extensions": {},
  "components": [
    {
      "id": "Card_View1",
      "type": "NiotronCardView",
      "properties": {
        "CompatPadding": true,
        "ContentPaddingLeft": 0,
        "ContentPaddingTop": 0,
        "Width": -2,
        "Radius": 4
      },
      "components": [
        {
          "id": "Label1",
          "type": "Label",
          "properties": {
            "BackgroundColor": -1980664,
            "HeihMargin": "0,0,0,4",
            "HeihPadding": "2,5,0,0",
            "Text": "Ad",
            "TextColor": -1
          },
          "components": []
        },
        {
          "id": "AdvertiserView",
          "type": "VerticalArrangement",
          "properties": {
            "Width": -2
          },
          "components": [
            {
              "id": "Horizontal_Arrangement1",
              "type": "HorizontalArrangement",
              "properties": {
                "AlignVertical": 2,
                "Width": -2
              },
              "components": [
                {
                  "id": "IconView",
                  "type": "Image",
                  "properties": {
                    "Height": 50,
                    "Width": 50,
                    "HeihMargin": "10,0,0,0",
                    "Picture": "admaner.jpg"
                  },
                  "components": []
                },
                {
                  "id": "Spacer1",
                  "type": "Spacer",
                  "properties": {
                    "Height": -2,
                    "Width": 10
                  },
                  "components": []
                },
                {
                  "id": "Vertical_Arrangement1",
                  "type": "VerticalArrangement",
                  "properties": {},
                  "components": [
                    {
                      "id": "HeadlineView",
                      "type": "Label",
                      "properties": {
                        "Text": "Test ad Ad_title"
                      },
                      "components": []
                    },
                    {
                      "id": "Store_view",
                      "type": "Label",
                      "properties": {
                        "Text": "Test ad"
                      },
                      "components": []
                    },
                    {
                      "id": "Price_view",
                      "type": "Label",
                      "properties": {
                        "Text": "Price view"
                      },
                      "components": []
                    }
                  ]
                }
              ]
            },
            {
              "id": "Advertiserviewlable",
              "type": "Label",
              "properties": {
                "Text": "Text for Label2"
              },
              "components": []
            },
            {
              "id": "Bodyview",
              "type": "Label",
              "properties": {
                "Text": "Text for Label2"
              },
              "components": []
            },
            {
              "id": "Media_container",
              "type": "HorizontalArrangement",
              "properties": {
                "AlignHorizontal": 3,
                "AlignVertical": 2,
                "Width": -2
              },
              "components": []
            }
          ]
        },
        {
          "id": "CallToActionView",
          "type": "Button",
          "properties": {
            "BackgroundColor": -14540833,
            "FontBold": true,
            "FontSize": 15,
            "Width": -2,
            "Text": "Action",
            "TextColor": -1
          },
          "components": []
        }
      ]
    }
  ]
}

Actually error occuring for cardview
When I remove Cardview and it’s properties then it’s work

@Nidanpur_Teer that means your problem is solved??

@Nidanpur_Teer what error are you exactly getting share the logs.