Why This Extension is not Compiling?

I was checking how YailList works and that's why I wrote this simple code on returning the same list user gives but the compiling is failing.Am i doing anything wrong?

Build Log:
Buildfile: /projects/goldv2/appinventor-sources/appinventor/build.xml

extensions:

clean:

init:

common_CommonUtils:

init:

CommonUtils:

common_CommonVersion:

init:

CommonVersion:
[exec] Result: 128
[exec] Result: 128

CopyToRunLibDir:

components_AndroidRuntime:

init:

CommonConstants:
[javac] Compiling 6 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/CommonConstants
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning

HtmlEntities:
[javac] Compiling 1 source file to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/HtmlEntities
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning

common_CommonVersion:

init:

CommonVersion:
[exec] Result: 128
[exec] Result: 128

AndroidRuntime:
[javac] Compiling 332 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:35: error: lambda expressions are not supported in -source 1.7
[javac] public YailList TestList=(YailList list){
[javac] ^
[javac] (use -source 8 or higher to enable lambda expressions)
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:37: error: ';' expected
[javac] }
[javac] ^
[javac] 2 errors
[javac] 1 warning

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:35: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:372: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:141: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:118: Compile failed; see the compiler error output for details.

Total time: 2 seconds
1 warning
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/components/build/HtmlEntities.jar

common_CommonVersion:

init:

CommonVersion:
[exec] Result: 128
[exec] Result: 128

AndroidRuntime:
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] Compiling 332 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:35: error: lambda expressions are not supported in -source 1.7
[javac] public YailList TestList=(YailList list){
[javac] ^
[javac] (use -source 8 or higher to enable lambda expressions)
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:37: error: ';' expected
[javac] }
[javac] ^
[javac] 2 errors
[javac] 1 warning

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:35: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:372: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:141: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:118: Compile failed; see the compiler error output for details.

Total time: 2 seconds

There's no need to put = in public YailList TestList=(YailList list) {

\Oh Okay.. can i do all arrays function of java in YailList??

See here-
https://www.w3schools.com/java/java_arraylist.asp

thankyou....

Still error;
My Code:
image

Build Log:
Buildfile: /projects/goldv2/appinventor-sources/appinventor/build.xml

extensions:

clean:
[delete] Deleting directory /projects/goldv2/appinventor-sources/appinventor/components/build

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:34: The following error [delete] Deleting directory /projects/goldv2/appinventor-sources/appinventor/components/reports

init:

common_CommonUtils:

init:

CommonUtils:

common_CommonVersion:

init:

CommonVersion:
[exec] Result: 128
[exec] Result: 128

CopyToRunLibDir:

components_AndroidRuntime:

init:
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/build/components
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build/classes
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/reports
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/reports/raw
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/reports/html

CommonConstants:
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build/classes/CommonConstants
[javac] Compiling 6 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/CommonConstants
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[javac] Creating empty /projects/goldv2/appinventor-sources/appinventor/components/build/classes/CommonConstants/com/google/appinventor/components/common/package-info.class
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/build/components/CommonConstants.jar
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/build/components/CommonConstants-gwt.jar

HtmlEntities:
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build/classes/HtmlEntities
[javac] Compiling 1 source file to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/HtmlEntities
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] 1 warning
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/components/build/HtmlEntities.jar

common_CommonVersion:

init:

CommonVersion:
[exec] Result: 128
[exec] Result: 128

AndroidRuntime:
[mkdir] Created dir: /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] Compiling 332 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/AndroidRuntime
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:35: error: cannot find symbol
[javac] public YailList TestList (YailList list){
[javac] ^
[javac] symbol: class YailList
[javac] location: class TestProject
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:35: error: cannot find symbol
[javac] public YailList TestList (YailList list){
[javac] ^
[javac] symbol: class YailList
[javac] location: class TestProject
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/hsiajwo/TestProject/TestProject.java:36: error: cannot find symbol
[javac] return YailList;
[javac] ^
[javac] symbol: variable YailList
[javac] location: class TestProject
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 3 errors
[javac] 1 warning

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:35: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:372: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:141: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/build-common.xml:118: Compile failed; see the compiler error output for details.

Total time: 4 seconds

Can you show the whole code....

/** ~~~~~

  • Created with the AppyBuilder Code Editor.
  • This is a template for basic Extension.
  • Modify this template to customize your extension.
  • **** NOTE: DO NOT use a package name.
  • **** The package name will be created for you automatically.
  • **** Adding a package name will cause a compile error
    /
    import android.content.Context;
    import android.util.Log;
    import com.google.appinventor.components.annotations.
    ;
    import com.google.appinventor.components.runtime.*;
    import com.google.appinventor.components.common.ComponentCategory;

@DesignerComponent(version = 1, description = "This Extension was created with the AppyBuilder Code Editor.
" +
"Create your own here:
https://editor.appybuilder.com
",
category = ComponentCategory.EXTENSION,
nonVisible = true, iconName = "http://appyBuilder.com/extensions/icons/extension.png")
@SimpleObject(external = true)
public class TestProject extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
* @param container container, component will be placed in
*/
public TestProject(ComponentContainer container) {
super(container.$form());
this.container = container;
}

@SimpleFunction(description = "Test return same list to user")

public YailList test(YailList yourList){
return yourList;
}

}

You're missing imports.

What should i have to import hmm?/

import com.google.appinventor.components.runtime.util.YailList;
is it this>.

2 Likes

Please import this-

import com.google.appinventor.components.runtime.util.YailList;
import java.util.ArrayList;
2 Likes

Okay i will try.

1 Like

Hi @oseamiya
It seems you are missing the basics of java so better will be to learn some beginner level java.

5 Likes

Yes, @vknow360 is right.
You can get more information here - Java Tutorial

2 Likes

Udemy has some better tutorials.
https://www.udemy.com/course/learn-android-application-development-y/
https://www.udemy.com/course/practical-java-course/

4 Likes

@oseamiya Is your problem solved?

It should be.

Use:-

@SimpleFunction(description = "")
public void Testlist(your inputs){
// code here
}

What that even does?

1 Like