What is wrong in my code
Error
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:
[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
[
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/farazfiroz2472/CustomCardView/CustomCardView.java:53: error: expected
[javac] cv.setOnClickListener(){
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/farazfiroz2472/CustomCardView/CustomCardView.java:56: error: ';' expected
[javac] public void OnClick(Object id);{
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/farazfiroz2472/CustomCardView/CustomCardView.java:56: error: ';' expected
[javac] public void OnClick(Object id);{
[javac] ^
[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: 3 seconds
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/farazfiroz2472/CustomCardView/CustomCardView.java:56: error: ';' expected
[javac] public void OnClick(Object id);{
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/farazfiroz2472/CustomCardView/CustomCardView.java:56: error: ';' expected
[javac] public void OnClick(Object id);{
[javac] ^
[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: 2 seconds
My 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 y670name 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;
import com.google.appinventor.component.runtime.HVArrangement;
@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 CustomCardView extends AndroidNonvisibleComponent {
private ComponentContainer container;
/**
* @param container container, component will be placed in
*/
public CustomCardView(ComponentContainer container) {
super(container.$form());
this.container = container;
}
@SimpleFunction
public void CreateCard(HVArrangement layout, Object Id, int radius, int padding, Color bgColor, int elevation) {
CustomCardView fl = new FrameLayout(layout);
CustomCardView cv = new CardView();
fl.add(cv);
cv.setId(id);
cv.setRadius(radius) ;
cv.setPadding(padding);
cv.setCardBackgroundColor(bgColor);
cv.setMaxCardElevation(elevation);
}
@SimpleFunction
public void AddComponent(AndroidViewComponent component);{
cv.add(component);
}
cv.setOnClickListener(){
@SimpleEvent
public void OnClick(Object id);{
EventDispatcher.dispatchEvent(this, "OnClick", id);
id = cv.get(position).getId() ;
}
}
}`