Android INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION while installing apk on emulator - android

I created a debug apk (on Windows) from command line using
gradlew assembleDebug
When I try to install it on a emulator using
adb install app/build/outputs/apk/debug/app-debug.apk
I get following message:
1057 KB/s (419548 bytes in 0.387s)
pkg: /data/local/tmp/app-debug.apk
Failure [INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION]
I ran adb logcat in a separate terminal window and it shows below trace:
D/AndroidRuntime( 203): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 203): CheckJNI is ON
D/AndroidRuntime( 203): --- registering native functions ---
D/ddm-heap( 203): Got feature list request
D/PackageParser( 52): Scanning package: /data/app/vmdl65951.tmp
W/ResourceType( 52): Bad string block: string #1 extends to 2847, past end at 68
W/PackageParser( 52): /data/app/vmdl65951.tmp
W/PackageParser( 52): java.lang.IndexOutOfBoundsException
W/PackageParser( 52): at android.content.res.StringBlock.nativeGetString(Native Method)
W/PackageParser( 52): at android.content.res.StringBlock.get(StringBlock.java:81)
W/PackageParser( 52): at android.content.res.AssetManager.getPooledString(AssetManager.java:258)
W/PackageParser( 52): at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:675)
W/PackageParser( 52): at android.content.res.TypedArray.getValueAt(TypedArray.java:659)
W/PackageParser( 52): at android.content.res.TypedArray.peekValue(TypedArray.java:620)
W/PackageParser( 52): at android.content.pm.PackageParser.parseApplication(PackageParser.java:1351)
W/PackageParser( 52): at android.content.pm.PackageParser.parsePackage(PackageParser.java:734)
W/PackageParser( 52): at android.content.pm.PackageParser.parsePackage(PackageParser.java:390)
W/PackageParser( 52): at com.android.server.PackageManagerService.installPackageLI(PackageManagerService.java:4275)
W/PackageParser( 52): at com.android.server.PackageManagerService.access$1600(PackageManagerService.java:109)
W/PackageParser( 52): at com.android.server.PackageManagerService$5.run(PackageManagerService.java:3779)
W/PackageParser( 52): at android.os.Handler.handleCallback(Handler.java:587)
W/PackageParser( 52): at android.os.Handler.dispatchMessage(Handler.java:92)
W/PackageParser( 52): at android.os.Looper.loop(Looper.java:123)
W/PackageParser( 52): at android.os.HandlerThread.run(HandlerThread.java:60)
D/AndroidRuntime( 203): Shutting down VM
D/dalvikvm( 203): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 203): DestroyJavaVM shutting VM down
How can I fix this?
My build.gradle looks like below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 7
buildToolsVersion "27.0.0"
defaultConfig {
applicationId "myApp"
minSdkVersion 7
targetSdkVersion 7
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
applicationIdSuffix ".debug"
debuggable true
}
}
}
and my AndroidManifest.xml is like below:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="myApp"
android:versionCode="5"
android:versionName="2" >
<uses-sdk android:minSdkVersion="7" />
<supports-screens android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".Main"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DisplayForm"
class=".Aarti" >
</activity>
</application>
</manifest>

I think you should use compileSdkVersion and targetSdkVersion 27 with buildToolsVersion 27 in build.gradle

Related

Android application not showing

