2017-02-13 10 views
-1

私はAndroidアプリを持っています。私はAndroid Studioを使用しています。クラッシュの場所に関係のないコードを追加する前に、このアプリが動作していました。最初の数行にブレークポイントを配置します。デバッガを起動すると、最初の2行は正常に停止しますが、次の文に進む前にクラッシュします。コードのこの部分は変更されていないので、なぜクラッシュするのかという手がかりはありません。誰かが探して何かを提案することはできますか?ここで最初の文の後にAndroidプログラムがクラッシュする

protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_login); 
    // Set up the login form. 
    mEmailView = (AutoCompleteTextView) findViewById(R.id.email); 
    populateAutoComplete(); 

はXMLである:ここでは

<LinearLayout 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:gravity="center_horizontal" 
       android:orientation="vertical" 
       android:paddingBottom="@dimen/activity_vertical_margin" 
       android:paddingLeft="@dimen/activity_horizontal_margin" 
       android:paddingRight="@dimen/activity_horizontal_margin" 
       android:paddingTop="@dimen/activity_vertical_margin" 
       tools:context="com.mynt.mynt.LoginActivity"> 

    <!-- Login progress --> 
    <ProgressBar 
     android:id="@+id/login_progress" 
     style="?android:attr/progressBarStyleLarge" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_marginBottom="8dp" 
     android:visibility="gone"/> 

    <ScrollView 
     android:id="@+id/login_form" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     <LinearLayout 
      android:id="@+id/email_login_form" 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content" 
      android:orientation="vertical"> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <AutoCompleteTextView 
        android:id="@+id/email" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_email" 
        android:inputType="textEmailAddress" 
        android:maxLines="1" 
        android:singleLine="true"/> 

      </android.support.design.widget.TextInputLayout> 

      <android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <EditText 
        android:id = "@+id/EDITTEXT" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:background="@null" 
        android:editable="false" 
        android:ellipsize = "end" 
        android:cursorVisible="false" 
        android:scrollbars = 'vertical' 
        android:text = ""/> 

       <EditText 
        android:id="@+id/password" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_password" 
        android:imeActionId="@+id/login" 
        android:imeActionLabel="@string/action_sign_in_short" 
        android:imeOptions="actionUnspecified" 
        android:inputType="textPassword" 
        android:maxLines="1" 
        android:singleLine="true"/> 

      </android.support.design.widget.TextInputLayout> 

      <Button 
       android:id="@+id/email_sign_in_button" 
       style="?android:textAppearanceSmall" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:layout_marginTop="16dp" 
       android:text="@string/action_sign_in" 
       android:textStyle="bold"/> 

     </LinearLayout> 
    </ScrollView> 
</LinearLayout> 

は、Androidモニターから出力さ:

