Please help in this error from appybuilder

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
      [jar] Building jar: /projects/goldv2/appinventor-sources/appinventor/components/build/HtmlEntities.jar

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/contact2niraj/FowizSMS/FowizSMS.java:19: error: package java.net.http does not exist
    [javac] import java.net.http.HttpClient;
    [javac]                     ^
    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/contact2niraj/FowizSMS/FowizSMS.java:20: error: package java.net.http does not exist
    [javac] import java.net.http.HttpResponse;
    [javac]                     ^
    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/contact2niraj/FowizSMS/FowizSMS.java:21: error: package java.net.http does not exist
    [javac] import java.net.http.HttpRequest;
    [javac]                     ^
    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/Web.java:22: error: cannot access HtmlEntities
    [javac] import com.google.appinventor.components.common.HtmlEntities;
    [javac]                                                ^
    [javac]   bad class file: /projects/goldv2/appinventor-sources/appinventor/components/build/HtmlEntities.jar(com/google/appinventor/components/common/HtmlEntities.class)
    [javac]     class file contains wrong class: com.squareup.picasso.Picasso
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.

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
tpResponse;
    [javac]                     ^
    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/contact2niraj/FowizSMS/FowizSMS.java:21: error: package java.net.http does not exist
    [javac] import java.net.http.HttpRequest;
    [javac]                     ^
    [javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/google/appinventor/components/runtime/Web.java:22: error: cannot access HtmlEntities
    [javac] import com.google.appinventor.components.common.HtmlEntities;
    [javac]                                                ^
    [javac]   bad class file: /projects/goldv2/appinventor-sources/appinventor/components/build/HtmlEntities.jar(com/google/appinventor/components/common/HtmlEntities.class)
    [javac]     class file contains wrong class: com.squareup.picasso.Picasso
    [javac]     Please remove or make sure it appears in the correct subdirectory of the classpath.

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 someone tell why it came
java.net.http.* is not correct?

1 Like

Your extension contains incorrect classes

so can you tell correct classed for HttpClient, HttpGet, HttpResponse

Its better if you show related code

well my question is that what are correct classes for HttpClient, HttpGet, HttpResponse still if you need code just tell me i will post

It would be better to show the code and moreover you use Extension Template. Its simple and easy to use.

actually @zainulhassan i had extension template i by mistakely deleted it so i am now using appybuilder
here is the code -

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 java.net.*;
import java.net.http.*;

@DesignerComponent(version = 1,  description = "This Extension was created with the AppyBuilder Code Editor.<br>" + 
                   "Create your own here:<br><a href='https://editor.appybuilder.com' target='_blank'>https://editor.appybuilder.com</a><br>",
        category = ComponentCategory.EXTENSION,
        nonVisible = true,   iconName = "http://appyBuilder.com/extensions/icons/extension.png")
@SimpleObject(external = true)
public class FowizSMS extends AndroidNonvisibleComponent {
    private ComponentContainer container;
    /**
     * @param container container, component will be placed in
     */
    String myPasscode = "";
    String myUsername = "";    
    String toPhoneNumber = "";
    String myMessage = "";
    public FowizSMS(ComponentContainer container) {
        super(container.$form());
        this.container = container;
    }
    @DesignerProperty
    @SimpleProperty(description = "Sets the Phone number where the SMS will go")
    public String PhoneNumber(String number) {
        this.toPhoneNumber = number;
    }
  
    @SimpleProperty(description = "Get Phone number that was saved")
    public String PhoneNumber() {
       return this.toPhoneNumber;
    }
    @DesignerProperty
    @SimpleProperty(description = "Sets the Message for the SMS")
    public String Message(String message) {
        this.myMessage = message;
    }
  
    @SimpleProperty(description = "Get Message that was saved")
    public String Message() {
       return this.myMessage;
    }
    @DesignerProperty
    @SimpleProperty(description = "Sets the Username")
    public String Username(String username) {
        this.myUsername = username;
    }
  
    @SimpleProperty(description = "Get Username that was saved")
    public String Username() {
       return this.myUsername;
    }
    @DesignerProperty
    @SimpleProperty(description = "Sets the Passcode")
    public String Passcode(String passcode) {
        this.myPasscode = passcode;
    }
  
    @SimpleProperty(description = "Get Passcode that was saved")
    public String Passcode() {
       return this.myPasscode;
    }
    @SimpleFunction(description = "Sends SMS")
    public void Send() {
      HttpClient client = new DefaultHttpClient();
    HttpGet request = new HttpGet(HTTP_API + "?username="+this.myUsername+
            "&phonenumber="+this.toPhoneNumber
    +"&message="+this.myMessage+"&passcode="+this.myPasscode);
    HttpResponse response = client.execute(request);

    BufferedReader rd = new BufferedReader
      (new InputStreamReader(response.getEntity().getContent()));

    String line = "";
    StringBuffer response = new StringBuffer();
    while ((line = rd.readLine()) != null) {
              response.append(line);
    }   
    }
}

everyone pls dont use this code to make extension pls!!

I think you need to use another package:
import android.net.http.*

1 Like

Somebody told me its better to ask this type of questions in MIT APP INVENTOR COMMUNITY .

Have you tried to load image in your extension?

1 Like

you can see the code i have only set the default appybuilder icon

If you want to get the request of url then i can help you

well i just need the correct classes for HttpClient, HttpGet and HttpResponse

really really thanks @Django_s_Android_App it worked but it is only for HttpClient