Can't build .java file into .aix file

Hello,
I wrote my first java project and try to build it as app inventor extension using the extension template, when I run the "ant" command it shows "BUILD SUCCESSFUL" but the out folder is empty and it doesn't show an extension was built, can you help me with this issue? this is the log:

C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension>ant clean
ANT_OPTS is set to  -Djava.security.manager=allow
Buildfile: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build.xml

clean:
   [delete] Deleting directory C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build
   [delete] Deleting directory C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\out

BUILD SUCCESSFUL
Total time: 0 seconds

C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension>ant
ANT_OPTS is set to  -Djava.security.manager=allow
Buildfile: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build.xml

javac.helpers:
    [mkdir] Created dir: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build\classes

javac:
    [javac] Compiling 2 source files to C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build\classes
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 7
    [javac] Note: Wrote file file:///C:/Users/waltersr/OneDrive%20-%20Wentworth%20Institute%20of%20Technology/Documents/Classes/senior%20project/my-extension/build/classes/simple_components.json
    [javac] Note: Wrote file file:///C:/Users/waltersr/OneDrive%20-%20Wentworth%20Institute%20of%20Technology/Documents/Classes/senior%20project/my-extension/build/classes/simple_components.txt
    [javac] Note: Wrote file file:///C:/Users/waltersr/OneDrive%20-%20Wentworth%20Institute%20of%20Technology/Documents/Classes/senior%20project/my-extension/build/classes/simple_components_build_info.json
    [javac] Note: Wrote file file:///C:/Users/waltersr/OneDrive%20-%20Wentworth%20Institute%20of%20Technology/Documents/Classes/senior%20project/my-extension/build/classes/AutogeneratedOdeMessages.java
    [javac] Note: Wrote file file:///C:/Users/waltersr/OneDrive%20-%20Wentworth%20Institute%20of%20Technology/Documents/Classes/senior%20project/my-extension/build/classes/ComponentsTranslation.java
    [javac] 1 warning

process:
    [mkdir] Created dir: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\out
    [mkdir] Created dir: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build\externalComponents
    [mkdir] Created dir: C:\Users\waltersr\OneDrive - Wentworth Institute of Technology\Documents\Classes\senior project\my-extension\build\externalComponents-classes
     [java]
     [java] Extensions : Generating extensions

unjarAllExtensionLibraries:

jarAllExtensions:

dexAllExtensions:

extensions:

all:

BUILD SUCCESSFUL
Total time: 3 seconds

I tried testing it with existing extensions too and those didn't work either. If needed I can upload the extension code too.

Obviously.
Btw, did you add external= true in SimpleObject annotation?

No I didn't and I'm not really sure where to put it. Would it go under the designercomponent part?

package com.google.appinventor.components.runtime;

import com.google.appinventor.components.annotations.DesignerComponent;
import com.google.appinventor.components.annotations.DesignerProperty;
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.common.ComponentCategory;
import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.common.YaVersion;
import com.google.appinventor.components.runtime.errors.YailRuntimeError;

import java.lang.NumberFormatException;
import java.util.ArrayList;

@DesignerComponent(version = YaVersion.LABEL_COMPONENT_VERSION,
  description = "dummy object for alarm and location data",
  category = ComponentCategory.EXTENSION,
  nonVisible = true,
  iconName = "images/externalComponent.png")

@SimpleObject
public final class AlarmLocationObject extends AndroidNonvisibleComponent {
  private String alarmName = "";
  private String alarmAddress = "";
  private String alarmLatitude = "";
  private String alarmLongitude = "";
  private String alarmHour = "";
  private String alarmMinute = "";


  public AlarmLocationObject(ComponentContainer container) {
    super(container.$form());
  }

  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "name of the alarm")
  public void setAlarmName(String alarmName) {
    this.alarmName = alarmName;
  }

  @SimpleProperty
  public String getAlarmName() {
    return alarmName;
  }
  
  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "address of the alarm")
  public void setAlarmAddress(String alarmAddress) {
    this.alarmAddress = alarmAddress;
  }

  @SimpleProperty
  public String getAlarmAddress() {
    return alarmAddress;
  }

  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "location latitude")
  public void setAlarmLatitude(String alarmLatitude) {
    this.alarmLatitude = alarmLatitude;
  }

  @SimpleProperty
  public String getAlarmLatitude() {
    return alarmLatitude;
  }

  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "location longitude")
  public void setAlarmLongitude(String alarmLongitude) {
    this.alarmLongitude = alarmLongitude;
  }

  @SimpleProperty
  public String getAlarmLongitude() {
    return alarmLongitude;
  }

  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "alarm hour mark")
  public void setAlarmHour(String alarmHour) {
    this.alarmHour = alarmHour;
  }

  @SimpleProperty
  public String getAlarmHour() {
    return alarmHour;
  }

  @DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_STRING)
  @SimpleProperty(description = "alarm minute mark")
  public void setAlarmMinute(String alarmMinute) {
    this.alarmMinute = alarmMinute;
  }

  @SimpleProperty
  public String getAlarmMinute() {
    return alarmMinute;
  }
}

Replace with @SimpleObject(external=true)
I'll suggest you to look into some open source extensions.

thank you that worked

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