Android unable to install the application on emulator - android

I have an android application and am trying to test the installation by downloading from a URL. The app is developed by me and I can load the app into emulator using eclipse and run it properly.
I uploaded the apk to webserver and point the emulators android browser to the location http://localhost:9080/myapp.apk. Emulator downloads the app properly. When I try to click on the downloaded file to install, it throws an error saying Unfortunately the process android.process.media has stopped. I am not sure how to proceed further to resolve this issue
Emulator Configuration: Android avd running on API 14, ICS 4.0.0 with 1GB sdcard.iso
Appreciate any insights.
Logcat shows the following:
07-10 19:17:19.195: I/qtaguid(380): Untagging socket 65 failed errno=-2
07-10 19:17:19.195: W/NetworkManagementSocketTagger(380): untagSocket(65) failed with errno -2
07-10 19:17:19.624: D/dalvikvm(80): GC_CONCURRENT freed 398K, 10% free 12133K/13383K, paused 10ms+10ms
07-10 19:17:20.174: D/dalvikvm(147): GC_CONCURRENT freed 699K, 31% free 11440K/16455K, paused 4ms+8ms
07-10 19:17:20.734: D/dalvikvm(147): GC_CONCURRENT freed 535K, 32% free 11325K/16455K, paused 3ms+7ms
07-10 19:17:21.025: D/dalvikvm(80): GC_EXPLICIT freed 105K, 10% free 12084K/13383K, paused 5ms+11ms
07-10 19:17:21.484: D/dalvikvm(380): GC_CONCURRENT freed 373K, 5% free 10112K/10631K, paused 4ms+5ms
07-10 19:17:24.464: W/KeyguardViewMediator(80): verifyUnlock called when not externally disabled
07-10 19:17:24.594: W/dalvikvm(380): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Landroid/drm/DrmManagerClient;
07-10 19:17:24.604: D/AndroidRuntime(380): Shutting down VM
07-10 19:17:24.614: W/dalvikvm(380): threadid=1: thread exiting with uncaught exception (group=0x409961f8)
07-10 19:17:24.654: E/AndroidRuntime(380): FATAL EXCEPTION: main
07-10 19:17:24.654: E/AndroidRuntime(380): java.lang.ExceptionInInitializerError
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.providers.downloads.DownloadDrmHelper.getOriginalMimeType(DownloadDrmHelper.java:97)
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.providers.downloads.DownloadReceiver.openDownload(DownloadReceiver.java:153)
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.providers.downloads.DownloadReceiver.handleNotificationBroadcast(DownloadReceiver.java:104)
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.providers.downloads.DownloadReceiver.onReceive(DownloadReceiver.java:74)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2118)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.app.ActivityThread.access$1500(ActivityThread.java:122)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.os.Looper.loop(Looper.java:137)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.app.ActivityThread.main(ActivityThread.java:4340)
07-10 19:17:24.654: E/AndroidRuntime(380): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 19:17:24.654: E/AndroidRuntime(380): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 19:17:24.654: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-10 19:17:24.654: E/AndroidRuntime(380): at dalvik.system.NativeStart.main(Native Method)
07-10 19:17:24.654: E/AndroidRuntime(380): Caused by: java.lang.UnsatisfiedLinkError: Library drmframework_jni not found; tried [/vendor/lib/libdrmframework_jni.so, /system/lib/libdrmframework_jni.so]
07-10 19:17:24.654: E/AndroidRuntime(380): at java.lang.Runtime.loadLibrary(Runtime.java:393)
07-10 19:17:24.654: E/AndroidRuntime(380): at java.lang.System.loadLibrary(System.java:535)
07-10 19:17:24.654: E/AndroidRuntime(380): at android.drm.DrmManagerClient.<clinit>(DrmManagerClient.java:56)
07-10 19:17:24.654: E/AndroidRuntime(380): ... 15 more
07-10 19:17:24.804: W/InputManagerService(80): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41647c30
07-10 19:17:25.044: I/WindowManager(80): createSurface Window{415ef168 paused=false}: DRAW NOW PENDING

Apparently its a bug in Android as pointed by #SevaAlekseyev above
code.google.com/p/android/issues/detail?id=21173
I was able to install by clicking on the app from downloads

Resolved in 4.1 (API 16). I get the same error because of an unsatisfied link error, libdrmframework_jni.so. Works well on a device.

Related

Android Application Crashes in Emulator

