Making an extension

@ewpatton I am facing this issue while making an extension. Please help me.

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/muhammadmansuri815/Password_Textbox/Password_Textbox.java:35: error: class PasswordTextBox is public, should be declared in a file named PasswordTextBox.java
[javac] public final class PasswordTextBox extends TextBoxBase {
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:35: error: cannot find symbol
[javac] public final class PasswordTextBox extends TextBoxBase {
[javac] ^
[javac] symbol: class TextBoxBase
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:44: error: cannot find symbol
[javac] public PasswordTextBox(ComponentContainer container) {
[javac] ^
[javac] symbol: class ComponentContainer
[javac] location: class PasswordTextBox
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:61: error: cannot find symbol
[javac] public void PasswordVisible(boolean visible,AndroidViewComponent component){
[javac] ^
[javac] symbol: class AndroidViewComponent
[javac] location: class PasswordTextBox
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:48: error: cannot find symbol
[javac] view.setSingleLine(true);
[javac] ^
[javac] symbol: variable view
[javac] location: class PasswordTextBox
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:51: error: cannot find symbol
[javac] view.setTransformationMethod(new PasswordTransformationMethod());
[javac] ^
[javac] symbol: variable view
[javac] location: class PasswordTextBox
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:54: error: cannot find symbol
[javac] view.setImeOptions(EditorInfo.IME_ACTION_DONE);
[javac] ^
[javac] symbol: variable view
[javac] location: class PasswordTextBox
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:56: error: no suitable method found for PasswordVisible(boolean)
[javac] PasswordVisible(false);
[javac] ^
[javac] method PasswordTextBox.PasswordVisible(boolean,AndroidViewComponent) is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] method PasswordTextBox.PasswordVisible() is not applicable
[javac] (actual and formal argument lists differ in length)
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/muhammadmansuri815/Password_Textbox/Password_Textbox.java:63: error: cannot find symbol
[javac] View view= component.getView(); //see add this line it makes a view before u say set input
[javac] ^
[javac] symbol: class View
[javac] location: class PasswordTextBox
[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] 9 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: 7 seconds
nsuri815/Password_Textbox/Password_Textbox.java:63: error: cannot find symbol
[javac] View view= component.getView(); //see add this line it makes a view before u say set input
[javac] ^
[javac] symbol: class View
[javac] location: class PasswordTextBox
[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] 9 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: 7 seconds

Code

// make the box single line
view.setSingleLine(true);
// Add a transformation method to hide password text. This must
// be done after the SingleLine command
view.setTransformationMethod(new PasswordTransformationMethod());

// make sure the done action is Done and not Next.  See comment in Textbox.java
view.setImeOptions(EditorInfo.IME_ACTION_DONE);

PasswordVisible(false);

}

@SimpleProperty(description = "Visibility of password.")
public void PasswordVisible(boolean visible,AndroidViewComponent component){
passwordVisible=visible;
View view= component.getView(); //see add this line it makes a view before u say set input
if(visible){
view.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);
}else{
view.setInputType(InputType.TYPE_CLASS_TEXT|InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
}

/**

Specifies whether the password is hidden (default) or shown.
@return true if the password should be shown, otherwise false.
*/
@SimpleProperty(description = "Visibility of password.")
public boolean PasswordVisible(){
return passwordVisible;
}
}

Share the code for others to help

1 Like

The problem is already answered here, with a different code :

1 Like

no he pm me i said it yesterday but after only some errors gone there are still many errors

1 Like

as you said he need to change line 44 to
public final class Password_Textbox extends TextBoxBase {
but all error is on initializing view

1 Like

What are you trying to do? @Muhammad_Mansuri

1 Like

I am making Password Textbox extension.

I think what you want to do has already been made by someone else
https://community.thunkable.com/t/password-visibility-switching-passwordboxswitch-by-colintree/8182?u=taifun

https://community.thunkable.com/t/pwtboxtool-first-extension-updated/9385
https://community.appybuilder.com/t/textboxtools-extension/21007
https://community.thunkable.com/t/extension-texbox-get-change-get-cursor-position-left-char-enter/10869?u=taifun
https://community.appybuilder.com/t/textboxaddon-extension/28241?u=taifun

Maybe, but that does not means that someone can't do same work again.
It is wrong ethically but not legally.

@Muhammad_Mansuri AI2 already has same component.

1 Like

Okay, i got it :sweat_smile:

2 Likes