Soru & Cevap

Activity Başlatılamadı Hatası!!!

12.03.2016 - 05:26

Arkadaşlar uygulamam API 21 yani lollipop ve üzeri sürümlerde iyi çalışıyor fakat anasayfa diye bir bölüm var drawer menü vs var 4.4.4 yani API 19 da çalıştırdığım zaman Anasayfa dışında hepsi normal buna tıklayınca sapıtıyor ve çöküyor uygulama bu hata xml yapısındaki bir hatadan kaynaklanıyor fakat ben çözemedim yapıyı ve logchat çıktısını atayım belki bilen bir arkadaş olur..

<?xml version="1.0" encoding="utf-8"?>
<!--suppress ALL -->
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:transitionName="content"
    android:clipChildren="false"
    tools:context=".activity.MainActivity">


    <include layout="@layout/toolbar"/>




    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/layoutId">
    </LinearLayout>



    <android.support.v4.widget.DrawerLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/drawer_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        
        <FrameLayout
            android:id="@+id/frame_container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:visibility="gone">

            <RelativeLayout
                android:id="@+id/nonVideoLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

            <android.support.v4.widget.SwipeRefreshLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/swipeContainer"
                android:layout_width="match_parent"
                android:layout_height="match_parent">

                <info.androidhive.uygulamam.activity.VideoEnabledWebView
                    android:id="@+id/webview1"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:visibility="visible"
                    />

            </android.support.v4.widget.SwipeRefreshLayout>

        </RelativeLayout>

            
            <RelativeLayout
                android:id="@+id/videoLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent" >

            </RelativeLayout>

            <include layout="@layout/fab"/>

            <TextView
                android:id="@+id/tv"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textSize="44sp" />

        </FrameLayout>


        <FrameLayout
            android:visibility="gone"
            android:id="@+id/msg_layout"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">



            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/imageView2"
                android:background="@drawable/hata"
                android:layout_gravity="fill"
                android:contentDescription=""
                tools:ignore="ContentDescription" />


        </FrameLayout>

        
        BURASI LİSTEDEKİ MENÜ ÖĞELERİNİ VE LİSTEYİ DÜZENLEME KISMI-->

        <ExpandableListView
            android:id="@+id/explist_slidermenu"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="start"
            android:choiceMode="multipleChoice"
            android:divider="@color/selector2normal"
            android:dividerHeight="0dp"
            android:listSelector="@drawable/list_selector"
            android:background="@drawable/rounded_background"
            />


        <fragment
            android:id="@+id/fragment_navigation_drawer"
            android:name="info.androidhive.uygulamam.activity.FragmentDrawer"
            android:layout_width="@dimen/nav_drawer_width"
            android:layout_height="match_parent"
            android:layout_gravity="end"
            app:layout="@layout/fragment_navigation_drawer"
            tools:layout="@layout/fragment_navigation_drawer" />

    </android.support.v4.widget.DrawerLayout>







</LinearLayout>

Buda LogChat Çıktısı "java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute." yani "
Bir layout_width niteliğini sağlamanız gerekir." diyor burdaki problem ne arkadaşlar kafayı yicem lütfen biri yardım etsin bana :/

 

03-12 10:22:26.185 19856-19856/info.androidhive.uygulamam E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                Process: info.androidhive.uygulamam, PID: 19856
                                                                                java.lang.RuntimeException: Unable to start activity ComponentInfo{info.androidhive.uygulamam/info.androidhive.uygulamam.activity.MainActivity}: java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute.
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
                                                                                    at android.app.ActivityThread.access$800(ActivityThread.java:135)
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                    at android.os.Looper.loop(Looper.java:136)
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5001)
                                                                                    at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                    at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
                                                                                    at dalvik.system.NativeStart.main(Native Method)
                                                                                 Caused by: java.lang.RuntimeException: Binary XML file line #45: You must supply a layout_width attribute.
                                                                                    at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:492)
                                                                                    at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:5948)
                                                                                    at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:6117)
                                                                                    at android.widget.RelativeLayout$LayoutParams.<init>(RelativeLayout.java:1225)
                                                                                    at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:1062)
                                                                                    at android.widget.RelativeLayout.generateLayoutParams(RelativeLayout.java:82)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:757)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                                    at android.view.LayoutInflater.parseInclude(LayoutInflater.java:814)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:745)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                                    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
                                                                                    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
                                                                                    at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
                                                                                    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                                                    at info.androidhive.uygulamam.activity.MainActivity.onCreate(MainActivity.java:232)
                                                                                    at android.app.Activity.performCreate(Activity.java:5231)
                                                                                    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
                                                                                    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
                                                                                    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) 
                                                                                    at android.app.ActivityThread.access$800(ActivityThread.java:135) 
                                                                                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 
                                                                                    at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                    at android.os.Looper.loop(Looper.java:136) 
                                                                                    at android.app.ActivityThread.main(ActivityThread.java:5001) 
                                                                                    at java.lang.reflect.Method.invokeNative(Native Method) 
                                                                                    at java.lang.reflect.Method.invoke(Method.java:515) 
                                                                                    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 
                                                                                    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 
                                                                                    at dalvik.system.NativeStart.main(Native Method) 

Şimdiden yardımlarınız için teşekkürler..

77 Görüntülenme

2 Cevap

Sitedeki sorulara cevap verebilmek için giriş yapın ya da üye olun.

picture-20055-1496837900.png
mekkem
14.03.2016 - 08:14

Java kodlarıyla alakalı bir sorun, benim de bazen başıma gelir. Java kodlarını incelemelisin.

picture-3240-1455469375.png
harunkor
12.03.2016 - 05:39

Merhaba Halit Bey, 

Aşağıdaki gibi denermisin bi bakalım ?

 line #45: 

<RelativeLayout 
    android:id="@+id/nonVideoLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">

 

 

Halit AY
12.03.2016 - 05:45
Merhaba Harun Bey bunu bende denemiştim aklıma geldi ama malesef yine aynı hatayı vermişti az önce tekrar denedim yine aynı hata nette birçok sitedeki verilen cevapları uyguladım yine aynı :/