My Android application crashes in the emulator with, with the following being output to the logs:
09-26 14:04:02.123: D/dalvikvm(716): GC_FOR_ALLOC freed 66K, 6% free 2675K/2844K, paused 29ms, total 30ms
09-26 14:04:02.123: I/dalvikvm-heap(716): Grow heap (frag case) to 3.455MB for 782224-byte allocation
09-26 14:04:02.173: D/dalvikvm(716): GC_FOR_ALLOC freed 2K, 5% free 3437K/3608K, paused 42ms, total 42ms
09-26 14:04:02.303: D/dalvikvm(716): GC_FOR_ALLOC freed <1K, 5% free 3436K/3608K, paused 38ms, total 39ms
09-26 14:04:02.314: I/dalvikvm-heap(716): Grow heap (frag case) to 4.778MB for 1389712-byte allocation
09-26 14:04:02.363: D/dalvikvm(716): GC_FOR_ALLOC freed <1K, 4% free 4793K/4968K, paused 52ms, total 52ms
09-26 14:04:02.423: D/AndroidRuntime(716): Shutting down VM
09-26 14:04:02.423: W/dalvikvm(716): threadid=1: thread exiting with uncaught exception (group=0x414c4700)
09-26 14:04:02.433: E/AndroidRuntime(716): FATAL EXCEPTION: main
09-26 14:04:02.433: E/AndroidRuntime(716): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sample_proj/com.example.sample_proj.MainActivity}: java.lang.NullPointerException
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2211)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.access$600(ActivityThread.java:141)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.os.Handler.dispatchMessage(Handler.java:99)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.os.Looper.loop(Looper.java:137)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.main(ActivityThread.java:5103)
09-26 14:04:02.433: E/AndroidRuntime(716): at java.lang.reflect.Method.invokeNative(Native Method)
09-26 14:04:02.433: E/AndroidRuntime(716): at java.lang.reflect.Method.invoke(Method.java:525)
09-26 14:04:02.433: E/AndroidRuntime(716): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
09-26 14:04:02.433: E/AndroidRuntime(716): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-26 14:04:02.433: E/AndroidRuntime(716): at dalvik.system.NativeStart.main(Native Method)
09-26 14:04:02.433: E/AndroidRuntime(716): Caused by: java.lang.NullPointerException
09-26 14:04:02.433: E/AndroidRuntime(716): at com.example.sample_proj.MainActivity.onCreate(MainActivity.java:21)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.Activity.performCreate(Activity.java:5133)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
09-26 14:04:02.433: E/AndroidRuntime(716): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
09-26 14:04:02.433: E/AndroidRuntime(716): ... 11 more
Would someone please help me in understanding why NullPointerException is being thrown and how I can resolve it?
Check this line in your MainActivity
MainActivity.java:21
You have probably used findviewbyid and the following happened
you forgot to put the line "setContentView" or put it after findviewbyid
or you put the contentView to the wrong layout
1 and 2 are not it, and you did findviewbyid to non existing id in the given layout- and tried to use that object aterwards, because the id is incorrect, the object returns null, and you are trying to use it

can't show alert dialog

