When I try to run my app on an emulator, my app comes up with an error message saying
The app has stopped unexpectedly. Please try again."
How do I fix this?
Here is my code:
Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.DOLEnterprises.GTA5Guide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name= "com.google.ads.AdActivity"
android:configChanges= "keyboard|keyboardHidden|orientation"
></activity>
<activity
android:name=".GTA5GuideActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The "Appname"Activity.java:
package com.DOLEnterprises.GTA5Guide;
import android.app.Activity;
import android.os.Bundle;
public class GTA5GuideActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads= "http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:scaleType="center"
android:src="#drawable/gtaapp" />
<com.google.ads.AdView android:id= "#+id/ad"
android:layout_width="wrap_content"
android:layout_height= "wrap_content"
ads:adUnitId= "soon"
ads:loadAdOnCreate= "a14f8315a6c11bf"
ads:adSize="BANNER"
/>
</LinearLayout>
The Logcat thing:
04-10 08:23:55.424: D/dalvikvm(224): GC freed 510 objects / 46816 bytes in 75ms
04-10 08:23:55.534: D/AndroidRuntime(224): Shutting down VM
04-10 08:23:55.534: W/dalvikvm(224): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:23:55.534: E/AndroidRuntime(224): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:23:55.554: E/AndroidRuntime(224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.os.Looper.loop(Looper.java:123)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:23:55.554: E/AndroidRuntime(224): at dalvik.system.NativeStart.main(Native Method)
04-10 08:23:55.554: E/AndroidRuntime(224): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:23:55.554: E/AndroidRuntime(224): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:23:55.554: E/AndroidRuntime(224): ... 11 more
04-10 08:23:55.554: E/AndroidRuntime(224): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca48
04-10 08:23:55.554: E/AndroidRuntime(224): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:23:55.554: E/AndroidRuntime(224): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:23:55.554: E/AndroidRuntime(224): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:23:55.554: E/AndroidRuntime(224): ... 20 more
04-10 08:23:55.584: I/dalvikvm(224): threadid=7: reacting to signal 3
04-10 08:23:55.584: E/dalvikvm(224): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-10 08:24:22.804: D/dalvikvm(231): GC freed 537 objects / 47832 bytes in 68ms
04-10 08:24:22.913: D/AndroidRuntime(231): Shutting down VM
04-10 08:24:22.913: W/dalvikvm(231): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:24:22.913: E/AndroidRuntime(231): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:24:22.933: E/AndroidRuntime(231): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.os.Looper.loop(Looper.java:123)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:24:22.933: E/AndroidRuntime(231): at dalvik.system.NativeStart.main(Native Method)
04-10 08:24:22.933: E/AndroidRuntime(231): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:24:22.933: E/AndroidRuntime(231): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:24:22.933: E/AndroidRuntime(231): ... 11 more
04-10 08:24:22.933: E/AndroidRuntime(231): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca28
04-10 08:24:22.933: E/AndroidRuntime(231): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:24:22.933: E/AndroidRuntime(231): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:24:22.933: E/AndroidRuntime(231): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:24:22.933: E/AndroidRuntime(231): ... 20 more
04-10 08:24:22.953: I/dalvikvm(231): threadid=7: reacting to signal 3
04-10 08:24:22.953: E/dalvikvm(231): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
04-10 08:24:31.884: D/dalvikvm(237): GC freed 564 objects / 48880 bytes in 92ms
04-10 08:24:31.993: D/AndroidRuntime(237): Shutting down VM
04-10 08:24:31.993: W/dalvikvm(237): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
04-10 08:24:32.003: E/AndroidRuntime(237): Uncaught handler: thread main exiting due to uncaught exception
04-10 08:24:32.023: E/AndroidRuntime(237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.DOLEnterprises.GTA5Guide/com.DOLEnterprises.GTA5Guide.GTA5GuideActivity}: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.os.Looper.loop(Looper.java:123)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.main(ActivityThread.java:4363)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.reflect.Method.invoke(Method.java:521)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-10 08:24:32.023: E/AndroidRuntime(237): at dalvik.system.NativeStart.main(Native Method)
04-10 08:24:32.023: E/AndroidRuntime(237): Caused by: android.view.InflateException: Binary XML file line #16: Error inflating class com.google.ads.AdView
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.Activity.setContentView(Activity.java:1622)
04-10 08:24:32.023: E/AndroidRuntime(237): at com.DOLEnterprises.GTA5Guide.GTA5GuideActivity.onCreate(GTA5GuideActivity.java:11)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
04-10 08:24:32.023: E/AndroidRuntime(237): ... 11 more
04-10 08:24:32.023: E/AndroidRuntime(237): Caused by: java.lang.ClassNotFoundException: com.google.ads.AdView in loader dalvik.system.PathClassLoader#44e8ca28
04-10 08:24:32.023: E/AndroidRuntime(237): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
04-10 08:24:32.023: E/AndroidRuntime(237): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
04-10 08:24:32.023: E/AndroidRuntime(237): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
04-10 08:24:32.023: E/AndroidRuntime(237): ... 20 more
04-10 08:24:32.043: I/dalvikvm(237): threadid=7: reacting to signal 3
04-10 08:24:32.043: E/dalvikvm(237): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
---EDIT---
Are you sure you have downloaded the "Ad" library and included it in your project? Class not found suggests that you have not successfully linked it to your project. Also try rebuilding your project by following the steps below .
Try cleaning your project... Project > Clean > Choose your Project > Ok
Rerun your project.
it seems that error is caused due to Typos or casting ...... Check carefully for Typos and casting ....... check for library folder name ....
check out this
android:configChanges requieres all parameters to show ads in application
change the SDK version to 14 of your Application
mention it in your AndroidManifest.xml file
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
Related
I try to run google map from this page https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
This is my
.java page
package com.findyourtaxihere.taxi;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
This is Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.findyourtaxihere.taxi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<permission
android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.my api"
android:value="my api"/>
</application>
</manifest>
my activity main
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
when run my app , it shows error like this stops unfortunately , and i'm new for android please help me !
log
02-02 19:03:54.871: I/Process(284): Sending signal. PID: 284 SIG: 9
02-02 19:04:00.491: D/AndroidRuntime(307): Shutting down VM
02-02 19:04:00.491: W/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:04:00.511: E/AndroidRuntime(307): FATAL EXCEPTION: main
02-02 19:04:00.511: E/AndroidRuntime(307): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.os.Looper.loop(Looper.java:123)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:04:00.511: E/AndroidRuntime(307): at dalvik.system.NativeStart.main(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:13)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:04:00.511: E/AndroidRuntime(307): ... 11 more
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:04:00.511: E/AndroidRuntime(307): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:04:00.511: E/AndroidRuntime(307): ... 19 more
02-02 19:09:36.841: I/dalvikvm(334): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:09:36.841: W/dalvikvm(334): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:09:36.841: D/dalvikvm(334): VFY: replacing opcode 0x6e at 0x0009
02-02 19:09:36.852: D/dalvikvm(334): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:09:36.922: D/AndroidRuntime(334): Shutting down VM
02-02 19:09:36.922: W/dalvikvm(334): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:09:36.942: E/AndroidRuntime(334): FATAL EXCEPTION: main
02-02 19:09:36.942: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.os.Looper.loop(Looper.java:123)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:09:36.942: E/AndroidRuntime(334): at dalvik.system.NativeStart.main(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:09:36.942: E/AndroidRuntime(334): ... 11 more
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:09:36.942: E/AndroidRuntime(334): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:09:36.942: E/AndroidRuntime(334): ... 19 more
02-02 19:09:40.241: I/Process(334): Sending signal. PID: 334 SIG: 9
02-02 19:15:23.312: I/dalvikvm(370): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:15:23.312: W/dalvikvm(370): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:15:23.312: D/dalvikvm(370): VFY: replacing opcode 0x6e at 0x0009
02-02 19:15:23.322: D/dalvikvm(370): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:15:23.392: D/AndroidRuntime(370): Shutting down VM
02-02 19:15:23.392: W/dalvikvm(370): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:15:23.422: E/AndroidRuntime(370): FATAL EXCEPTION: main
02-02 19:15:23.422: E/AndroidRuntime(370): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.os.Looper.loop(Looper.java:123)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:15:23.422: E/AndroidRuntime(370): at dalvik.system.NativeStart.main(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:15:23.422: E/AndroidRuntime(370): ... 11 more
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:15:23.422: E/AndroidRuntime(370): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:15:23.422: E/AndroidRuntime(370): ... 19 more
02-02 19:15:26.542: I/Process(370): Sending signal. PID: 370 SIG: 9
02-02 19:18:15.771: I/dalvikvm(397): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:18:15.771: W/dalvikvm(397): VFY: unable to resolve virtual method 12506: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:18:15.771: D/dalvikvm(397): VFY: replacing opcode 0x6e at 0x0009
02-02 19:18:15.782: D/dalvikvm(397): VFY: dead code 0x000c-005e in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:18:15.821: D/AndroidRuntime(397): Shutting down VM
02-02 19:18:15.821: W/dalvikvm(397): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:18:15.851: E/AndroidRuntime(397): FATAL EXCEPTION: main
02-02 19:18:15.851: E/AndroidRuntime(397): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.os.Looper.loop(Looper.java:123)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:18:15.851: E/AndroidRuntime(397): at dalvik.system.NativeStart.main(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:20)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:18:15.851: E/AndroidRuntime(397): ... 11 more
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:18:15.851: E/AndroidRuntime(397): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:18:15.851: E/AndroidRuntime(397): ... 19 more
02-02 19:22:23.441: D/AndroidRuntime(453): Shutting down VM
02-02 19:22:23.441: W/dalvikvm(453): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:22:23.471: E/AndroidRuntime(453): FATAL EXCEPTION: main
02-02 19:22:23.471: E/AndroidRuntime(453): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.os.Looper.loop(Looper.java:123)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:22:23.471: E/AndroidRuntime(453): at dalvik.system.NativeStart.main(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:16)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:22:23.471: E/AndroidRuntime(453): ... 11 more
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:22:23.471: E/AndroidRuntime(453): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:22:23.471: E/AndroidRuntime(453): ... 19 more
02-02 19:27:23.551: I/Process(453): Sending signal. PID: 453 SIG: 9
You need to set your min SDK to 11 so the code can only be run on devices where Activity knows how to inflate fragment tags.
Or just use the v4 support library and change your activity to extend FragmentActivity.
I have created an android project on eclipse and by default it generated the basic "Hello world!" app. With minSDK api level 8 and target api level 15 and also compiled with api 19 (latest). Everything else was set on default (blank activity etc). The problem is when I'm trying to run the app on my level 15 AVD it fails and the message "Unfortunately 'app's name' has stopped" shows up. Why is this happening? Can anyone help me fix this?
catlog
04-10 15:21:17.383: W/dalvikvm(645): VFY: unable to resolve static field 1630 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
04-10 15:21:17.383: D/dalvikvm(645): VFY: replacing opcode 0x62 at 0x0004
04-10 15:21:17.392: D/AndroidRuntime(645): Shutting down VM
04-10 15:21:17.392: W/dalvikvm(645): threadid=1: thread exiting with uncaught exception (group=0x2ba041f8)
04-10 15:21:17.402: E/AndroidRuntime(645): FATAL EXCEPTION: main
04-10 15:21:17.402: E/AndroidRuntime(645): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
04-10 15:21:17.402: E/AndroidRuntime(645): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:104)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
04-10 15:21:17.402: E/AndroidRuntime(645): at com.example.asdf.MainActivity.onCreate(MainActivity.java:18)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.Activity.performCreate(Activity.java:4465)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.os.Looper.loop(Looper.java:137)
04-10 15:21:17.402: E/AndroidRuntime(645): at android.app.ActivityThread.main(ActivityThread.java:4424)
04-10 15:21:17.402: E/AndroidRuntime(645): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:21:17.402: E/AndroidRuntime(645): at java.lang.reflect.Method.invoke(Method.java:511)
04-10 15:21:17.402: E/AndroidRuntime(645): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-10 15:21:17.402: E/AndroidRuntime(645): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-10 15:21:17.402: E/AndroidRuntime(645): at dalvik.system.NativeStart.main(Native Method)
04-10 15:21:17.692: I/dalvikvm(645): threadid=3: reacting to signal 3
04-10 15:21:17.702: I/dalvikvm(645): Wrote stack traces to '/data/anr/traces.txt'
04-10 15:21:17.943: I/dalvikvm(645): threadid=3: reacting to signal 3
04-10 15:21:17.952: I/dalvikvm(645): Wrote stack traces to '/data/anr/traces.txt'
Finally found a solution... I've tried to do the exact same thing as mentioned on those links and on other tutorials but could not get it fixed. Looks like eclipse was doing this automatically (including the appcompat v7 libraries and making a reference from my project to those lib). After comparing my project files with the same project files build on another environment/computer I found out that my project was missing a package in the gen folder. I fixed it by copying the package from the gen folder of the appcompat v7 project (android.support.v7.appcompat) to the gen folder of my project.
Windows 8
eclipse kepler (latest update)
sdk (latest update)
system x32
There was not such a problem on the x64 system enviroment.
So, I am going through the Tutorial #12 and everything is working fine. I then try to go onto Tutorial #13 for Saving/Restoring Last-Read Position and the app crashes:
04-10 15:59:26.510: E/Trace(704): error opening trace file: No such file or directory (2)
04-10 15:59:27.491: D/AndroidRuntime(704): Shutting down VM
04-10 15:59:27.491: W/dalvikvm(704): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
04-10 15:59:27.500: E/AndroidRuntime(704): FATAL EXCEPTION: main
04-10 15:59:27.500: E/AndroidRuntime(704): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.commonsware.empublite/com.commonsware.empublite.EmPubLiteActivity}: java.lang.NullPointerException
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.access$600(ActivityThread.java:130)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.os.Looper.loop(Looper.java:137)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.main(ActivityThread.java:4745)
04-10 15:59:27.500: E/AndroidRuntime(704): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:59:27.500: E/AndroidRuntime(704): at java.lang.reflect.Method.invoke(Method.java:511)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-10 15:59:27.500: E/AndroidRuntime(704): at dalvik.system.NativeStart.main(Native Method)
04-10 15:59:27.500: E/AndroidRuntime(704): Caused by: java.lang.NullPointerException
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.executeAsyncTask(ModelFragment.java:51)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.deliverModel(ModelFragment.java:38)
04-10 15:59:27.500: E/AndroidRuntime(704): at com.commonsware.empublite.ModelFragment.onActivityCreated(ModelFragment.java:29)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:891)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1080)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1416)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:505)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.Activity.performStart(Activity.java:5018)
04-10 15:59:27.500: E/AndroidRuntime(704): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032)
04-10 15:59:27.500: E/AndroidRuntime(704): ... 11 more
I tried to comment out the code I did until the last point that it was working, but that didn't seem to work. I am not really sure how to read this stack trace either. What should I be looking at to fix this problem?
Thanks.
I am not really sure how to read this stack trace either. What should I be looking at to fix this problem?
Line 51 of ModelFragment.java, in the executeAsyncTask() method is where you are crashing (see last stack trace stanza, starting with Caused by: java.lang.NullPointerException).
Your line numbers and those in the answers are not completely lining up. However, the only way executeAsyncTask() could have a NullPointerException is if the AsyncTask you are passing in is null, and that should not be possible as you define those tasks immediately before calling executeAsyncTask() in the deliverModel() method. Perhaps you missed a line in deliverModel().
Hi i create one application which is depend on TextToSpeech. When i am trying to run my
application It show the NullPointerException in Logcat. i search lot but didn't find helpful Answer.Here Check my Code on this link and Here is my logcat.
04-10 15:11:37.872: WARN/System.err(2798): java.lang.NullPointerException
04-10 15:11:37.872: WARN/System.err(2798): at com.example.examguide.ExamAppearingActivity.onCreate(ExamAppearingActivity.java:80)
04-10 15:11:37.872: WARN/System.err(2798): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 15:11:37.882: WARN/System.err(2798): at android.os.Looper.loop(Looper.java:123)
04-10 15:11:37.882: WARN/System.err(2798): at android.app.ActivityThread.main(ActivityThread.java:3683)
04-10 15:11:37.882: WARN/System.err(2798): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 15:11:37.892: WARN/System.err(2798): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-10 15:11:37.892: WARN/System.err(2798): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-10 15:11:37.892: WARN/System.err(2798): at dalvik.system.NativeStart.main(Native Method)
Any help is Appreciated...
you have used this code.
final List<ObjectiveWiseQuestion> QuestionWiseProfile1= db.getOneQuestion(examId);
but you have not opened db before. So it is getting null.
ok write
tts = new TextToSpeech(this, this);
before you use tts object.
The tts object is not initialized. Hence you get a null pointer exception there.
For reasons with which I won't bore you, I have to change development computers, and for the life of me I can't get my project to work on the second machine.
I have one library which is a .jar file which both machine have access to. But the program works fine on machine A but on machine B I get the errors below. At first I thought check the manifest, but, exactly the same project works fine on Machine A. So it must be something wrong with my development environment on B. Right? I can't think what it might be. I've got more apis on B than A.
04-10 20:21:50.826: W/dalvikvm(1487): Unable to resolve superclass of Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity; (117)
04-10 20:21:50.826: W/dalvikvm(1487): Link of class 'Lcom/webs/thefineanimationemporium/BoxingTmcthreeActivity;' failed
04-10 20:21:50.826: D/AndroidRuntime(1487): Shutting down VM
04-10 20:21:50.826: W/dalvikvm(1487): threadid=1: thread exiting with uncaught exception (group=0x2aac8578)
04-10 20:21:50.856: E/AndroidRuntime(1487): FATAL EXCEPTION: main
04-10 20:21:50.856: E/AndroidRuntime(1487): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.webs.thefineanimationemporium/com.webs.thefineanimationemporium.BoxingTmc threeActivity}: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1581)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.access$1500(ActivityThread.java:121)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Handler.dispatchMessage(Handler.java:99)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.os.Looper.loop(Looper.java:138)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.main(ActivityThread.java:3701)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invokeNative(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.reflect.Method.invoke(Method.java:507)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
04-10 20:21:50.856: E/AndroidRuntime(1487): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636)
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.NativeStart.main(Native Method)
04-10 20:21:50.856: E/AndroidRuntime(1487): Caused by: java.lang.ClassNotFoundException: com.webs.thefineanimationemporium.BoxingTmcthreeActivity in loader dalvik.system.PathClassLoader[/data/app/com.webs.thefineanimationemporium-1.apk]
04-10 20:21:50.856: E/AndroidRuntime(1487): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-10 20:21:50.856: E/AndroidRuntime(1487): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-10 20:21:50.856: E/AndroidRuntime(1487): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
04-10 20:21:50.856: E/AndroidRuntime(1487): ... 11 more
04-10 20:21:55.216: I/Process(1487): Sending signal. PID: 1487 SIG: 9
Sounds like a dodgy install on the second device to me, since one of the classes being called cant be found. Have you tried reinstalling?
edit: Sorry for sounding like someone from a tech support line...