I am developing an Android application and I am testing it on the emulator.
Recently, I got a strange behavior, I launch my application, it seems it has started but the activty isn't showing up.
I start my application with the activity MainActivity, which is in com.mypackage.myapp package.
In my logcat I have the following messages
08-24 17:31:30.578: I/ActivityManager(1116): 2353 START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.mypackage/.myapp.activities.MainActivity} from pid 1546
08-24 17:31:30.638: D/PermissionCache(915): checking android.permission.READ_FRAME_BUFFER for uid=1000 => granted (70 us)
08-24 17:31:30.638: I/dalvikvm(916): Starting: com.mypackage with UID: 10018
08-24 17:31:30.638: I/AppDB(916): App database successfully initialized
08-24 17:31:30.638: D/AndroidRuntime(1546): Shutting down VM
08-24 17:31:30.638: D/dalvikvm(1546): GC_CONCURRENT freed 100K, 77% free 481K/2048K, paused 0ms+0ms
08-24 17:31:30.638: W/WindowManager(1116): Failure taking screenshot for (306x489) to layer 21005
08-24 17:31:30.648: D/jdwp(1546): Got wake-up signal, bailing out of select
08-24 17:31:30.648: D/dalvikvm(1546): Debugger has detached; object registry had 1 entries
08-24 17:31:30.658: D/dalvikvm(916): Executing: "/system/bin/ndc fw connect 10018 com.mypackage"
08-24 17:31:30.658: I/AndroidRuntime(1546): NOTE: attach of thread 'Binder Thread #3' failed
08-24 17:31:30.658: D/NetD(1556): NETD command: fw connect 10018 com.mypackage
08-24 17:31:30.658: I/FWController(912): App(com.mypackage): already connected
08-24 17:31:30.658: D/dalvikvm(1557): Not late-enabling CheckJNI (already on)
08-24 17:31:30.658: I/ActivityManager(1116): Start proc com.mypackage for activity com.mypackage/.myapp.activities.MainActivity: pid=1557 uid=10018 gids={3003}
08-24 17:31:30.668: D/dalvikvm(1116): GREF has increased to 401
08-24 17:31:31.508: I/MainActivity(1557): Prepayment
08-24 17:31:31.508: W/WindowManager(1116): Failure taking screenshot for (306x489) to layer 21010
I can't seem to find where the problem comes from.
The weird thing is that the application continue to run and I can see the log messages I've set up when the app runs normally.
Here is my manifest file :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mypackage"
android:versionCode="19"
android:versionName="2.2.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="#drawable/image"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".myapp.activities.AwardActivity"
android:label="#string/title_activity_discount" >
</activity>
<activity
android:name=".myapp.activities.EnrollmentActivity"
android:label="#string/title_activity_enrollment" >
</activity>
<activity
android:name=".myapp.activities.ErrorActivity"
android:label="#string/title_activity_error" >
</activity>
<activity
android:name=".myapp.activities.LocalDialogActivity"
android:label="#string/title_activity_local_dialog" >
</activity>
<activity
android:name=".myapp.activities.LoyaltyActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity>
</application>
</manifest>
Any ideas would be welcome.

Issues with ActionBarSherlock - Install fails on Android 2.3.7

