2017-02-23 4 views
-4

テストデバイスとしてネクサスを使用しようとするたびに、アプリケーションがクラッシュし、このエラーが表示されます。どこに問題があるのか​​本当にわからない。 E/AndroidRuntime:致命的除外:メイン プロセス:com.delta.bartalk、PID:13668 java.lang.RuntimeException:アクティビティを開始できませんでした。ComponentInfo {com.delta.bartalk/com.delta.bartalk.BartalkActivity}:アンドロイド.content.res.Resources $ NotFoundException:android.appでandroid.app.ActivityThread.performLaunchActivity android.app.ActivityThread.handleLaunchActivityで(ActivityThread.java:2325) (ActivityThread.java:2387) でリソースID番号0x7f020000 .ActivityThread.access $ 800(ActivityThread.java:151) android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1303) (android.os.Handler.dispatchMessage(Handler.java:102) )でアンドロイド。 os.Looper.loop(Looper.java:135) android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(ネイティブメソッド) at java.lang.reflect.Method.invoke(Method.java:372) com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) 原因:android.content.res .Resources $ NotFoundException:リソースID#0x7f020000 android.content.res.Resources.getValue(Resources.java:1266) (android.content.res.Resources.getDrawable(Resources.java:785)) android.content .Context.getDrawable(Context.java:403) at com.android.internal.widget.ActionBarView.setIcon(ActionBa com.android.internal.policy.impl.PhoneWindow.setDefaultIcon(PhoneWindow.java:1646) でcom.android.internal.widget.ActionBarOverlayLayout.setIcon(ActionBarOverlayLayout.java:738) でrView.java:684) でアンドロイド。アプリケーション。アクティビティ。アクティビティ。アクティビティandroid.app.Activity.performCreate(Activity.java:5990)android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)の とandroid.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)の はandroidです。 app.ActivityThread.handleLaunchActivity(Activ ityThread.java:2387) android.app.ActivityThread.access $ 800(ActivityThread.java:151) (android.app.ActivityThread)$ H.handleMessage(ActivityThread.java:1303) android.os.Handler.dispatchMessage (Handler.java:102) android.os.Looper.loop(Looper.java:135) android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke (ネイティブメソッド) at java.lang.reflect.Mava.zip(0120) internal.os.ZygoteInit.main(ZygoteInit.java:698)アプリがクラッシュする何か案は?

/これは私がかなりよく分からないactivity_bartalk.xmlの先頭にエラーが*/

<FrameLayout 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="#000000" 
    tools:context=".BartalkActivity"> 

    <!-- The primary full-screen view. This can be replaced with whatever view 
     is needed to present your content, e.g. VideoView, SurfaceView, 
     TextureView, etc. --> 
    <com.delta.bartalk.AutoResizeTextView 
     android:id="@+id/fullscreen_content" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:keepScreenOn="true" 
     android:textColor="#bc7ff6" 
     android:textStyle="bold" 
     android:maxLines="2" 
     android:textSize="600sp" 
     android:gravity="center" 
     android:text="@string/bartalk" /> 

    <!-- This FrameLayout insets its children based on system windows using 
     android:fitsSystemWindows. --> 
    <FrameLayout android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     android:fitsSystemWindows="true"> 

     <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" 
      android:background="@color/black_overlay" 
      android:orientation="horizontal" 
      tools:ignore="UselessParent"> 

      <EditText android:id="@+id/input_text" 
       style="?metaButtonBarButtonStyle" 
       android:layout_width="0dp" 
       android:layout_height="wrap_content" 
       android:layout_weight="1"`` 
       android:hint="@string/what_do_you_want_to_say" /> 

     </LinearLayout> 
    </FrameLayout> 

</FrameLayout> 
+0

こんにちは。クラッシュが起こる前に何をしていたのかを少なくとも記述してください。 – FiN

+0

あなたのコードを表示してください! logcatに基づいて、BartalkActivityのoncreateメソッドに必要なリソース(ID#0x7f020000)がありません。これが私たちが読むことのできるものです。 –

+1

'Resources $ NotFoundException' ... [mcve]にコードとGradleファイルを表示 –

答えて

2

可能性がどここれはです*私はあなたの1は、IDのは、実際に不足している資源、これがかもしれないと思いますstrings.xmlファイルの文字列、dimen.xmlファイル、drawable、image。

これは、スタックトレースの4行目で見ているからのように思えるものです:すべてがその特定の活動のXMLファイルのために特別に計上されている場合

android.content.res.Resources$NotFoundException: Resource ID #0x7f020000 at 

ご確認ください。

申し訳ありませんが、編集後にスタックトレースから探していますが、Drawableが不足しているため実際にクラッシュしています。 ActionBarのドロアブルを確認してください。

+0

OPが答えを正当化するのに十分な情報を提供するまで推測してはならない。 –

+0

@ MuratK。はい、しかし、彼/彼女はあなたが実際に分析することができるスタックトレースを与えて、何がコードを乱していたかを見つける。それでも、あなたは正しいです! –

関連する問題