ActionBarActivity catch an error on Phone - android

**
I was recomended to use ActionBar Activity**
Here is the previous code
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
I wrote new application and followed advice.
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
public class MainActivity extends ActionBarActivity {
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar =getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.activity_main);
}
#Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
if I use ACtionBarActivity instead of Activity
I catch an error message on phone, when I try to run it.
Please tell me what I do wrong
info from Logcat
07-27 15:14:19.942: I/Process(21715): Sending signal. PID: 21715 SIG: 9
07-27 15:34:38.521: W/dalvikvm(23579): Unable to resolve superclass of Lcom/example/project/MainActivity; (532)
07-27 15:34:38.521: W/dalvikvm(23579): Link of class 'Lcom/example/project/MainActivity;' failed
07-27 15:34:38.521: D/AndroidRuntime(23579): Shutting down VM
07-27 15:34:38.521: W/dalvikvm(23579): threadid=1: thread exiting with uncaught exception (group=0x40ae5210)
07-27 15:34:38.521: E/AndroidRuntime(23579): FATAL EXCEPTION: main
07-27 15:34:38.521: E/AndroidRuntime(23579): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.project/com.example.project.MainActivity}: java.lang.ClassNotFoundException: com.example.project.MainActivity
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread.access$600(ActivityThread.java:127)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.os.Looper.loop(Looper.java:137)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread.main(ActivityThread.java:4441)
07-27 15:34:38.521: E/AndroidRuntime(23579): at java.lang.reflect.Method.invokeNative(Native Method)
07-27 15:34:38.521: E/AndroidRuntime(23579): at java.lang.reflect.Method.invoke(Method.java:511)
07-27 15:34:38.521: E/AndroidRuntime(23579): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
07-27 15:34:38.521: E/AndroidRuntime(23579): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
07-27 15:34:38.521: E/AndroidRuntime(23579): at dalvik.system.NativeStart.main(Native Method)
07-27 15:34:38.521: E/AndroidRuntime(23579): Caused by: java.lang.ClassNotFoundException: com.example.project.MainActivity
07-27 15:34:38.521: E/AndroidRuntime(23579): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
07-27 15:34:38.521: E/AndroidRuntime(23579): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-27 15:34:38.521: E/AndroidRuntime(23579): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
07-27 15:34:38.521: E/AndroidRuntime(23579): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
07-27 15:34:38.521: E/AndroidRuntime(23579): ... 11 more
07-27 15:34:38.531: I/Process(23579): Sending signal. PID: 23579 SIG: 9
edit and export screenshot
http://i.stack.imgur.com/MNfc1.jpg
screenshot of 1-7
http://i.stack.imgur.com/NTpP3.jpg

I've got it worked after moving "Android Private Libraries" and "Android Dependencies" to the top of the list in Order and Export in my application project.
Also I dont have android-support-v7-appcompat in this list.
And in the android-support-v7-appcompat project I dont have support jars in the Order and Export list, but "Android Private Libraries" is checked.
Please, check also the links below:
Setting up ActionBarCompat support library in Eclipse
Implementing Action Bar using ActionBarCompat support library in Android

Make sure the support library is added to the project and exported. You can do so in Eclipse by viewing the properties of your project, clicking Java Build Path, then the Order and Export tab. Then make sure Android Private Libraries is checked.
Did you follow these steps: http://developer.android.com/tools/support-library/setup.html#

Had the exact same stack trace as you with Android Studio. I think it is caused by Android not being able to find a suitable theme for ActionBarActivity.
Anyway, this is how I solved it:
Add the following to your MainActivity in AndroidManifest.xml:
android:theme="#style/Theme.AppCompat.Light"
If it works now - great! If Android Studio cannot find the theme:
Copy the files
sdk/extras/android/support/v7/appcompat/res/values/themes.xml
sdk/extras/android/support/v7/appcompat/res/values/themes_base.xml
to the res/values/ folder in your project.

Related

Cordova hello world app crashing