I have a problem using ActionBarSherlock in one of my projects. My App installs fine when pushing it to my Nexus 4, but when I try to install it to my HTC Desire (CM7 with Android 2.3.7 - API Level 10) I get the following error.
[2013-02-03 18:47:44 - MyApp] Project dependency found, installing: Actionbar
[2013-02-03 18:47:44 - Actionbar] Uploading Actionbar.apk onto device 'HT042PL03910'
[2013-02-03 18:47:44 - Actionbar] Installing Actionbar.apk...
[2013-02-03 18:47:47 - Actionbar] Installation error: INSTALL_FAILED_OLDER_SDK
[2013-02-03 18:47:47 - Actionbar] Please check logcat output for more details.
[2013-02-03 18:47:47 - MyApp] Launch canceled!
I am using Sherlock 4.2.0 as a libraryproject and added the R11 of android-support-v4. Sherlock itself is configured like this:
Manifest:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16"/>
Project-Properties:
android.library=true
# Project target.
target=android-14
My application uses the following settings:
Manifest:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="16" />
Project-Properties:
target=Google Inc.:Google APIs:16
android.library.reference.1=../ActionbarSherlock
I went through the whole logcat output but couldn't find anything helpful. Has anybody else experienced this and can help me?
========= EDIT ===============
Manifest of my App (mindSdk changed to 8):
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.hsrm.medieninf.mobcomp.klingelapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<permission
android:name="de.hsrm.medieninf.mobcomp.klingelapp.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="de.hsrm.medieninf.mobcomp.klingelapp.permission.C2D_MESSAGE" />
<!-- App receives GCM messages. -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<!-- GCM connects to Google Services. -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- GCM requires a Google account. -->
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock.Light" >
<uses-library android:name="com.google.android.maps" />
(...Activities and Services here ...)
</application>
</manifest>
Full Logcat from new Emulator AVD with Google APIs Level 10:
02-03 21:09:59.647: I/PackageManager(77): Removing non-system package:de.hsrm.medieninf.mobcomp.klingelapp
02-03 21:09:59.647: I/ActivityManager(77): Force stopping package de.hsrm.medieninf.mobcomp.klingelapp uid=10038
02-03 21:09:59.877: D/dalvikvm(77): GC_CONCURRENT freed 1369K, 49% free 5484K/10631K, external 3226K/4029K, paused 4ms+12ms
02-03 21:09:59.977: D/PackageManager(77): Scanning package de.hsrm.medieninf.mobcomp.klingelapp
02-03 21:09:59.977: I/PackageManager(77): Package de.hsrm.medieninf.mobcomp.klingelapp codePath changed from /data/app/de.hsrm.medieninf.mobcomp.klingelapp-1.apk to /data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk; Retaining data and using new
02-03 21:09:59.977: I/PackageManager(77): Unpacking native libraries for /data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk
02-03 21:10:00.047: D/installd(35): DexInv: --- BEGIN '/data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk' ---
02-03 21:10:04.096: D/dalvikvm(598): DexOpt: load 250ms, verify+opt 957ms
02-03 21:10:04.306: D/installd(35): DexInv: --- END '/data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk' (success) ---
02-03 21:10:04.306: W/PackageManager(77): Code path for pkg : de.hsrm.medieninf.mobcomp.klingelapp changing from /data/app/de.hsrm.medieninf.mobcomp.klingelapp-1.apk to /data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk
02-03 21:10:04.306: W/PackageManager(77): Resource path for pkg : de.hsrm.medieninf.mobcomp.klingelapp changing from /data/app/de.hsrm.medieninf.mobcomp.klingelapp-1.apk to /data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk
02-03 21:10:04.306: D/PackageManager(77): Services: de.hsrm.medieninf.mobcomp.klingelapp.GCMIntentService de.hsrm.medieninf.mobcomp.klingelapp.services.LocationService de.hsrm.medieninf.mobcomp.klingelapp.services.SyncService de.hsrm.medieninf.mobcomp.klingelapp.services.AppService de.hsrm.medieninf.mobcomp.klingelapp.services.AuthService
02-03 21:10:04.306: D/PackageManager(77): Receivers: com.google.android.gcm.GCMBroadcastReceiver
02-03 21:10:04.306: D/PackageManager(77): Activities: de.hsrm.medieninf.mobcomp.klingelapp.ui.LoginActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.MessageEditor de.hsrm.medieninf.mobcomp.klingelapp.ui.StartActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.ContactsActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.KlingelSettings de.hsrm.medieninf.mobcomp.klingelapp.ui.NewStartActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.MessagesActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.MessageDetails de.hsrm.medieninf.mobcomp.klingelapp.ui.RegisterActivity de.hsrm.medieninf.mobcomp.klingelapp.ui.FriendRequestActivity
02-03 21:10:04.306: D/PackageManager(77): Permissions: de.hsrm.medieninf.mobcomp.klingelapp.permission.C2D_MESSAGE
02-03 21:10:04.326: I/ActivityManager(77): Force stopping package de.hsrm.medieninf.mobcomp.klingelapp uid=10038
02-03 21:10:04.436: I/installd(35): move /data/dalvik-cache/data#app#de.hsrm.medieninf.mobcomp.klingelapp-2.apk#classes.dex -> /data/dalvik-cache/data#app#de.hsrm.medieninf.mobcomp.klingelapp-2.apk#classes.dex
02-03 21:10:04.436: D/PackageManager(77): New package installed in /data/app/de.hsrm.medieninf.mobcomp.klingelapp-2.apk
02-03 21:10:04.446: W/PackageManager(77): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
02-03 21:10:04.446: W/PackageManager(77): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
02-03 21:10:04.457: W/PackageManager(77): Unknown permission com.google.android.gm.permission.WRITE_GMAIL in package com.android.settings
02-03 21:10:04.457: W/PackageManager(77): Unknown permission com.google.android.gm.permission.READ_GMAIL in package com.android.settings
02-03 21:10:04.466: W/PackageManager(77): Unknown permission android.permission.READ_OWNER_DATA in package com.android.email
02-03 21:10:04.476: W/PackageManager(77): Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
02-03 21:10:04.476: W/PackageManager(77): Not granting permission android.permission.DEVICE_POWER to package com.android.deskclock (protectionLevel=2 flags=0x8be45)
02-03 21:10:04.606: I/ActivityManager(77): Force stopping package de.hsrm.medieninf.mobcomp.klingelapp uid=10038
02-03 21:10:04.706: D/dalvikvm(260): GC_EXPLICIT freed 1K, 49% free 3020K/5831K, external 4756K/5631K, paused 67ms
02-03 21:10:04.746: D/dalvikvm(226): GC_EXPLICIT freed 94K, 51% free 2964K/5959K, external 1625K/2137K, paused 75ms
02-03 21:10:04.806: W/RecognitionManagerService(77): no available voice recognition services found
02-03 21:10:04.856: D/GTalkService(287): handlePackageInstalled: re-initialize providers
02-03 21:10:04.856: D/GTalkService(287): [RawStanzaProvidersMgr] ##### searchProvidersFromIntent
02-03 21:10:04.856: D/GTalkService(287): [RawStanzaProvidersMgr] no intent receivers found
02-03 21:10:05.136: I/Launcher(260): setLoadOnResume
02-03 21:10:05.226: D/dalvikvm(77): GC_EXPLICIT freed 1202K, 54% free 4962K/10631K, external 3226K/4029K, paused 75ms
02-03 21:10:05.256: I/installd(35): unlink /data/dalvik-cache/data#app#de.hsrm.medieninf.mobcomp.klingelapp-1.apk#classes.dex
02-03 21:10:05.296: D/AndroidRuntime(589): Shutting down VM
02-03 21:10:05.306: D/dalvikvm(589): GC_CONCURRENT freed 101K, 72% free 295K/1024K, external 0K/0K, paused 0ms+1ms
02-03 21:10:05.306: D/jdwp(589): Got wake-up signal, bailing out of select
02-03 21:10:05.306: D/dalvikvm(589): Debugger has detached; object registry had 1 entries
02-03 21:10:05.326: I/dalvikvm(589): JNI: AttachCurrentThread (from ???.???)
02-03 21:10:05.326: I/AndroidRuntime(589): NOTE: attach of thread 'Binder Thread #3' failed
02-03 21:10:06.686: D/AndroidRuntime(604): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
02-03 21:10:06.686: D/AndroidRuntime(604): CheckJNI is ON
02-03 21:10:07.106: D/AndroidRuntime(604): Calling main entry com.android.commands.pm.Pm
02-03 21:10:07.196: D/dalvikvm(442): GC_EXPLICIT freed 10K, 51% free 2727K/5511K, external 1625K/2137K, paused 43ms
02-03 21:10:07.206: W/ActivityManager(77): No content provider found for:
02-03 21:10:07.306: W/ActivityManager(77): No content provider found for:
02-03 21:10:07.316: D/PackageParser(77): Scanning package: /data/app/vmdl-63285559.tmp
02-03 21:10:07.326: W/PackageParser(77): /data/app/vmdl-63285559.tmp (at Binary XML file line #8): Requires newer sdk version #16 (current version is #10)
So instead of searching for where I went wrong, I checked out a working revision without sherlock. I then added sherlock as a library and made the same changes to my activites I did yesterday. But now, install works fine.

Android google map not showing up on emulator

I am trying to implement this example http://www.javacodegeeks.com/2011/02/android-google-maps-tutorial.html and i have followed exactly all the steps but in the emulator the map doesnt show up it just displays boxes.Does any one have any idea what wrong am i doing.Logcat is below
This is my manifest file,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gmap.com"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".GmapActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:enabled="true"
android:apiKey="0YjDTTmg77HeTG-dfdfdfdfdWovpPSnatfUTrp5MQ"
/>
</LinearLayout>
Logcat
07-20 12:55:21.688: DEBUG/AndroidRuntime(389): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-20 12:55:21.688: DEBUG/AndroidRuntime(389): CheckJNI is ON
07-20 12:55:22.086: DEBUG/AndroidRuntime(389): --- registering native functions ---
07-20 12:55:23.576: DEBUG/AndroidRuntime(389): Shutting down VM
07-20 12:55:23.597: DEBUG/dalvikvm(389): Debugger has detached; object registry had 1 entries
07-20 12:55:24.396: DEBUG/AndroidRuntime(397): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
07-20 12:55:24.396: DEBUG/AndroidRuntime(397): CheckJNI is ON
07-20 12:55:24.686: DEBUG/AndroidRuntime(397): --- registering native functions ---
07-20 12:55:26.046: INFO/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=gmap.com/.GmapActivity }
07-20 12:55:26.156: DEBUG/AndroidRuntime(397): Shutting down VM
07-20 12:55:26.168: DEBUG/dalvikvm(397): Debugger has detached; object registry had 1 entries
07-20 12:55:26.215: INFO/AndroidRuntime(397): NOTE: attach of thread 'Binder Thread #3' failed
07-20 12:55:26.826: WARN/MapActivity(337): Recycling dispatcher com.google.googlenav.datarequest.DataRequestDispatcher#44ef1a08
07-20 12:55:26.856: VERBOSE/MapActivity(337): Recycling map object.
07-20 12:55:27.146: INFO/MapActivity(337): Handling network change notification:CONNECTED
07-20 12:55:27.186: ERROR/MapActivity(337): Couldn't get connection factory client
07-20 12:55:27.416: INFO/ActivityManager(59): Displayed activity gmap.com/.GmapActivity: 964 ms (total 964 ms)
07-20 12:55:27.965: WARN/InputManagerService(59): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#44ee5428 (uid=10034 pid=353)
07-20 12:55:33.666: DEBUG/dalvikvm(353): GC_EXPLICIT freed 9539 objects / 509864 bytes in 180ms
Well this is a small issue of signed key, Actually you have taken map key with your own keystore but currently your application is signed with default android debug.keystore . sign your application with the keystore with which you have generated map key and then install on emulator and run it