02-13 11:53:31.150 17373-17373/? E/Zygote: v2 
02-13 11:53:31.150 17373-17373/? I/libpersona: KNOX_SDCARD checking this for 10380 
02-13 11:53:31.150 17373-17373/? I/libpersona: KNOX_SDCARD not a persona 
02-13 11:53:31.160 17373-17373/? I/SELinux: Function: selinux_compare_spd_ram, index[1], SPD-policy is existed. and_ver=SEPF_SECMOBILE_6.0.1 ver=11 
02-13 11:53:31.160 17373-17373/? W/SELinux: Function: selinux_compare_spd_ram, index[1], priority [2], priority version is VE=SEPF_SECMOBILE_6.0.1_0030 
02-13 11:53:31.160 17373-17373/? E/Zygote: accessInfo : 0 
02-13 11:53:31.160 17373-17373/? W/SELinux: SELinux: seapp_context_lookup: seinfo=default, level=s0:c512,c768, pkgname=com.mynt.mynt 
02-13 11:53:31.160 17373-17373/? I/art: Late-enabling -Xcheck:jni 
02-13 11:53:31.180 17373-17373/? D/TimaKeyStoreProvider: TimaSignature is unavailable 
02-13 11:53:31.180 17373-17373/? D/ActivityThread: Added TimaKeyStore provider 
02-13 11:53:31.210 17373-17373/com.mynt.mynt W/ResourcesManager: getTopLevelResources: /data/app/com.mynt.mynt-1/base.apk/1.0 running in com.mynt.mynt rsrc of package com.mynt.mynt 
02-13 11:53:31.210 17373-17373/com.mynt.mynt I/InjectionManager: Inside getClassLibPath + mLibMap{0=, 1=} 
02-13 11:53:31.210 17373-17373/com.mynt.mynt D/ResourcesManager: For user 0 new overlays fetched Null 
02-13 11:53:31.220 17373-17373/com.mynt.mynt W/ActivityThread: Application com.mynt.mynt is waiting for the debugger on port 8100... 
02-13 11:53:31.220 17373-17373/com.mynt.mynt I/System.out: Sending WAIT chunk 
02-13 11:53:31.390 17373-17379/com.mynt.mynt I/art: Debugger is active 
02-13 11:53:31.420 17373-17373/com.mynt.mynt I/System.out: Debugger has connected 
02-13 11:53:31.420 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:31.620 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:31.820 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:32.020 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:32.220 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:32.420 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:32.620 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:32.820 17373-17373/com.mynt.mynt I/System.out: waiting for debugger to settle... 
02-13 11:53:33.020 17373-17373/com.mynt.mynt I/System.out: debugger has settled (1467) 
02-13 11:53:33.020 17373-17373/com.mynt.mynt I/InjectionManager: Inside getClassLibPath caller 
02-13 11:53:33.020 17373-17373/com.mynt.mynt W/System: ClassLoader referenced unknown path: /data/app/com.mynt.mynt-1/lib/arm64 
02-13 11:53:33.030 17373-17373/com.mynt.mynt I/InstantRun: Instant Run Runtime started. Android package is com.mynt.mynt, real application class is null. 
02-13 11:53:33.420 17373-17373/com.mynt.mynt W/System: ClassLoader referenced unknown path: /data/app/com.mynt.mynt-1/lib/arm64 
02-13 11:53:33.420 17373-17373/com.mynt.mynt D/InjectionManager: InjectionManager 
02-13 11:53:33.420 17373-17373/com.mynt.mynt D/InjectionManager: fillFeatureStoreMap com.mynt.mynt 
02-13 11:53:33.420 17373-17373/com.mynt.mynt I/InjectionManager: Constructor com.mynt.mynt, Feature store :{} 
02-13 11:53:33.420 17373-17373/com.mynt.mynt I/InjectionManager: featureStore :{} 
02-13 11:53:33.790 17373-17373/com.mynt.mynt W/ResourcesManager: getTopLevelResources: /data/app/com.mynt.mynt-1/base.apk/1.0 running in com.mynt.mynt rsrc of package com.mynt.mynt 
02-13 11:53:33.820 17373-17373/com.mynt.mynt W/ResourcesManager: getTopLevelResources: /data/app/com.mynt.mynt-1/base.apk/1.0 running in com.mynt.mynt rsrc of package com.mynt.mynt 
02-13 11:53:41.640 17373-17373/com.mynt.mynt W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable 
02-13 11:53:46.280 17373-17373/com.mynt.mynt I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead. 
02-13 11:53:46.520 17373-17373/com.mynt.mynt I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead. 
02-13 11:53:46.560 17373-17373/com.mynt.mynt D/AndroidRuntime: Shutting down VM 
02-13 11:53:46.600 17373-17373/com.mynt.mynt E/AndroidRuntime: FATAL EXCEPTION: main 
                   Process: com.mynt.mynt, PID: 17373 
                   java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mynt.mynt/com.mynt.mynt.LoginActivity}: android.view.InflateException: Binary XML file line #73: We already have an EditText, can only have one 
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254) 
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
                    at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) 
                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                    at android.os.Looper.loop(Looper.java:158) 
                    at android.app.ActivityThread.main(ActivityThread.java:7237) 
                    at java.lang.reflect.Method.invoke(Native Method) 
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
                   Caused by: android.view.InflateException: Binary XML file line #73: We already have an EditText, can only have one 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:551) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:429) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:380) 
                    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288) 
                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                    at com.mynt.mynt.LoginActivity.onCreate(LoginActivity.java:78) 
                    at android.app.Activity.performCreate(Activity.java:6876) 
                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135) 
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207) 
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)  
                    at android.app.ActivityThread.access$1100(ActivityThread.java:222)  
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)  
                    at android.os.Handler.dispatchMessage(Handler.java:102)  
                    at android.os.Looper.loop(Looper.java:158)  
                    at android.app.ActivityThread.main(ActivityThread.java:7237)  
                    at java.lang.reflect.Method.invoke(Native Method)  
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  
                   Caused by: java.lang.IllegalArgumentException: We already have an EditText, can only have one 
                    at android.support.design.widget.TextInputLayout.setEditText(TextInputLayout.java:320) 
                    at android.support.design.widget.TextInputLayout.addView(TextInputLayout.java:283) 
                    at android.view.ViewGroup.addView(ViewGroup.java:4462) 
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:856) 
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) 
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) 
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) 
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) 
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) 
                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:855) 
                    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:810) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:527) 
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:429)  
                    at android.view.LayoutInflater.inflate(LayoutInflater.java:380)  
                    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:288)  
                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)  
                    at com.mynt.mynt.LoginActivity.onCreate(LoginActivity.java:78)  
                    at android.app.Activity.performCreate(Activity.java:6876)  
                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)  
                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)  
                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)  
                    at android.app.ActivityThread.access$1100(ActivityThread.java:222)  
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)  
                    at android.os.Handler.dispatchMessage(Handler.java:102)  
                    at android.os.Looper.loop(Looper.java:158)  
                    at android.app.ActivityThread.main(ActivityThread.java:7237)  
                    at java.lang.reflect.Method.invoke(Native Method)  
                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)  
                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)  