I can't show alert dialog. Everything is right until I set the method dialog.show(), then I can't open my application. Without this method everything is fine.
I declared two global objects:
AlertDialog.Builder builder;
AlertDialog dialog;
Then in MainActivity, I build a dialog by builder and create it.
builder = new AlertDialog.Builder(this.getApplicationContext());
builder.setMessage("We're sorry, but on Your device accelerometer isn't available")
.setCancelable(false)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
#Override
public void onClick(DialogInterface dialog, int which)
{
MainActivity.this.finish();
}
});
dialog = builder.create();
To this moment everything works and there's no any exceptions, but when I want to show the dialog, some exceptions appear and I can't run this application:
dialog.show(); //this method doesn't work and causes problems
What did I do wrong?
EDIT:
Exceptions:
06-26 20:49:03.540: D/dalvikvm(4085): GC_FOR_ALLOC freed 38K, 8% free 2499K/2712K, paused 42ms, total 45ms
06-26 20:49:03.580: I/dalvikvm-heap(4085): Grow heap (frag case) to 6.146MB for 3712016-byte allocation
06-26 20:49:03.700: D/dalvikvm(4085): GC_FOR_ALLOC freed 2K, 4% free 6121K/6340K, paused 112ms, total 112ms
06-26 20:49:03.770: D/dalvikvm(4085): GC_CONCURRENT freed <1K, 4% free 6121K/6340K, paused 6ms+16ms, total 71ms
06-26 20:49:04.460: D/gralloc_goldfish(4085): Emulator without GPU emulation detected.
06-26 20:49:42.030: E/Trace(4138): error opening trace file: No such file or directory (2)
06-26 20:49:42.900: D/dalvikvm(4138): GC_FOR_ALLOC freed 41K, 8% free 2499K/2716K, paused 66ms, total 68ms
06-26 20:49:42.940: I/dalvikvm-heap(4138): Grow heap (frag case) to 6.146MB for 3712016-byte allocation
06-26 20:49:43.050: D/dalvikvm(4138): GC_FOR_ALLOC freed 2K, 4% free 6121K/6344K, paused 107ms, total 107ms
06-26 20:49:43.120: D/dalvikvm(4138): GC_CONCURRENT freed <1K, 4% free 6121K/6344K, paused 5ms+5ms, total 70ms
06-26 20:49:43.540: D/dalvikvm(4138): GC_FOR_ALLOC freed 3638K, 53% free 3483K/7300K, paused 36ms, total 37ms
06-26 20:49:43.621: D/AndroidRuntime(4138): Shutting down VM
06-26 20:49:43.630: W/dalvikvm(4138): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
06-26 20:49:43.640: E/AndroidRuntime(4138): FATAL EXCEPTION: main
06-26 20:49:43.640: E/AndroidRuntime(4138): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.accelerometertest/com.example.accelerometertest.MainActivity}: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread.access$600(ActivityThread.java:141)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.os.Handler.dispatchMessage(Handler.java:99)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.os.Looper.loop(Looper.java:137)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread.main(ActivityThread.java:5041)
06-26 20:49:43.640: E/AndroidRuntime(4138): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 20:49:43.640: E/AndroidRuntime(4138): at java.lang.reflect.Method.invoke(Method.java:511)
06-26 20:49:43.640: E/AndroidRuntime(4138): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
06-26 20:49:43.640: E/AndroidRuntime(4138): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
06-26 20:49:43.640: E/AndroidRuntime(4138): at dalvik.system.NativeStart.main(Native Method)
06-26 20:49:43.640: E/AndroidRuntime(4138): Caused by: android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.view.ViewRootImpl.setView(ViewRootImpl.java:571)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:246)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:69)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.Dialog.show(Dialog.java:281)
06-26 20:49:43.640: E/AndroidRuntime(4138): at com.example.accelerometertest.MainActivity.onCreate(MainActivity.java:67)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.Activity.performCreate(Activity.java:5104)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
06-26 20:49:43.640: E/AndroidRuntime(4138): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
06-26 20:49:43.640: E/AndroidRuntime(4138): ... 11 more
change
builder = new AlertDialog.Builder(this.getApplicationContext());
to (As long as thisis your MainActivity )
builder = new AlertDialog.Builder(this);

android map application is not running on emulator

