Error in building own extension

the error is
E:\extensions\appinventor-sources-master\appinventor\components\src\com\parmarprovisionstore\test.java:25: error: class Test is public, should be declared in a file named Test.java

and the code is

package com.parmarprovisionstore;

import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
import com.google.appinventor.components.annotations.PropertyCategory;
import com.google.appinventor.components.annotations.SimpleEvent;
import com.google.appinventor.components.annotations.SimpleFunction;
import com.google.appinventor.components.annotations.SimpleObject;
import com.google.appinventor.components.annotations.SimpleProperty;
import com.google.appinventor.components.annotations.UsesPermissions;
import com.google.appinventor.components.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.runtime.AndroidNonvisibleComponent;
import com.google.appinventor.components.runtime.ComponentContainer;


@DesignerComponent(
  version = 1,
  description = "Extension made with Kodular IDE",
  category = ComponentCategory.EXTENSION,
  nonVisible = true,
  iconName = "https://ide.kodular.io/assets/logo.png")

@SimpleObject(external = true)
public final class Test extends AndroidNonvisibleComponent {

  /**
   * Creates a new component
   */
  public Test(ComponentContainer container) {
    super(container.$form());
  }

  
  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING,
      defaultValue = "screenshot.jpg")
  @SimpleProperty
  public void FileName(String fileName) {
    this.fileName = fileName;
  }

  }

You need to rename your file from test.java to Test.java

2 Likes

Thanks @Sander for reply this error is solved now but another error in same code error is
[javac] E:\extensions\appinventor-sources-master\appinventor\components\src\com\parmarprovisionstore\Test.java:39: error: cannot find symbol [javac] this.fileName = fileName; [javac] ^ [javac] symbol: variable fileName

Do you know how to program in Java, because this is not the place to learn Java

1 Like

I know but pls

You need to create a class variable called fileName. Just read the error

1 Like

Thanks again

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.