+2

ショーを持つことができます私たちはあなたのlogcat –

+1

私たちのためにあなたのためにクラッシュstracktraceであなたのXMLファイルとlogcatを貼り付けます。 –

+1

エラーメッセージは何ですか? onCreateメソッドの最後に閉じかっこがありませんか? – Jackowski

答えて

0

私はのEditTextの任意のインスタンスを作り、次のようにコードを変更しようとします1つのTextInputLayoutに囲まれています。次のスタックトレース行があるためです。

android.view.InflateException:バイナリXMLファイルのライン#73:我々はすでにのEditTextを持っている、唯一のandroid.view.LayoutInflater.inflateで1 (LayoutInflater.java:551)

<android.support.design.widget.TextInputLayout 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content"> 

       <EditText 
        android:id = "@+id/EDITTEXT" 
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content" 
        android:background="@null" 
        android:editable="false" 
        android:ellipsize = "end" 
        android:cursorVisible="false" 
        android:scrollbars = 'vertical' 
        android:text = ""/> 
</android.support.design.widget.TextInputLayout> 

<android.support.design.widget.TextInputLayout 
      android:layout_width="match_parent" 
      android:layout_height="wrap_content"> 
       <EditText 
        android:id="@+id/password" 
        android:layout_width="match_parent" 
        android:layout_height="wrap_content" 
        android:hint="@string/prompt_password" 
        android:imeActionId="@+id/login" 
        android:imeActionLabel="@string/action_sign_in_short" 
        android:imeOptions="actionUnspecified" 
        android:inputType="textPassword" 
        android:maxLines="1" 
        android:singleLine="true"/> 
        </android.support.design.widget.TextInputLayout> 
+0

ありがとう、私はそれを試してみます。私が言ったように、私はAndroidプログラミングでは新しく、おそらく愚かな間違いを犯したでしょう。私はシスコのNexus 7000トランシーバライブラリを書いていますが、その分野の専門家ですが、JavaとXMLに関しては本当にばかげています。 – Eddy

+0

愚かさはありませんが、本当に楽しい学習曲線です。過去にあなたがしたことは、相乗効果で合っています。とにかく私がアップフォートしたいと思うなら、あなたも私の返信を受け入れることができます。希望、それはうまく動作します。 – trocchietto

+0

DELLが私のコンピュータを壊したので、それを修正するために数日待つ必要があります。 – eddyq

関連する問題