I am new in Android Development. I am working on cordova platform
I have created a sample hello world app and getting this error when i am trying to open it in genymotion. ALthough the app compile succesfully but when i run it in genymotion it just shows the prompt with text "Unfortunately "APP" has stopped."
The Error log shows.
01-12 08:16:04.867 2073-2073/com.technoserves.crudnew D/dalvikvm﹕ Late-enabling CheckJNI
01-12 08:16:06.107 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ Unable to resolve superclass of Lcom/technoserves/crudnew/CordovaApp; (14)
01-12 08:16:06.119 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ Link of class 'Lcom/technoserves/crudnew/CordovaApp;' failed
01-12 08:16:06.135 2073-2073/com.technoserves.crudnew D/AndroidRuntime﹕ Shutting down VM
01-12 08:16:06.135 2073-2073/com.technoserves.crudnew W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xa6142908)
01-12 08:16:06.155 2073-2073/com.technoserves.crudnew E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.technoserves.crudnew/com.technoserves.crudnew.CordovaApp}: java.lang.ClassNotFoundException: Didn't find class "com.technoserves.crudnew.CordovaApp" on path: /data/app/com.technoserves.crudnew-1.apk
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
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:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.technoserves.crudnew.CordovaApp" on path: /data/app/com.technoserves.crudnew-1.apk
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
            at android.app.ActivityThread.access$600(ActivityThread.java:141)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5041)
            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:793)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
            at dalvik.system.NativeStart.main(Native Method)
01-12 08:16:22.399 2073-2073/com.technoserves.crudnew I/Process﹕ Sending signal. PID: 2073 SIG: 9
I have updated my cordova to resolve but still same error however a few days ago it was working fine and i have build some apps.
First download Cordova jar file from following link:
http://www.java2s.com/Code/JarDownload/cordova/cordova-1.8.1.jar.zip
after that extract the folder and put cordova-1.8.1 inside your libs folder of project in eclipse
And right click on your project--> properties and Select Android from left pane and scroll to bottom remove the cordova library if added.
then clean and build your project.

Could not find class 'android.app.Notification$Builder

I have add into my project's libralies the andriod-support-v4.jar... but I am getting this error:
Could not find class 'android.app.Notification$Builder', referenced from method org.secure.sms.SmsReceiver.showNotification
Could not find class 'android.support.v4.app.NotificationCompat$Builder', referenced from method org.secure.sms.SmsReceiver.createNotification
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: android.support.v4.app.NotificationCompat$Builder
at org.secure.sms.SmsReceiver.createNotification(SmsReceiver.java:108)
at org.secure.sms.SmsReceiver.onReceive(SmsReceiver.java:136)
at android.app.ActivityThread.handleReceiver(ActivityThread.java:1794)
at android.app.ActivityThread.access$2400(ActivityThread.java:117)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:981)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3683)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
Where is the problem??
Screenshot: http://i.stack.imgur.com/I95ke.jpg
be sure to have android-support-v4.jar inside your folder /libs
and add this to your class:
import android.support.v4.app.NotificationCompat;

Having issues integrating Scandit SDK into my app

Decided to use Scandit SDK to get the barcode scanning feature in my app. Unfortunately, since I'm relatively new to Android development and Java in general I've run into a few issues that I can't seem to work out. The demo that Scandit provided doesn't give any errors(runs fine) but crashes when I try to start it up (pressing a button from one activity is meant to start it up). I've tried reading the logcat and googling a solution to the problems but I'm not getting the right solutions. Does anyone have an idea of what I'm doing wrong?
Logcat is provided below:
10-08 23:30:00.807 21563-21563/com.kwesimbia.management D/AndroidRuntime? Shutting down VM
10-08 23:30:00.807 21563-21563/com.kwesimbia.management W/dalvikvm? threadid=1: thread exiting with uncaught exception (group=0x40aa4228)
10-08 23:30:00.817 21563-21563/com.kwesimbia.management E/AndroidRuntime? FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3082)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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.NoClassDefFoundError: com.kwesimbia.management.ScanditSDKDemoSimple
at com.kwesimbia.management.Activity_D.initiateCodeScan(Activity_D.java:63)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3077)
at android.view.View.performClick(View.java:3549)
at android.view.View$PerformClick.run(View.java:14393)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:4944)
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)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Process: com.kwesimbia.management
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger? App crashed!
Package: com.kwesimbia.management v1 (1.0)
10-08 23:30:00.817 32726-587/? E/EmbeddedLogger?
Application Label: firstapp
10-08 23:30:00.827 32726-587/? W/ActivityManager?
Force finishing activity com.kwesimbia.management/.Activity_D
I came across this problem as well, my solution was to extract the library files and put them as their files in the lib folder
The library basically isn't being exported with it
EDIT
So I checked out my project, basically I did these things:
In the libs folder I have a new folder called armeabi and inside that I have libscanditsdk-android-3.3.1.so
Then in my build path I have also referenced the jar file that they provide:
<classpathentry exported="true" kind="lib" path="C:/GIT/Android/FwayScannerProject/FwayScanner/libs/scanditsdk-barcodepicker-android-3.3.1.jar"/>

