Appybuildercode editor


#1

@SimpleFunction(description = “Get List Length”)
public String GetLengthofList(String [] list) {
return list.length;
whole compiling this code it get error cannot set int to string
whats wrongs


#2

Because you are defining return-type as String, but your method is returning integer


#3

then how to do it?
i cant understand because thats the official way to get length


#4

i also tried with int but it gave error something related to int and yail


#5

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:

common_CommonVersion:

init:

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

AndroidRuntime:
[javac] Compiling 331 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] 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] 1 warning
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/build/components/AndroidRuntime.jar

components_Barcode:

Barcode:

components_ComponentList:

init:

CommonConstants:

ComponentProcessingLib:

HtmlEntities:

common_CommonUtils:

init:

CommonUtils:

AnnotationProcessors:

common_CommonVersion:

init:

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

AndroidRuntime:
[javac] Compiling 15 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] 1 warning

Barcode:

ComponentList:
[javac] Compiling 306 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/ComponentList
[javac] warning: No SupportedSourceVersion annotation found on com.google.appinventor.components.scripts.ComponentListGenerator, returning RELEASE_6.
[javac] warning: Supported source version ‘RELEASE_6’ from annotation processor ‘com.google.appinventor.components.scripts.ComponentListGenerator’ less than -source ‘1.8’
[javac] Note: Wrote file file:/projects/goldv2/appinventor-sources/appinventor/components/build/classes/ComponentList/simple_components.txt
[javac] Note: Wrote file file:/projects/goldv2/appinventor-sources/appinventor/components/build/classes/ComponentList/simple_components_build_info.json
[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] 2 warnings

BuildServer:
[jar] error while reading original manifest in file: /projects/goldv2/appinventor-sources/appinventor/buildserver/build/run/lib/BuildServer.jar due to error in opening zip file
[jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/buildserver/build/run/lib/BuildServer.jar

init:

CommonConstants:

HtmlEntities:

common_CommonVersion:

init:

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

AndroidRuntime:
[javac] Compiling 15 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] 1 warning

ComponentProcessingLib:

common_CommonUtils:

init:

CommonUtils:

AnnotationProcessors:

JsonComponentDescription:
[javac] Compiling 306 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/JsonComponentDescription
[javac] warning: No SupportedSourceVersion annotation found on com.google.appinventor.components.scripts.ComponentDescriptorGenerator, returning RELEASE_6.
[javac] warning: Supported source version ‘RELEASE_6’ from annotation processor ‘com.google.appinventor.components.scripts.ComponentDescriptorGenerator’ less than -source ‘1.8’
[javac]
[javac]
[javac] An annotation processor threw an uncaught exception.
[javac] Consult the following stack trace for details.
[javac] java.lang.RuntimeException: Cannot convert Java type ‘int[]’ to Yail type
[javac] at com.google.appinventor.components.scripts.ComponentProcessor.javaTypeToYailType(ComponentProcessor.java:1494)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputParameters(ComponentDescriptorGenerator.java:234)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputBlockMethod(ComponentDescriptorGenerator.java:213)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputComponent(ComponentDescriptorGenerator.java:130)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputResults(ComponentDescriptorGenerator.java:252)
[javac] at com.google.appinventor.components.scripts.ComponentProcessor.process(ComponentProcessor.java:826)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:802)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184)
[javac] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:523)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:381)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:370)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:361)
[javac] at com.sun.tools.javac.Main.compile(Main.java:56)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:58)
[javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1160)
[javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:936)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:435)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[javac] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[javac] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:435)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[javac] at org.apache.tools.ant.Main.runBuild(Main.java:853)
[javac] at org.apache.tools.ant.Main.startAnt(Main.java:235)
[javac] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
[javac] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:36: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:461: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:306: Compile failed; see the compiler error output for details.

Total time: 38 seconds
ption
[javac] Compiling 306 source files to /projects/goldv2/appinventor-sources/appinventor/components/build/classes/JsonComponentDescription
[javac] warning: No SupportedSourceVersion annotation found on com.google.appinventor.components.scripts.ComponentDescriptorGenerator, returning RELEASE_6.
[javac] warning: Supported source version ‘RELEASE_6’ from annotation processor ‘com.google.appinventor.components.scripts.ComponentDescriptorGenerator’ less than -source ‘1.8’
[javac]
[javac]
[javac] An annotation processor threw an uncaught exception.
[javac] Consult the following stack trace for details.
[javac] java.lang.RuntimeException: Cannot convert Java type ‘int[]’ to Yail type
[javac] at com.google.appinventor.components.scripts.ComponentProcessor.javaTypeToYailType(ComponentProcessor.java:1494)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputParameters(ComponentDescriptorGenerator.java:234)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputBlockMethod(ComponentDescriptorGenerator.java:213)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputComponent(ComponentDescriptorGenerator.java:130)
[javac] at com.google.appinventor.components.scripts.ComponentDescriptorGenerator.outputResults(ComponentDescriptorGenerator.java:252)
[javac] at com.google.appinventor.components.scripts.ComponentProcessor.process(ComponentProcessor.java:826)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:802)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:713)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1043)
[javac] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1184)
[javac] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:523)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:381)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:370)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:361)
[javac] at com.sun.tools.javac.Main.compile(Main.java:56)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:58)
[javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1160)
[javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:936)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:396)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:435)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[javac] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[javac] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[javac] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[javac] at java.lang.reflect.Method.invoke(Method.java:498)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[javac] at org.apache.tools.ant.Task.perform(Task.java:348)
[javac] at org.apache.tools.ant.Target.execute(Target.java:435)
[javac] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[javac] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[javac] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[javac] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[javac] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[javac] at org.apache.tools.ant.Main.runBuild(Main.java:853)
[javac] at org.apache.tools.ant.Main.startAnt(Main.java:235)
[javac] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:285)
[javac] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:112)

BUILD FAILED
/projects/goldv2/appinventor-sources/appinventor/build.xml:36: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:461: The following error occurred while executing this line:
/projects/goldv2/appinventor-sources/appinventor/components/build.xml:306: Compile failed; see the compiler error output for details.

Total time: 36 seconds


#6

You can’t use String array; use YailList


#7

yail list Whats that i still dont know about it can you give demo code for it please


#8

this error is with int while i use int


#9

help me with yail list source code


#10

This may help:


#11

Thanks I Really Got Help From It Regarding Yail list
Now i understood
But now one question that i need to into array list for length or there’s already a function in yail list


#12

size should work:


#13

public int size() {
return super.size() - 1;
}
super is list name?


#14

Thanks for Help Now I an fully Done


#16

its not working when i tried today


#17

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
    */

    BUILD FAILED

    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/krishjha07/ListTools/ListTools.java:37: error: cannot find symbol
    [javac] return list.size;
    [javac] ^
    [javac] symbol: variable size

Total time: 4 seconds

I Cant Understand How To Use Yail List,Is There Any Available Guide For It?Or Any Post?


#18

I updated your log statement because there was too much info there. I trimmed it to show the error that you have.