Application works in Android 1.5 but not 2.2

The spinning globe application unning on the emulator works on android 1.5 as target but puts out a "force close application" error in android 2.2 target. Where should i look to find the problem ?
I have enclosed the logcat details that I get,
D/MediaScanner( 183): prescan time: 4913ms
D/MediaScanner( 183): scan time: 693ms
D/MediaScanner( 183): postscan time: 45ms
D/MediaScanner( 183): total time: 5651ms
D/MediaScannerService( 183): done scanning volume internal
I/PackageManager( 67): Removing non-system package:com.android.SpinningGlobe
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
D/dalvikvm( 127): GC_EXPLICIT freed 12963 objects / 655936 bytes in 168ms
D/PackageManager( 67): Scanning package com.android.SpinningGlobe
I/PackageManager( 67): Package com.android.SpinningGlobe codePath changed from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk; Retaining data and using new
I/PackageManager( 67): /data/app/com.android.SpinningGlobe-1.apk changed; unpacking
D/installd( 34): DexInv: --- BEGIN '/data/app/com.android.SpinningGlobe-1.apk' ---
D/dalvikvm( 255): DexOpt: load 214ms, verify 229ms, opt 5ms
D/installd( 34): DexInv: --- END '/data/app/com.android.SpinningGlobe-1.apk' success)---
W/PackageManager( 67): Code path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk
W/PackageManager( 67): Resource path for pkg : com.android.SpinningGlobe changing from /data/app/com.android.SpinningGlobe-2.apk to /data/app/com.android.SpinningGlobe-1.apk
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
D/PackageManager( 67): Activities: com.android.SpinningGlobe.GLApp
I/installd( 34): move /data/dalvik-cache/data#app#com.android.SpinningGlobe-1.apk#classes.dex -> /data/dalvik-cache/data#app#com.android.SpinningGlobe-1.apk#classes.dex
D/PackageManager( 67): New package installed in /data/app/com.android.SpinningGlobe-1.apk
I/ActivityManager( 67): Force stopping package com.android.SpinningGlobe uid=10038
I/ActivityManager( 67): Start proc com.svox.pico for broadcast com.svox.pico/.VoiceDataInstallerReceiver: pid=256 uid=10028 gids={}
D/dalvikvm( 167): GC_EXPLICIT freed 3943 objects / 244424 bytes in 1708ms
D/dalvikvm( 67): GC_EXPLICIT freed 7297 objects / 468432 bytes in 667ms
W/RecognitionManagerService( 67): no available voice recognition services found
I/ActivityThread( 256): Publishing provider com.svox.pico.providers.SettingsProvider: com.svox.pico.providers.SettingsProvider
I/installd( 34): unlink /data/dalvik-cache/data#app#com.android.SpinningGlobe-2.apk#classes.dex
D/AndroidRuntime( 118): Shutting down VM
D/jdwp ( 118): adbd disconnected
I/AndroidRuntime( 118): NOTE: attach of thread 'Binder Thread #3' failed
D/AndroidRuntime( 266):
D/AndroidRuntime( 266): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime( 266): CheckJNI is ON
D/AndroidRuntime( 266): --- registering native functions ---
I/ActivityManager( 67): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.android.SpinningGlobe/.GLApp }
D/AndroidRuntime( 266): Shutting down VM
D/jdwp ( 266): adbd disconnected
I/AndroidRuntime( 266): NOTE: attach of thread 'Binder Thread #3' failed
I/ActivityManager( 67): Start proc com.android.SpinningGlobe for activity com.android.SpinningGlobe/.GLApp: pid=273 uid=10038 gids={1015}
I/ARMAssembler( 67): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x32b4a0:0x32b5ac] in 3627836 ns
D/libEGL ( 273): egl.cfg not found, using default config
D/libEGL ( 273): loaded /system/lib/egl/libGLES_android.so
D/dalvikvm( 273): GC_EXTERNAL_ALLOC freed 839 objects / 59328 bytes in 151ms
W/dalvikvm( 273): threadid=7: thread exiting with uncaught exception (group=0x4001d800)
I/ActivityManager( 67): Displayed activity com.android.SpinningGlobe/.GLApp: 4870 ms (total 4870 ms)
E/AndroidRuntime( 273): FATAL EXCEPTION: GLThread 8
E/AndroidRuntime( 273): java.lang.IndexOutOfBoundsException
E/AndroidRuntime( 273): at java.nio.IntArrayBuffer.get(IntArrayBuffer.java:63)
E/AndroidRuntime( 273): at com.android.SpinningGlobe.GLRenderer.onDrawFrame(GLRenderer.java:105)
E/AndroidRuntime( 273): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1332)
E/AndroidRuntime( 273): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
W/ActivityManager( 67): Force finishing activity com.android.SpinningGlobe/.GLApp
I/ARMAssembler( 67): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x33f9a8:0x33fa64] in 1258819 ns
Any insights on where the problem could be ?
You should look at the log from the emulator.
You can get this on the command line using:
adb logcat
Or if you're using the ADT Plugin for Eclipse the log is visible there. If you can't see it select Window ▶ Show View ▶ Other... and then select Android ▶ LogCat.
It's probably also worth reading the Debugging page in the Android Developer Documentation.
Recompile it under 2.2 and look for deprecated warnings

