Eclipse ADT App stürzt wegen zu wenig Speicher ab (Denk ich) log.datei mit dabei HILFE!!

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Eclipse ADT App stürzt wegen zu wenig Speicher ab (Denk ich) log.datei mit dabei HILFE!!

    Hallo immer wenn ich meine App starte mit emulator kommt der dateifehler in der log cat:
    ich weis da gar nicht was da jetzt der springende punkt ist was alles zum abstürzen bringt könnt ihr mir weiterhelfen?



    03-18 14:39:29.396: D/skia(1337): --- allocation failed for scaled bitmap
    03-18 14:39:29.426: D/AndroidRuntime(1337): Shutting down VM
    03-18 14:39:29.426: W/dalvikvm(1337): threadid=1: thread exiting with uncaught exception (group=0xb1a63ba8)
    03-18 14:39:29.646: D/dalvikvm(1337): GC_FOR_ALLOC freed 28911K, 45% free 36554K/65536K, paused 80ms, total 89ms
    03-18 14:39:29.666: E/AndroidRuntime(1337): FATAL EXCEPTION: main
    03-18 14:39:29.666: E/AndroidRuntime(1337): Process: com.schule.hakhas, PID: 1337
    03-18 14:39:29.666: E/AndroidRuntime(1337): android.view.InflateException: Binary XML file line #332: Error inflating class <unknown>
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.schule.hakhas.TestListView.onCreateView(TestListView.java:32)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.populate(ViewPager.java:1068)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.populate(ViewPager.java:914)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1436)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:327)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2291)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.View.measure(View.java:16497)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1916)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1113)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1295)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer.doCallbacks(Choreographer.java:574)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer.doFrame(Choreographer.java:544)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Handler.handleCallback(Handler.java:733)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Handler.dispatchMessage(Handler.java:95)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.os.Looper.loop(Looper.java:136)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.app.ActivityThread.main(ActivityThread.java:5017)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Method.invokeNative(Native Method)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Method.invoke(Method.java:515)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at dalvik.system.NativeStart.main(Native Method)
    03-18 14:39:29.666: E/AndroidRuntime(1337): Caused by: java.lang.reflect.InvocationTargetException
    03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Constructor.constructNative(Native Method)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.view.LayoutInflater.createView(LayoutInflater.java:594)
    03-18 14:39:29.666: E/AndroidRuntime(1337): ... 47 more
    03-18 14:39:29.666: E/AndroidRuntime(1337): Caused by: java.lang.OutOfMemoryError
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.drawable.Drawable.cr


    Hier der Code der Main Activity:

    Java-Quellcode

    1. mport java.util.Locale;
    2. import android.app.ActionBar;import android.graphics.Color;import android.graphics.drawable.ColorDrawable;import android.os.Bundle;import android.support.v4.app.Fragment;import android.support.v4.app.FragmentActivity;import android.support.v4.app.FragmentManager;import android.support.v4.app.FragmentPagerAdapter;
    3. import android.support.v4.view.ViewPager;
    4. import android.view.Menu;import android.view.MenuItem;
    5. import android.view.View;
    6. public class MainActivity extends FragmentActivity {
    7. /** * The {@link android.support.v4.view.PagerAdapter} that will provide * fragments for each of the sections. We use a * {@link android.support.v4.app.FragmentPagerAdapter} derivative, which * will keep every loaded fragment in memory. If this becomes too memory * intensive, it may be best to switch to a * {@link android.support.v4.app.FragmentStatePagerAdapter}. */ SectionsPagerAdapter mSectionsPagerAdapter; /** * The {@link ViewPager} that will host the section contents. */ ViewPager mViewPager;
    8. public Object ObjectFragment;
    9. @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ActionBar ab = getActionBar(); ColorDrawable colorDrawable = new ColorDrawable(Color.parseColor("#33b5e5")); ab.setBackgroundDrawable(colorDrawable);
    10. // Create the adapter that will return a fragment for each of the three // primary sections of the app. mSectionsPagerAdapter = new SectionsPagerAdapter( getSupportFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager = (ViewPager) findViewById(R.id.pager); mViewPager.setAdapter(mSectionsPagerAdapter); mViewPager.setOffscreenPageLimit(4); } @Override public boolean onOptionsItemSelected(MenuItem item){ super.onOptionsItemSelected(item); switch(item.getItemId()){ case R.id.about: aboutMenuItem(); break; } return true; } private void aboutMenuItem(){ setContentView(R.layout.about); return; }
    11. @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; }
    12. /** * A {@link FragmentPagerAdapter} that returns a fragment corresponding to * one of the sections/tabs/pages. */ public class SectionsPagerAdapter extends FragmentPagerAdapter {
    13. public SectionsPagerAdapter(FragmentManager fm) { super(fm); }
    14. @Override public Fragment getItem(int position) {
    15. Fragment fragment; switch (position) { case 0: fragment = new Fragment3(); break; case 1: fragment = new TestListView(); break; case 2: fragment = new Fragment1(); break; case 3: fragment = new Fragment4(); break; default: fragment = new Fragment1(); }
    16. return fragment; }
    17. @Override public int getCount() { // Show 3 total pages. return 4; }
    18. @Override public CharSequence getPageTitle(int position) { Locale l = Locale.getDefault(); switch (position) { case 0: return getString(R.string.title_section4).toUpperCase(l); case 1: return getString(R.string.title_section1).toUpperCase(l); case 2: return getString(R.string.title_section2).toUpperCase(l); case 3: return getString(R.string.title_section3).toUpperCase(l); } return null; } }
    19. /** * A dummy fragment representing a section of the app, but that simply * displays dummy text. */ public void button (View view) { setContentView(R.layout.activity_main); return; }}
    Alles anzeigen



    Und Hier der TestListView:

    Java-Quellcode

    1. import android.os.Bundle;
    2. import android.support.v4.app.Fragment;
    3. import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;
    4. public class TestListView extends Fragment {
    5. @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    6. View root = inflater.inflate(R.layout.tabitems, container, false);
    7. return root;
    8. }}
    Alles anzeigen



    und hier der tabitem.xml file:

    Java-Quellcode

    1. <?xml version="1.0" encoding="utf-8"?><ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" >
    2. <RelativeLayout android:layout_width="match_parent" android:layout_height="wrap_content" > <ImageView android:id="@+id/icon" android:layout_width="60dp" android:layout_height="60dp" android:layout_marginLeft="4dp" android:layout_marginRight="10dp" android:layout_marginTop="4dp" android:src="@drawable/marcel" />
    3. <ImageView android:id="@+id/icon2" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon" android:layout_below="@+id/icon" android:src="@drawable/ploner" />
    4. <TextView android:id="@+id/label2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon2" android:layout_marginTop="15dp" android:layout_toRightOf="@+id/icon" android:text="@string/christian" android:textSize="20sp" android:textColor="@color/entwickler"/>
    5. <TextView android:id="@+id/label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/label2" android:layout_alignTop="@+id/icon" android:layout_marginTop="17dp" android:text="@string/marcel" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon3" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon2" android:src="@drawable/chantal" />
    6. <TextView android:id="@+id/label3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon3" android:layout_marginTop="17dp" android:layout_toRightOf="@+id/icon" android:text="@string/chantal" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon4" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon3" android:src="@drawable/taurer" />
    7. <TextView android:id="@+id/label4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon4" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/melanie" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon5" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon4" android:src="@drawable/sarah" />
    8. <TextView android:id="@+id/label5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon5" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/sarah" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon6" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon5" android:src="@drawable/nicola" />
    9. <TextView android:id="@+id/label6" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon6" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/nicola" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon7" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon6" android:src="@drawable/patricia" />
    10. <TextView android:id="@+id/label7" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon7" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/patricia" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon8" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon7" android:src="@drawable/katarina" />
    11. <TextView android:id="@+id/label8" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon8" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/katarina" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon9" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon8" android:src="@drawable/reiner" />
    12. <TextView android:id="@+id/label9" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon9" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/lukas" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon10" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon9" android:src="@drawable/karam" />
    13. <TextView android:id="@+id/label10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon10" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/karam" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon11" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon10" android:src="@drawable/johannes" />
    14. <TextView android:id="@+id/label11" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon11" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/johannes" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon12" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon11" android:src="@drawable/christina" />
    15. <TextView android:id="@+id/label12" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon12" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/christina" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon13" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon12" android:src="@drawable/maida" />
    16. <TextView android:id="@+id/label13" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon13" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/maida" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon14" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon13" android:src="@drawable/carina" />
    17. <TextView android:id="@+id/label14" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon14" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/carina" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon15" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon14" android:src="@drawable/rohrmooser" />
    18. <TextView android:id="@+id/label15" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon15" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/rohrmooser" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon16" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon15" android:src="@drawable/micheal" />
    19. <TextView android:id="@+id/label16" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon16" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/michael" android:textSize="20sp" android:textColor="@color/entwickler" /> <ImageView android:id="@+id/icon17" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon16" android:src="@drawable/david" />
    20. <TextView android:id="@+id/label17" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon17" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/david" android:textSize="20sp" android:textColor="@color/entwickler"/> <ImageView android:id="@+id/icon18" android:layout_width="60dp" android:layout_height="60dp" android:layout_alignLeft="@+id/icon2" android:layout_below="@+id/icon17" android:src="@drawable/sabrina" />
    21. <TextView android:id="@+id/label18" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignTop="@+id/icon18" android:layout_marginTop="18dp" android:layout_toRightOf="@+id/icon" android:text="@string/sabrina" android:textSize="20sp" android:textColor="@color/entwickler"/> </RelativeLayout></ScrollView>
    Alles anzeigen



    Falls ihr noch irgendwas braucht einfach sagen !
    Danke im vorraus
  • Hallo,

    hm, so ganz genau sagen kann ich auch nicht was die Ursache ist.

    Der folgende Schnipsel aus dem Stacktrace:

    Caused by: java.lang.OutOfMemoryError
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587)
    03-18 14:39:29.666: E/AndroidRuntime(1337): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:422)

    lässt vermuten dass eine deiner Bitmaps sehr groß oder aber kaputt ist. Hier kann ich nur vermuten das es eines der Icons ist die du in tableitem.xml einbindest.

    MfG
    Jirka

    Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von nachdenklich ()