I have developed a Android Map Application in Android and Want to Launch It On Google Play.
Problem is that when I Try to Run it On Emulator It Shows this Error in Console
[2013-06-24 10:14:18 - Track] Installation error: INSTALL_FAILED_MISSING_SHARED_LIBRARY
[2013-06-24 10:14:18 - Track] Please check logcat output for more details.
[2013-06-24 10:14:18 - Track] Launch canceled!
Please Any One Help Me To Test it On Emulator and Tell me What Exactly I am Missing or Is There any other problem in it.Thanks in Advance
Update
Log Cat
06-24 14:43:12.462: D/dalvikvm(380): GC_CONCURRENT freed 376K, 48% free 3039K/5831K, external 716K/1038K, paused 5ms+5ms
06-24 14:43:16.303: D/dalvikvm(380): GC_CONCURRENT freed 578K, 50% free 3020K/6023K, external 716K/1038K, paused 5ms+49ms
06-24 14:43:16.863: D/dalvikvm(380): GC_CONCURRENT freed 298K, 47% free 3234K/6023K, external 716K/1038K, paused 5ms+7ms
06-24 14:43:17.193: D/dalvikvm(380): GC_CONCURRENT freed 468K, 47% free 3318K/6215K, external 716K/1038K, paused 5ms+32ms
06-24 14:43:17.643: D/dalvikvm(380): GC_CONCURRENT freed 432K, 46% free 3417K/6279K, external 717K/1038K, paused 5ms+6ms
06-24 14:43:37.943: E/log_tag(380): Error in http connectionjava.net.UnknownHostException: sml.com.pk
06-24 14:43:37.943: E/log_tag(380): Error converting result java.lang.NullPointerException
06-24 14:43:37.963: D/AndroidRuntime(380): Shutting down VM
06-24 14:43:37.974: W/dalvikvm(380): threadid=1: thread exiting with uncaught exception (group=0x40015560)
06-24 14:43:37.982: E/AndroidRuntime(380): FATAL EXCEPTION: main
06-24 14:43:37.982: E/AndroidRuntime(380): java.lang.RuntimeException: Unable to start activity ComponentInfo{map2.pkg.pkg/map2.pkg.pkg.GMapsActivity}: java.lang.NullPointerException
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.os.Handler.dispatchMessage(Handler.java:99)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.os.Looper.loop(Looper.java:130)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-24 14:43:37.982: E/AndroidRuntime(380): at java.lang.reflect.Method.invokeNative(Native Method)
06-24 14:43:37.982: E/AndroidRuntime(380): at java.lang.reflect.Method.invoke(Method.java:507)
06-24 14:43:37.982: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-24 14:43:37.982: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-24 14:43:37.982: E/AndroidRuntime(380): at dalvik.system.NativeStart.main(Native Method)
06-24 14:43:37.982: E/AndroidRuntime(380): Caused by: java.lang.NullPointerException
06-24 14:43:37.982: E/AndroidRuntime(380): at org.json.JSONTokener.nextCleanInternal(JSONTokener.java:112)
06-24 14:43:37.982: E/AndroidRuntime(380): at org.json.JSONTokener.nextValue(JSONTokener.java:90)
06-24 14:43:37.982: E/AndroidRuntime(380): at org.json.JSONArray.<init>(JSONArray.java:87)
06-24 14:43:37.982: E/AndroidRuntime(380): at org.json.JSONArray.<init>(JSONArray.java:103)
06-24 14:43:37.982: E/AndroidRuntime(380): at map2.pkg.pkg.GMapsActivity.onCreate(GMapsActivity.java:112)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
06-24 14:43:37.982: E/AndroidRuntime(380): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
06-24 14:43:37.982: E/AndroidRuntime(380): ... 11 more
06-24 14:44:28.792: I/Process(380): Sending signal. PID: 380 SIG: 9
Sir I Have Created Emulator as Google Inc But Now Again m getting Error Above Log Cat/
1) Install Google map APIs. This can be done in Eclispe
Windows/Android SDK and AVD Manager -> Available Packages -> Third
Party Add-ons -> Google Inc. -> Google APIs by Google Inc., Android
API X
2) From command line create new AVD. This can be done by listing
targets (android list targets), then android create avd -n
new_avd_api_233 -t "Google Inc.:Google APIs:X"
3) Then create AVD in Eclipse Windows/Android SDK and AVD Manager ->
New... -> (Name: new_avd_X, Target: Google APIs (Google Inc.) - API
Level X)
4) Create Android Project in Eclipse File/New/Android Project and
select Google APIs Build Target.
5) add between
tags.
5) Run Project as Android Application.
If you’re installing an apk into the Android Emulator and seeing this
error (INSTALL_FAILED_MISSING_SHARED_LIBRARY), it may mean that the
app relies on the Google APIs (e.g. for Google Maps and the other
Google Android apps) and your AVD that you’re running was created
without the Google APIs.
Create a new AVD from the AVD Manager using the one of the Google API
targets at the API level that you need and you should be good to go.

Unable to run my Sencha Touch 2 using PhoneGap (FileNotFound on Dispatcher.js)(White Screen)