Sharing database between different activities

I am writing a program that it needs Activity A to write data to a database, while Activity B read data from the database. I extended SQLiteOpenHelper Class as DatabaseHelper, and I get my database in Activity A in this way:
SQLiteOpenHelper dbHelper = new DatabaseHelper(this, "classtableDatabase", null, 1);
SQLiteDatabase db = dbHelper.getWritableDatabase();
It works in Activity well.
When I try to open the database created by Activity A in Activity B in same way, it failed and I get these error messages:
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{cn.square2.iscut/cn.square2.iscut.ClassTableDetails}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
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:4441)
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:823)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:221)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:157)
at android.database.sqlite.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:231)
at cn.square2.iscut.ClassTableDetails.<init>(ClassTableDetails.java:28)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
... 11 more
What should I do to fix this issue? Thank you for your help!
I had the same problem. You don't need to do anything just make static references to the database from the activities other than your MAIN activity.

Phonegap application stops unexpectedly on Indigo running Android ADT 20

I am using eclipse indigo with android ADT 20 but everytime it shows error that application stop unexpectedly.
Please any one have idea about how to use both of them with each other?
I also refer some google groupe which shows to update ecllipse and I also follow that but still not working. Thx in advance...
LOGS:
07-27 16:48:04.958: D/ddm-heap(217): Got feature list request
07-27 16:48:05.328: I/dalvikvm(217): Could not find method android.webkit.WebView.<init>, referenced from method org.apache.cordova.CordovaWebView.<init>
07-27 16:48:05.328: W/dalvikvm(217): VFY: unable to resolve direct method 3114: Landroid/webkit/WebView;.<init> (Landroid/content/Context;Landroid/util/AttributeSet;IZ)V
07-27 16:48:05.328: D/dalvikvm(217): VFY: replacing opcode 0x70 at 0x0001
07-27 16:48:05.328: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebView;.<init> code (196 bytes)
07-27 16:48:05.658: D/dalvikvm(217): GC freed 807 objects / 63672 bytes in 104ms
07-27 16:48:05.948: E/dalvikvm(217): Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse
07-27 16:48:05.958: W/dalvikvm(217): VFY: unable to resolve new-instance 451 (Landroid/webkit/WebResourceResponse;) in Lorg/apache/cordova/CordovaWebViewClient;
07-27 16:48:05.958: D/dalvikvm(217): VFY: replacing opcode 0x22 at 0x0046
07-27 16:48:05.958: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebViewClient;.generateWebResourceResponse code (245 bytes)
07-27 16:48:05.958: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-27 16:48:05.998: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-27 16:48:06.014: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/WebResourceResponse;)
07-27 16:48:06.014: I/dalvikvm(217): Could not find method android.webkit.WebViewClient.shouldInterceptRequest, referenced from method org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest
07-27 16:48:06.014: W/dalvikvm(217): VFY: unable to resolve virtual method 3125: Landroid/webkit/WebViewClient;.shouldInterceptRequest (Landroid/webkit/WebView;Ljava/lang/String;)Landroid/webkit/WebResourceResponse;
07-27 16:48:06.014: D/dalvikvm(217): VFY: replacing opcode 0x6f at 0x0015
07-27 16:48:06.014: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaWebViewClient;.shouldInterceptRequest code (68 bytes)
07-27 16:48:06.018: W/dalvikvm(217): VFY: unable to find class referenced in signature (Landroid/webkit/ConsoleMessage;)
07-27 16:48:06.018: I/dalvikvm(217): Could not find method android.webkit.ConsoleMessage.message, referenced from method org.apache.cordova.CordovaChromeClient.onConsoleMessage
07-27 16:48:06.018: W/dalvikvm(217): VFY: unable to resolve virtual method 3084: Landroid/webkit/ConsoleMessage;.message ()Ljava/lang/String;
07-27 16:48:06.018: D/dalvikvm(217): VFY: replacing opcode 0x6e at 0x0000
07-27 16:48:06.028: D/dalvikvm(217): Making a copy of Lorg/apache/cordova/CordovaChromeClient;.onConsoleMessage code (56 bytes)
07-27 16:48:06.038: W/System.err(217): =====================================================================================
07-27 16:48:06.056: W/System.err(217): ERROR: plugin.xml is missing. Add res/xml/plugins.xml to your project.
07-27 16:48:06.056: W/System.err(217): https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/res/xml/plugins.xml
07-27 16:48:06.056: W/System.err(217): =====================================================================================
07-27 16:48:06.056: W/ResourceType(217): No package identifier when getting name for resource number 0x00000000
07-27 16:48:06.058: D/AndroidRuntime(217): Shutting down VM
07-27 16:48:06.058: W/dalvikvm(217): threadid=3: thread exiting with uncaught exception (group=0x4001b188)
07-27 16:48:06.058: E/AndroidRuntime(217): Uncaught handler: thread main exiting due to uncaught exception
07-27 16:48:06.078: E/AndroidRuntime(217): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testdemo/com.example.testdemo.MainActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x0
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.os.Handler.dispatchMessage(Handler.java:99)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.os.Looper.loop(Looper.java:123)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.main(ActivityThread.java:4363)
07-27 16:48:06.078: E/AndroidRuntime(217): at java.lang.reflect.Method.invokeNative(Native Method)
07-27 16:48:06.078: E/AndroidRuntime(217): at java.lang.reflect.Method.invoke(Method.java:521)
07-27 16:48:06.078: E/AndroidRuntime(217): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-27 16:48:06.078: E/AndroidRuntime(217): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-27 16:48:06.078: E/AndroidRuntime(217): at dalvik.system.NativeStart.main(Native Method)
07-27 16:48:06.078: E/AndroidRuntime(217): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.getValue(Resources.java:891)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.loadXmlResourceParser(Resources.java:1865)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.content.res.Resources.getXml(Resources.java:779)
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.api.PluginManager.loadPlugins(PluginManager.java:99)
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.api.PluginManager.init(PluginManager.java:76)
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.CordovaWebView.loadUrlIntoView(CordovaWebView.java:361)
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.CordovaWebView.loadUrl(CordovaWebView.java:314)
07-27 16:48:06.078: E/AndroidRuntime(217): at org.apache.cordova.DroidGap.loadUrl(DroidGap.java:356)
07-27 16:48:06.078: E/AndroidRuntime(217): at com.example.testdemo.MainActivity.onCreate(MainActivity.java:12)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-27 16:48:06.078: E/AndroidRuntime(217): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-27 16:48:06.078: E/AndroidRuntime(217): ... 11 more
07-27 16:48:06.098: I/dalvikvm(217): threadid=7: reacting to signal 3
07-27 16:48:06.098: E/dalvikvm(217): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
07-27 16:48:08.998: I/Process(217): Sending signal. PID: 217 SIG: 9
This issue occurs because the "lib" folder is renamed to "libs" now by Android People.
You need to create a libs folder instead of lib and then place your cordova.jar file there.
And as soon as we place our external jars to this "libs" folder then it will automatically be added to the build path of the application. Then run your application....
Let me know if this helps you...
You should try debugging your build. See here: http://www.droidnova.com/debugging-in-android-using-eclipse,541.html
I would recommend downloading the android sdk examples (ie native code examples) and running them to understand how android works. This will help you in setting up phonegap (which is just a webview in an android app with a JS-Native bridge).
To get the android sdk examples you can download them through the android "sdk manager"

Categories

Resources