当前位置: 首页 > 知识库问答 >
问题:

在根项目上找不到参数[:app]的方法include()

马安邦
2023-03-14

1>失败:生成失败,出现异常。

构建失败

    null
  • 哪里出了问题:

评估根项目'BookMyTicket'时出现问题。

在根项目'BookMyTicket'上找不到参数[:app]的方法include()。

    null
`include ':app`
 `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:tools="http://schemas.android.com/tools"
               android:layout_width="match_parent"      
               android:layout_height="match_parent"
                android:background="@drawable/images"
               tools:context="gss.bookmyticket.LOGIN">
               <TextView
                android:id="@+id/fullscreen_content"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:gravity="center"
                android:keepScreenOn="true"
                android:text=" "
                android:textStyle="bold" />
               <LinearLayout
                android:id="@+id/fullscreen_content_controls"
                style="?metaButtonBarStyle"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|center_horizontal"
                tools:ignore="UselessParent" >
               </LinearLayout>
               <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="\n                             LOGIN \n"
                android:id="@+id/tTITLE"
                android:textColor="#FFFFFF"
                android:background="#009688"
                android:layout_alignParentTop="true"
                android:layout_alignParentStart="true"
                android:layout_alignParentEnd="true" />
               <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="PASSWORD"
                android:id="@+id/tPASSWORD"
                android:layout_alignTop="@+id/ePASSWORD1"
                android:layout_alignParentStart="true" />
                <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textAppearance="?android:attr/textAppearanceLarge"
                android:text="USERNAME"
                android:id="@+id/tUSERNAME"
                android:layout_centerVertical="true"
                android:layout_alignParentStart="true" />
                <EditText
                android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:inputType="textPersonName"
                android:text="  USERNAME"
                android:background="#9E9E9E"
                android:ems="10"
                android:id="@+id/eUSERNAME1"
                android:layout_alignTop="@+id/tUSERNAME"
                android:layout_alignParentEnd="true" />
                <EditText
                 android:layout_width="wrap_content"
                android:layout_height="30dp"
                android:inputType="textPassword"
                android:text="  password"
                android:ems="10"
                android:background="#9E9E9E"
                android:id="@+id/ePASSWORD1"
                android:layout_below="@+id/tUSERNAME"
                android:layout_alignParentEnd="true"
                android:layout_marginTop="37dp" />
               <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="  LOGIN   "
                android:id="@+id/bLogin"
                android:background="#0097A7"
                android:layout_alignParentBottom="true"
                android:layout_toStartOf="@+id/bRegister"
                android:layout_marginBottom="87dp" />
                <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="  REGISTER  "
                android:background="#0097A7"
                android:id="@+id/bRegister"
                android:layout_marginStart="60dp"
                android:layout_alignBottom="@+id/bLogin"
                android:layout_alignStart="@+id/ePASSWORD1" />
                </RelativeLayout>
`<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      tools:context=".MainActivity"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="#00BCD4"
      android:orientation="vertical">
      <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="USERNAME"
        android:textColor="#FFFFFF"
        android:layout_marginTop="20dp"
        android:id="@+id/tUSERNAME" />
       <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:text="enter name"
        android:ems="10"
        android:id="@+id/eUSERNAME1"
        android:textColor="#607D8B"
        android:layout_gravity="center_horizontal" />
       <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="PASSWORD"
        android:textColor="#FFFFFF"
        android:id="@+id/tPASSWORD" />
        <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/ePASSWORD1"
        android:textColor="#607D8B"
        android:text="enter password" />
        <TextView
        android:layout_width="84dp"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="EMAILID"
        android:textColor="#FFFFFF"
        android:id="@+id/tEMAILID" />
       <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textEmailAddress"
        android:ems="10"
        android:textColor="#607D8B"
        android:id="@+id/eEMAILID1"
        android:layout_gravity="center_horizontal"
        android:text="enter your emailid" />
       <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="PHNNO"
        android:textColor="#FFFFFF"
        android:id="@+id/tPHNNO" />
       <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="phone"
        android:ems="10"
        android:textColor="#607D8B"
        android:id="@+id/ePHNNO1"
        android:text="enter your phno" />
       <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:text="ADDRESS"
        android:textColor="#FFFFFF"
        android:id="@+id/tADDRESS" />
       <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPostalAddress"
        android:ems="10"
        android:textColor="#607D8B"
        android:id="@+id/eADDRESS1"
        android:layout_gravity="center_horizontal"
        android:text="enter your postal address" />
       <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall"
        android:text=" I ACCEPT TO TAKE RESPONSIBILITY FOR ANY ILLEGAL ACTIV
        ITIES .THE TICKET IS VALID FOR DATE BOOKED ONLY"
        android:id="@+id/tTEXT" />
       <CheckBox
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
        android:text="Please ,Accept TERMS AND CONDITIONS "
        android:textColor="#FFFFFF"
        android:id="@+id/checkBox"
        android:checked="false" />
       <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="  REGISTER  "
        android:textColor="#FFFFFF"
        android:id="@+id/bRegister"
        android:background="#9E9E9E"
        android:layout_gravity="center_horizontal" />
       </LinearLayout>`
`package gss.bookmyticket;
      import gss.bookmyticket.util.SystemUiHider;
      import android.annotation.TargetApi;
      import android.app.Activity;
      import android.content.Intent;
      import android.hardware.camera2.CameraCaptureSession;
      import android.os.Build;
      import android.os.Bundle;
      import android.os.Handler;
      import android.view.MotionEvent;
      import android.view.View;
      import android.widget.Button;
      import android.widget.EditText;
      import android.widget.TextView;
      import org.w3c.dom.Text;
      private SystemUiHider mSystemUiHider;
       @Override
       protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.activity_login);
         bLOGIN = (Button) findViewById(R.id.bLogin);
         bREGISTER = (Button) findViewById(R.id.bRegister);
         eUSERNAME1 = (EditText) findViewById(R.id.eUSERNAME1);
         ePASSWORD1 = (EditText) findViewById(R.id.ePASSWORD1);
         tUSERNAME =(TextView) findViewById(R.id.tUSERNAME);
         tPASSWORD=(TextView) findViewById(R.id.tPASSWORD);
         tTITLE=(TextView) findViewById(R.id.tTITLE);
         bREGISTER.setOnClickListener(this);
         final View controlsView = 
              findViewById(R.id.fullscreen_content_controls); 
           final View contentView = findViewById(R.id.fullscreen_content);               
             mSystemUiHider = SystemUiHider.getInstance
                          (this, contentView, HIDER_FLAGS);
            mSystemUiHider.setup();
            mSystemUiHider
                .setOnVisibilityChangeListener(new SystemUiHide.OnVisibility
                     ChangeListener() {
                    // Cached values.
                    int mControlsHeight;
                    int mShortAnimTime;
                    @Override
                    @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
                    public void onVisibilityChange(boolean visible) {
                        if (Build.VERSION.SDK_INT >=
                        Build.VERSION_CODES.HONEYCOMB_MR2) {
                            // If the ViewPropertyAnimator API is available
                            // (Honeycomb MR2 and later), use it to animate the
                            // in-layout UI controls at the bottom of the
                            // screen.
                            if (mControlsHeight == 0) {
                                mControlsHeight = controlsView.getHeight();
                            }
                            if (mShortAnimTime == 0) {
                                mShortAnimTime = getResources().getInteger(
                                        android.R.integer.config_shortAnimTime);
                            }
                            controlsView.animate()
                                    .translationY(visible ? 0 : mControlsHeight)
                                    .setDuration(mShortAnimTime);
                        } else {
                            // If the ViewPropertyAnimator APIs aren't
                            // available, simply show or hide the in-layout UI
                            // controls.
                            controlsView.setVisibility(visible ?
                              View.VISIBLE : View.GONE);
                        }
                        if (visible && AUTO_HIDE) {
                            // Schedule a hide().
                            delayedHide(AUTO_HIDE_DELAY_MILLIS);
                        }
                    }
                });
        // Set up the user interaction to manually show or hide the system UI.
        contentView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (TOGGLE_ON_CLICK) {
                    mSystemUiHider.toggle();
                } else {
                    mSystemUiHider.show();
                }
            }
        });
        // Upon interacting with UI controls, delay any scheduled hide()
        // operations to prevent the jarring behavior of controls going away
        // while interacting with the UI.
      }
      @Override
        public void onClick(View v) {
        switch(v.getId()){
            case R.id.bRegister:
                startActivity(new Intent(this,REGISTER.class));
                break;
        }
        }
        @Override
        protected void onPostCreate(Bundle savedInstanceState) {
        super.onPostCreate(savedInstanceState);
        // Trigger the initial hide() shortly after the activity has been
        // created, to briefly hint to the user that UI controls
        // are available.
        delayedHide(100);
        }
       /**
       * Touch listener to use for in-layout UI controls to delay hiding the
        * system UI. This is to prevent the jarring behavior of controls
         going away
       * while interacting with activity UI.
       */
        View.OnTouchListener mDelayHideTouchListener =
         newView.OnTouchListener() {
        @Override
        public boolean onTouch(View view, MotionEvent motionEvent) {
            if (AUTO_HIDE) {
                delayedHide(AUTO_HIDE_DELAY_MILLIS);
            }
            return false;
        }
        };
        Handler mHideHandler = new Handler();
        Runnable mHideRunnable = new Runnable() {
          @Override
           public void run() {
            mSystemUiHider.hide();
        }
        };
        /**
        * Schedules a call to hide() in [delay] milliseconds, canceling any
        * previously scheduled calls.
        */
       private void delayedHide(int delayMillis) {
        mHideHandler.removeCallbacks(mHideRunnable);
        mHideHandler.postDelayed(mHideRunnable, delayMillis);
       }
       }`
 `package gss.bookmyticket;
       import android.content.Intent;
       import android.support.v7.app.ActionBarActivity;
       import android.os.Bundle;
       import android.view.Menu;
       import android.view.MenuItem;
       import android.view.View;
       import android.widget.Button;
       import android.widget.CheckBox;
       import android.widget.EditText;
       import android.widget.TextView;
        public class REGISTER extends ActionBarActivity implements
        View.OnClickListener {
        Button bREGISTER;
        EditText eUSERNAME1, ePASSWORD1, eADDRESS1, ePHNNO1;
        TextView tUSERNAME, tPASSWORD, tTEXT, tADDRESS, tPHNNO;
        CheckBox checkBox;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        bREGISTER = (Button) findViewById(R.id.bRegister);
        eUSERNAME1 = (EditText) findViewById(R.id.eUSERNAME1);
        ePASSWORD1 = (EditText) findViewById(R.id.ePASSWORD1);
        eADDRESS1 = (EditText) findViewById(R.id.eADDRESS1);
        ePHNNO1 = (EditText) findViewById(R.id.ePHNNO1);
        tUSERNAME = (TextView) findViewById(R.id.tUSERNAME);
        tPASSWORD = (TextView) findViewById(R.id.tPASSWORD);
        tADDRESS = (TextView) findViewById(R.id.tADDRESS);
        tPHNNO = (TextView) findViewById(R.id.tPHNNO);
        tTEXT = (TextView) findViewById(R.id.tTEXT);
        checkBox = (CheckBox) findViewById(R.id.checkBox);
        bREGISTER.setOnClickListener(this);
       }

共有1个答案

韶英达
2023-03-14

您可能应该删除冒号(':'),查看Gradle UserGuide中的多项目构建示例。如果将项目作为depedency包含,则使用冒号。

 类似资料: