简体   繁体   English

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

[英]Could not find method include() for arguments [:app] on root project

1 >FAILURE: Build failed with an exception. 1 > FAILURE:构建失败,出现异常。

BUILD FAILED 建立失败

  • Where: 哪里:

Build file 生成文件

'C:\\Users\\Poornima\\AndroidStudioProjects\\BooKmyTicket\\settings.gradle' line: 1 'C:\\ Users \\ Poornima \\ AndroidStudioProjects \\ BooKmyTicket \\ settings.gradle'行:1

Total time: 2.629 secs 总时间:2.629秒

  • What went wrong: 什么地方出了错:

A problem occurred evaluating root project 'BooKmyTicket'. 评估根项目“ BooKmyTicket”时出现问题。

Could not find method include() for arguments [:app] on root project 'BooKmyTicket'. 在根项目'BooKmyTicket'上找不到参数[:app]的方法include()。

  • Try: Run with --stacktrace option to get the stack trace. 尝试:使用--stacktrace选项运行以获取堆栈跟踪。 Run with --info or --debug option to get more log output. 使用--info或--debug选项运行以获取更多日志输出。 Process finished with exit code 1 流程以退出代码1完成

    setting.gradle setting.gradle

`include ':app`

login.xml login.xml

  `<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> 

register.xml register.xml

 `<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>` 

login.java login.java

 `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); } }` 

register.java register.java

  `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); } 

You should probably remove the colon (':'), looking at the Multi-project build example in the Gradle userguide. 您可以通过查看Gradle用户指南中的多项目构建示例来删除冒号(':')。 The colon is used if you include a project as depedency. 如果您将项目包含为辅,则使用冒号。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在根项目 Android Studio 上找不到 arguments [:app] 的方法 include() - Could not find method include() for arguments [:app] on root project Android Studio 在根项目上找不到参数android()的方法… - Could not find method android() for arguments … on root project 构建 gradle:找不到参数根项目“fasterDev”的方法 PackagingOptions() - Build gradle : Could not find method packagingOptions() for arguments root Project "fasterDev" Gradle-评估根项目&#39;*&#39;时发生问题。 &gt;在根项目&#39;*&#39;上找不到参数[*]的方法compile() - Gradle - A problems occurred evaluating root project '*'. > Could not find method compile() for arguments [*] on root project '*' 错误:在项目 ':app' 上找不到 arguments [目录 'libs'] 的方法 implimentation() - ERROR: Could not find method implimentation() for arguments [directory 'libs'] on project ':app' 错误:无法在项目“:app”上找到参数 [目录“libs”] 的方法实现() - ERROR: Could not find method implementation() for arguments [directory 'libs'] on project ':app' 在类型为org.gradle.api.Project的根项目&#39;..&#39;上找不到参数[build ..]的方法android() - Could not find method android() for arguments [build..] on root project '..' of type org.gradle.api.Project 错误:无法在 org.gradle.api.Project 类型的根项目上找到 arguments 的方法 install() - Error: Could not find method install() for arguments on root project of type org.gradle.api.Project Gradle 同步失败:在 android studio 上找不到根项目参数的方法 android() - Gradle sync failed: Could not find method android() for arguments on root project on android studio Android studio错误:错误:(23,0)无法在根项目上找到方法android() - Android studio error:Error:(23, 0) Could not find method android() for arguments on root project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM