m using DroidReader project to display the PdfFiles.When i execute my project i am getting force close error like this
07-24 20:13:26.694: E/AndroidRuntime(286): FATAL EXCEPTION: main
07-24 20:13:26.694: E/AndroidRuntime(286): java.lang.ExceptionInInitializerError
07-24 20:13:26.694: E/AndroidRuntime(286): at de.hilses.droidreader.DroidReaderActivity.onCreate(DroidReaderActivity.java:108)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.os.Looper.loop(Looper.java:123)
07-24 20:13:26.694: E/AndroidRuntime(286): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 20:13:26.694: E/AndroidRuntime(286): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 20:13:26.694: E/AndroidRuntime(286): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 20:13:26.694: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 20:13:26.694: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 20:13:26.694: E/AndroidRuntime(286): at dalvik.system.NativeStart.main(Native Method)
07-24 20:13:26.694: E/AndroidRuntime(286): Caused by: java.lang.UnsatisfiedLinkError: Library pdfrender not found
07-24 20:13:26.694: E/AndroidRuntime(286): at java.lang.Runtime.loadLibrary(Runtime.java:461)
07-24 20:13:26.694: E/AndroidRuntime(286): at java.lang.System.loadLibrary(System.java:557)
07-24 20:13:26.694: E/AndroidRuntime(286): at de.hilses.droidreader.PdfRender.<clinit>(PdfRender.java:111)
07-24 20:13:26.694: E/AndroidRuntime(286): ... 14 more
Help Me please
I guess you do not have add the .so file with name pdfrender.
You can find .so files in this apk file.
Open .apk file with a zip tool. and copy the content of lib folder in your libs.
Related
I've posted this question on the Amazon Developer Forum and haven't received an answer in 4 days, I've also sent it to Amazon developer support and haven't received an answer in the same time frame, so I'm here, hoping someone can help.
I'm trying to add 'mobile ads' to a new application. I'm working with Eclipse - Helios
In my manifest I have the correct permissions set
I have the Libraries set, I've checked the build path and project properties and things seem fine, The project builds with no issues
In my code
I have inserted the Application Key
I have inserted AdRegistration.enableLogging(true);
I have inserted AdRegistration.enableTesting(true);
When I use 'Run As - Android App' the app crashes with this and select either of my normal testing devices (Kindle Fire or Samsung Galaxy Tab), it builds find and begins to load the apk unto the the device and then this:
07-24 14:30:40.722: E/AndroidRuntime(2904): FATAL EXCEPTION: main
07-24 14:30:40.722: E/AndroidRuntime(2904): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.thecountrylife/com.thecountrylife.MenuActivity}: java.lang.ClassNotFoundException: Didn't find class "com.thecountrylife.MenuActivity" on path: /data/app/com.thecountrylife-2.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2142)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2283)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread.access$600(ActivityThread.java:146)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1245)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.os.Looper.loop(Looper.java:151)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread.main(ActivityThread.java:5152)
07-24 14:30:40.722: E/AndroidRuntime(2904): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 14:30:40.722: E/AndroidRuntime(2904): at java.lang.reflect.Method.invoke(Method.java:511)
07-24 14:30:40.722: E/AndroidRuntime(2904): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-24 14:30:40.722: E/AndroidRuntime(2904): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-24 14:30:40.722: E/AndroidRuntime(2904): at dalvik.system.NativeStart.main(Native Method)
07-24 14:30:40.722: E/AndroidRuntime(2904): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.thecountrylife.MenuActivity" on path: /data/app/com.thecountrylife-2.apk:/system/app/MetricsApi-2037410.apk:/system/app/com.amazon.dp.logger.apk
07-24 14:30:40.722: E/AndroidRuntime(2904): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-24 14:30:40.722: E/AndroidRuntime(2904): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-24 14:30:40.722: E/AndroidRuntime(2904): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.Instrumentation.newActivity(Instrumentation.java:1055)
07-24 14:30:40.722: E/AndroidRuntime(2904): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2133)
Any help would be greatly appreciated
Rather than continue to wait for Amazon or beat my head over the issue I simply switched over to Google MobAds, so my manifest is now what Google requires. Thanks anyway.
i'm getting this message when i run my application i don't know why i'm getting it could any one help me. here is the logcat.
java.lang.VerifyError: com.kosh.me.Smaller
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1429)
at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634)
at dalvik.system.NativeStart.main(Native Method)
This happens when the build library classes conflict with those at run-time. Try performing a Clean of your project followed by a build.
I have the following code in an activity to send the user to a different application:
public void goBack(View v) {
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setComponent(new ComponentName("com.example.android.lifecycle", "com.example.android.lifecycle.DialogActivity"));
startActivity(intent);
}
The manifest file for the application is:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.lifecycle"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15" />
<application android:label="#string/app_name"
android:icon="#drawable/ic_launcher">
<activity android:name=".ActivityA"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="com.example.android.lifecycle" />
</intent-filter>
</activity>
<activity android:name=".ActivityB" />
<activity android:name=".ActivityC" />
<activity android:name=".DialogActivity"
android:theme="#android:style/Theme.Dialog">
<action android:name="com.example.android.lifecycle" />
<action android:name="android.intent.action.MAIN" />
</activity>
</application>
</manifest>
However, when I click on the button which should send me to the new application, I get a message saying - The application has stopped unexpectedly. Please try again.
What am I doing wrong and how can I rectify this?
Thanks!!
09-27 14:08:42.763: E/AndroidRuntime(286): FATAL EXCEPTION: main
09-27 14:08:42.763: E/AndroidRuntime(286): java.lang.IllegalStateException: Could not execute method of the activity
09-27 14:08:42.763: E/AndroidRuntime(286): at android.view.View$1.onClick(View.java:2072)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.view.View.performClick(View.java:2408)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.view.View$PerformClick.run(View.java:8816)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.os.Handler.handleCallback(Handler.java:587)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.os.Handler.dispatchMessage(Handler.java:92)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.os.Looper.loop(Looper.java:123)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-27 14:08:42.763: E/AndroidRuntime(286): at java.lang.reflect.Method.invokeNative(Native Method)
09-27 14:08:42.763: E/AndroidRuntime(286): at java.lang.reflect.Method.invoke(Method.java:521)
09-27 14:08:42.763: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-27 14:08:42.763: E/AndroidRuntime(286): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-27 14:08:42.763: E/AndroidRuntime(286): at dalvik.system.NativeStart.main(Native Method)
09-27 14:08:42.763: E/AndroidRuntime(286): Caused by: java.lang.reflect.InvocationTargetException
09-27 14:08:42.763: E/AndroidRuntime(286): at com.example.myfirstapp.DisplayMessageActivity.goBack(DisplayMessageActivity.java:30)
09-27 14:08:42.763: E/AndroidRuntime(286): at java.lang.reflect.Method.invokeNative(Native Method)
09-27 14:08:42.763: E/AndroidRuntime(286): at java.lang.reflect.Method.invoke(Method.java:521)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.view.View$1.onClick(View.java:2067)
09-27 14:08:42.763: E/AndroidRuntime(286): ... 11 more
09-27 14:08:42.763: E/AndroidRuntime(286): Caused by: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cmp=com.example.android.lifecycle/.DialogActivity } from ProcessRecord{450fce58 286:com.example.myfirstapp/10044} (pid=286, uid=10044) requires null
09-27 14:08:42.763: E/AndroidRuntime(286): at android.os.Parcel.readException(Parcel.java:1247)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.os.Parcel.readException(Parcel.java:1235)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.app.Activity.startActivityForResult(Activity.java:2817)
09-27 14:08:42.763: E/AndroidRuntime(286): at android.app.Activity.startActivity(Activity.java:2923)
09-27 14:08:42.763: E/AndroidRuntime(286): ... 15 more
Add Intent.FLAG_ACTIVITY_NEW_TASK and Intent.FLAG_FROM_BACKGROUND flags with intent if you are starting New Application from Background as:
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_LAUNCHER);
intent.setComponent(new ComponentName( "com.example.android.lifecycle","com.example.android.lifecycle.DialogActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setFlags(Intent.FLAG_FROM_BACKGROUND);
startActivity(intent);
I think in manifest file under activity android:name=".DialogActivity", the name should be
action android:name="com.example.android.lifecycle.DialogActivity"
Can you try?
I am developing one android application and in that app I am trying to use Gson Library for Json serialization and de-serialization. I downloaded the library from the following link:-
http://code.google.com/p/google-gson/downloads/list
I included the gson-2.2.2.jar in Java Build Path, but the application crashes at run time when constructing Gson object:-
Gson gson = new Gson();
in logcat I get
07-24 14:53:21.648: E/dalvikvm(488): Could not find class 'com.google.gson.Gson', referenced from method com.google.gson.examples.android.GsonProguardExampleActivity.onCreate
07-24 14:53:21.648: W/dalvikvm(488): VFY: unable to resolve new-instance 10 (Lcom/google/gson/Gson;) in Lcom/google/gson/examples/android/GsonProguardExampleActivity;
07-24 14:53:21.668: D/dalvikvm(488): VFY: replacing opcode 0x22 at 0x0010
07-24 14:53:21.668: D/dalvikvm(488): VFY: dead code 0x0012-007a in Lcom/google/gson/examples/android/GsonProguardExampleActivity;.onCreate (Landroid/os/Bundle;)V
07-24 14:53:21.788: D/AndroidRuntime(488): Shutting down VM
07-24 14:53:21.788: W/dalvikvm(488): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-24 14:53:21.814: E/AndroidRuntime(488): FATAL EXCEPTION: main
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
07-24 14:53:21.814: E/AndroidRuntime(488): at com.google.gson.examples.android.GsonProguardExampleActivity.onCreate(GsonProguardExampleActivity.java:40)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Looper.loop(Looper.java:123)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 14:53:21.814: E/AndroidRuntime(488): at dalvik.system.NativeStart.main(Native Method)
Error is:-
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
Also, If I include full source of Gson library as another package in my project it all works well.
What am I doing wrong, is this the correct jar??
Seems you have kept the jar file inside lib folder, rather the name should be changed to libs. This was updated newer revisions of ADT (revision 17 onwards).
15 reports
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.oas.fruitkungfufree/com.openfeint.internal.ui.IntroFlow}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:521)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.openfeint.internal.Util.setOrientation(Util.java:36)
at com.openfeint.internal.ui.NestedWindow.onCreate(NestedWindow.java:32)
at com.openfeint.internal.ui.WebNav.onCreate(WebNav.java:93)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
Does any one have a solution for this??
This is a problem with your code, you can't use an object that is null. This is a hint.