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().
Related
We tried integrating HelpStack by following steps given on GitHub, but we kept getting the following errors:
04-03 13:54:22.054 4638-4638/com.playerline.android E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.playerline.android/com.tenmiles.helpstack.activities.HomeActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.tenmiles.helpstack.activities.HSActivityParent.onCreate(HSActivityParent.java:48)
at com.tenmiles.helpstack.activities.HomeActivity.onCreate(HomeActivity.java:46)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1931)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4448)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
I'm guessing it has something to do with the App Theme, which in our case is is Theme.AppCompat.NoActionBar.
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.
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"/>
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...