HelloWebView Sample: now using SDK 3 and getting killed

Updated: I have now included the logcat file below. Looking at it it appears I am still having a permission problems (06-05 14:10:36.593) - I am guessing the same problem I am having with SDK 7
Well I was trying to get the HelloWebview example working with SDK 7 with no success (see HelloWebView Sample: java.lang.SecurityException: Permission Denial thread), so I decided just out of curiosity to back off to SDK3 to see if I could learn anything. I have been able to get all the "Layout" samples to work and decided to try something a little harder.
Unfortunately, I still cannot get the simple HelloWebView app to run. I no longer get a Permission Denial but now the app is getting killed.
Killed usually implies that there are not enough resources (memory etc.) for an application to run.... Any thoughts? Are there any other log files I can look at either on my computer or on the emulator?
The main.xml, manifest, and console output are below. Let me know if you need more information.
Thanks,
Tim
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
mainfest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="3" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloWebView3"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HelloWebView3" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
</application>
Console output:
[2010-06-05 08:43:37 - HelloWebView3] ------------------------------
[2010-06-05 08:43:37 - HelloWebView3] Android Launch!
[2010-06-05 08:43:37 - HelloWebView3] adb is running normally.
[2010-06-05 08:43:37 - HelloWebView3] Performing com.example.hellowebview3.HelloWebView3 activity launch
[2010-06-05 08:43:37 - HelloWebView3] Automatic Target Mode: launching new emulator with compatible AVD 'Android1.5'
[2010-06-05 08:43:37 - HelloWebView3] Launching a new emulator with Virtual Device 'Android1.5'
[2010-06-05 08:43:42 - HelloWebView3] New emulator found: emulator-5554
[2010-06-05 08:43:42 - HelloWebView3] Waiting for HOME ('android.process.acore') to be launched...
[2010-06-05 08:45:04 - HelloWebView3] HOME is up on device 'emulator-5554'
[2010-06-05 08:45:04 - HelloWebView3] Uploading HelloWebView3.apk onto device 'emulator-5554'
[2010-06-05 08:45:04 - HelloWebView3] Installing HelloWebView3.apk...
[2010-06-05 08:45:19 - HelloWebView3] Success!
[2010-06-05 08:45:19 - HelloWebView3] Starting activity com.example.hellowebview3.HelloWebView3 on device
[2010-06-05 08:45:23 - HelloWebView3] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }
[2010-06-05 08:45:23 - HelloWebView3] ActivityManager: [1] Killed am start -n com....
logcat output:
06-05 14:10:33.963: DEBUG/AndroidRuntime(763): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-05 14:10:33.963: DEBUG/AndroidRuntime(763): CheckJNI is ON
06-05 14:10:34.232: INFO/jdwp(763): received file descriptor 20 from ADB
06-05 14:10:34.253: DEBUG/AndroidRuntime(763): --- registering native functions ---
06-05 14:10:35.013: DEBUG/AndroidRuntime(763): Shutting down VM
06-05 14:10:35.013: DEBUG/dalvikvm(763): DestroyJavaVM waiting for non-daemon threads to exit
06-05 14:10:35.022: DEBUG/dalvikvm(763): DestroyJavaVM shutting VM down
06-05 14:10:35.032: DEBUG/dalvikvm(763): HeapWorker thread shutting down
06-05 14:10:35.053: DEBUG/dalvikvm(763): HeapWorker thread has shut down
06-05 14:10:35.053: DEBUG/jdwp(763): JDWP shutting down net...
06-05 14:10:35.062: DEBUG/jdwp(763): +++ peer disconnected
06-05 14:10:35.062: INFO/dalvikvm(763): Debugger has detached; object registry had 2 entries
06-05 14:10:35.073: DEBUG/dalvikvm(763): VM cleaning up
06-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa08 len=20
06-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa20 len=340
06-05 14:10:35.112: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410cab78 len=2244
06-05 14:10:35.112: DEBUG/dalvikvm(763): LinearAlloc 0x0 used 632420 of 4194304 (15%)
06-05 14:10:35.561: DEBUG/AndroidRuntime(772): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-05 14:10:35.561: DEBUG/AndroidRuntime(772): CheckJNI is ON
06-05 14:10:35.793: DEBUG/AndroidRuntime(772): --- registering native functions ---
06-05 14:10:35.803: INFO/jdwp(772): received file descriptor 20 from ADB
06-05 14:10:36.593: INFO/ActivityManager(579): Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }
06-05 14:10:36.593: WARN/ActivityManager(579): Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null
06-05 14:10:36.602: DEBUG/AndroidRuntime(772): Shutting down VM
06-05 14:10:36.613: WARN/dalvikvm(772): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
06-05 14:10:36.613: ERROR/AndroidRuntime(772): Uncaught handler: thread main exiting due to uncaught exception
06-05 14:10:36.623: ERROR/AndroidRuntime(772): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
06-05 14:10:36.633: ERROR/AndroidRuntime(772): java.lang.SecurityException: Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.os.Parcel.readException(Parcel.java:1234)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.os.Parcel.readException(Parcel.java:1222)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1046)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.runStart(Am.java:199)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.run(Am.java:73)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.main(Am.java:51)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.internal.os.RuntimeInit.finishInit(Native Method)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at dalvik.system.NativeStart.main(Native Method)
06-05 14:10:36.661: ERROR/JavaBinder(772): Unknown binder error code. 0xfffffff7
06-05 14:10:36.661: ERROR/AndroidRuntime(772): Crash logging skipped, no checkin service
06-05 14:10:36.673: INFO/Process(772): Sending signal. PID: 772 SIG: 9
06-05 14:21:41.081: DEBUG/dalvikvm(626): GC freed 9840 objects / 555600 bytes in 106ms
There are any error messages you can look to. If you're using eclipse goto ddms perspective and open window logcat. (you can also directly display logcat without switching to the ddms perspective)
You have twice
<activity android:name=".HelloWebView3"
In your manifest

Categories

Resources