I've made a trial app using ST2, it works just fine while using only ST2 but when i try to use PhoneGap to run this app on an android emulator it seems to fail at loading my html5/JS ST2 files and throws java.io.FileNotFoundException: www/event/Dispatcher.js ...
Result -> White Screen
Stacktrace:
07-10 12:15:52.701: I/CordovaLog(536): Changing log level to DEBUG(3)
07-10 12:15:52.701: I/CordovaLog(536): Found preference for useBrowserHistory=false
07-10 12:15:52.711: D/CordovaLog(536): Found preference for useBrowserHistory=false
07-10 12:15:52.721: D/DroidGap(536): DroidGap.init()
07-10 12:15:52.771: I/dalvikvm(536): threadid=3: reacting to signal 3
07-10 12:15:52.841: D/CordovaWebView(536): >>>loadUrl(file:///android_asset/www/index.html)
07-10 12:15:52.841: D/PluginManager(536): init()
07-10 12:15:52.871: I/dalvikvm(536): Wrote stack traces to '/data/anr/traces.txt'
07-10 12:15:52.891: D/CordovaWebView(536): >>> loadUrlNow()
07-10 12:15:52.921: D/SoftKeyboardDetect(536): Ignore this event
07-10 12:15:53.011: W/webcore(536): java.lang.Throwable: EventHub.removeMessages(int what = 107) is not supported before the WebViewCore is set up.
07-10 12:15:53.011: W/webcore(536): at android.webkit.WebViewCore$EventHub.removeMessages(WebViewCore.java:1683)
07-10 12:15:53.011: W/webcore(536): at android.webkit.WebViewCore$EventHub.access$7900(WebViewCore.java:926)
07-10 12:15:53.011: W/webcore(536): at android.webkit.WebViewCore.removeMessages(WebViewCore.java:1795)
07-10 12:15:53.011: W/webcore(536): at android.webkit.WebView.sendOurVisibleRect(WebView.java:2917)
07-10 12:15:53.011: W/webcore(536): at android.webkit.ZoomManager.setZoomScale(ZoomManager.java:593)
07-10 12:15:53.011: W/webcore(536): at android.webkit.ZoomManager.access$1700(ZoomManager.java:49)
07-10 12:15:53.011: W/webcore(536): at android.webkit.ZoomManager$PostScale.run(ZoomManager.java:984)
07-10 12:15:53.011: W/webcore(536): at android.os.Handler.handleCallback(Handler.java:605)
07-10 12:15:53.011: W/webcore(536): at android.os.Handler.dispatchMessage(Handler.java:92)
07-10 12:15:53.011: W/webcore(536): at android.os.Looper.loop(Looper.java:137)
07-10 12:15:53.011: W/webcore(536): at android.app.ActivityThread.main(ActivityThread.java:4424)
07-10 12:15:53.011: W/webcore(536): at java.lang.reflect.Method.invokeNative(Native Method)
07-10 12:15:53.011: W/webcore(536): at java.lang.reflect.Method.invoke(Method.java:511)
07-10 12:15:53.011: W/webcore(536): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-10 12:15:53.011: W/webcore(536): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-10 12:15:53.011: W/webcore(536): at dalvik.system.NativeStart.main(Native Method)
07-10 12:15:53.011: D/SoftKeyboardDetect(536): Ignore this event
07-10 12:15:53.041: D/gralloc_goldfish(536): Emulator without GPU emulation detected.
07-10 12:15:53.441: D/DroidGap(536): onMessage(onPageStarted,file:///android_asset/www/index.html)
07-10 12:15:53.631: D/dalvikvm(536): GC_CONCURRENT freed 181K, 4% free 9316K/9607K, paused 6ms+4ms
07-10 12:15:56.681: E/generateWebResourceResponse(536): www/event/Dispatcher.js
07-10 12:15:56.681: E/generateWebResourceResponse(536): java.io.FileNotFoundException: www/event/Dispatcher.js
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.content.res.AssetManager.openAsset(Native Method)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.content.res.AssetManager.open(AssetManager.java:315)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse(CordovaWebViewClient.java:492)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest(CordovaWebViewClient.java:465)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.webkit.CallbackProxy.shouldInterceptRequest(CallbackProxy.java:1078)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.webkit.BrowserFrame.shouldInterceptRequest(BrowserFrame.java:951)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.os.Looper.loop(Looper.java:137)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:728)
07-10 12:15:56.681: E/generateWebResourceResponse(536): at java.lang.Thread.run(Thread.java:856)
07-10 12:15:56.721: E/generateWebResourceResponse(536): www/event/publisher/Dom.js
07-10 12:15:56.721: E/generateWebResourceResponse(536): java.io.FileNotFoundException: www/event/publisher/Dom.js
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.content.res.AssetManager.openAsset(Native Method)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.content.res.AssetManager.open(AssetManager.java:315)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at org.apache.cordova.CordovaWebViewClient.generateWebResourceResponse(CordovaWebViewClient.java:492)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at org.apache.cordova.CordovaWebViewClient.shouldInterceptRequest(CordovaWebViewClient.java:465)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.webkit.CallbackProxy.shouldInterceptRequest(CallbackProxy.java:1078)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.webkit.BrowserFrame.shouldInterceptRequest(BrowserFrame.java:951)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.webkit.JWebCoreJavaBridge.nativeServiceFuncPtrQueue(Native Method)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.webkit.JWebCoreJavaBridge.handleMessage(JWebCoreJavaBridge.java:113)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.os.Handler.dispatchMessage(Handler.java:99)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.os.Looper.loop(Looper.java:137)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:728)
07-10 12:15:56.721: E/generateWebResourceResponse(536): at java.lang.Thread.run(Thread.java:856)
07-10 12:15:56.731: D/chromium(536): Unknown chromium error: -6
07-10 12:15:56.731: D/chromium(536): Unknown chromium error: -6
07-10 12:15:56.731: D/Cordova(536): onPageFinished(file:///android_asset/www/index.html)
07-10 12:15:56.731: D/CordovaWebView(536): >>> loadUrlNow()
07-10 12:15:56.731: D/DroidGap(536): onMessage(onNativeReady,null)
07-10 12:15:56.731: D/DroidGap(536): onMessage(onPageFinished,file:///android_asset/www/index.html)
07-10 12:15:56.911: I/SqliteDatabaseCpp(536): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/clearitm.mobility.hellosenchacordova/databases/webview.db
07-10 12:15:56.911: I/SqliteDatabaseCpp(536): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27701 - "" errno=2 path=/CachedGeoposition.db, db=/data/data/clearitm.mobility.hellosenchacordova/databases/webview.db
07-10 12:15:57.042: D/DroidGap(536): onMessage(networkconnection,3g)
07-10 12:15:58.789: D/DroidGap(536): onMessage(spinner,stop)
index.html code:
<!DOCTYPE html>
<html>
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sencha Touch 2 Teste</title>
<link rel="stylesheet" href="sencha-touch.css" type="text/css">
<script type="text/javascript" src="sencha-touch.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-1.9.0.js"></script>
<script type="text/javascript" charset="utf-8" src="app/app.js"></script>
</header>
<body>
</body>
</html>
app.js:
Ext.Loader.setConfig({
enable: true
});
Ext.application({
name:'Touch2Demo',
views: [
'ContatosList',
'ContatosForm'
],
models: [
'Contato'
],
controllers: [
'Main'
],
stores: [
'Contatos'
],
viewport:{
layout:{
type: 'card',
animation: {
type: 'slide',
duration: 1000
}
}
},
launch: function(){
}
});
main java class:
import org.apache.cordova.DroidGap;
import android.os.Bundle;
public class HelloSenchaCordovaActivity extends DroidGap {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
}
assets folder structure :
assets>
www>
app>
app.js
controller
data
model
profile
store
view
sencha>
resources>
sencha-touch.js
cordova-1.9.0.js
sencha-touch.js
sencha-touch.css
index.html
I've searched other questions regarding this kind of problem but none of those solutions managed to solve my problem :/ Any clues on whats wrong here ?
Thanks !
Managed to make it work, the problem was that I was using sencha-touch.js when i should use sencha-touch-all.js :) It's working like a charm now, I hope this helps others having problems like this.

please can anyone explain this error in logcat

06-26 17:07:09.898: E/AndroidRuntime(380): FATAL EXCEPTION: main
06-26 17:07:09.898: E/AndroidRuntime(380): java.lang.NoClassDefFoundError: org.mythrii.email.Mail
06-26 17:07:09.898: E/AndroidRuntime(380): at org.mythrii.email.Email$1.onClick(Email.java:19)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.view.View.performClick(View.java:2485)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.view.View$PerformClick.run(View.java:9080)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.os.Handler.handleCallback(Handler.java:587)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.os.Handler.dispatchMessage(Handler.java:92)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.os.Looper.loop(Looper.java:123)
06-26 17:07:09.898: E/AndroidRuntime(380): at android.app.ActivityThread.main(ActivityThread.java:3683)
06-26 17:07:09.898: E/AndroidRuntime(380): at java.lang.reflect.Method.invokeNative(Native Method)
06-26 17:07:09.898: E/AndroidRuntime(380): at java.lang.reflect.Method.invoke(Method.java:507)
06-26 17:07:09.898: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
06-26 17:07:09.898: E/AndroidRuntime(380): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
06-26 17:07:09.898: E/AndroidRuntime(380): at dalvik.system.NativeStart.main(Native Method)
The solution to this problem is to create a folder named "libs" in the project directory and copying all the external jar files there.
For further explanation, you can refer to this link.
http://tools.android.com/recent/dealingwithdependenciesinandroidprojects
I think what you face is that your code compiles , but # run time it crashes . How do i solve this , create a libs folder in your project inside eclipse(if its not exist) and add the jar file that contains the org.mythrii.email.Mail class inside the libs folder , Then run you app .

Categories

Resources