views:

1077

answers:

2

Hey Folks,

I am trying to get the HelloWebView Sample up and running (as is, with no cuustomizations) found at

http://developer.android.com/resources/tutorials/views/hello-webview.html

I continue to get java.lang.SecurityException: Permission Denial despite all efforts. In my mind this has got to be some fundamental lack of understanding on my part (I am a newbie) or something perhaps local to my development environment (Windows XP).

I have included my main.xml, AndroidManifest.xml, and console output below.

Things tried so far:

  • different api's (6,7)
  • adding/verifying (I think :)) that "uses-permission android:name="android.permission.INTERNET"" has the correct syntax and location in my manifest.
  • wiping emulator
  • restarting eclipse, laptop etc.
  • disabling my internet security

Any help would be greatly appreciated.

Thank you. Tim

my main xml is:

<?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> 

my manifest file is:

<uses-permission android:name="android.permission.INTERNET" />

<application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".HelloWebView"
              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=".HelloWebView" android:label="@string/app_name"
 android:theme="@android:style/Theme.NoTitleBar">
    </activity> 

</application>

Actual console output:


[2010-06-04 07:57:06 - HelloWebView] Android Launch! [2010-06-04 07:57:06 - HelloWebView] adb is running normally. [2010-06-04 07:57:06 - HelloWebView] Performing com.example.hellowebview.HelloWebView activity launch [2010-06-04 07:57:06 - HelloWebView] Automatic Target Mode: launching new emulator with compatible AVD 'AndroidGM2.1' [2010-06-04 07:57:06 - HelloWebView] Launching a new emulator with Virtual Device 'AndroidGM2.1' [2010-06-04 07:57:08 - HelloWebView] New emulator found: emulator-5554 [2010-06-04 07:57:08 - HelloWebView] Waiting for HOME ('android.process.acore') to be launched... [2010-06-04 07:57:34 - HelloWebView] WARNING: Application does not specify an API level requirement! [2010-06-04 07:57:34 - HelloWebView] Device API version is 7 (Android 2.1) [2010-06-04 07:57:34 - HelloWebView] HOME is up on device 'emulator-5554' [2010-06-04 07:57:34 - HelloWebView] Uploading HelloWebView.apk onto device 'emulator-5554' [2010-06-04 07:57:35 - HelloWebView] Installing HelloWebView.apk... [2010-06-04 07:57:46 - HelloWebView] Success! [2010-06-04 07:57:47 - HelloWebView] Starting activity com.example.hellowebview.HelloWebView on device [2010-06-04 07:57:55 - HelloWebView] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.hellowebview/.HelloWebView } [2010-06-04 07:57:55 - HelloWebView] ActivityManager: java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.hellowebview/.HelloWebView } from null (pid=-1, uid=-1) requires null

A: 

Hi Tim this exception is related to API Version, for example I use Android 1.5 so I add to my AndroidManifest.xml file

<uses-sdk android:minSdkVersion="3" />

check your messages output...

[2010-06-04 07:57:34 - HelloWebView] WARNING: Application does not specify an API level requirement! 
[2010-06-04 07:57:34 - HelloWebView] Device API version is 7 (Android 2.1)
Jorgesys
I updated the minSdkVersion but still had the same problem. I decided to backoff from a recent SDK and try version 3 to get grounded.Using version 3 I still cannot get the app to run and now get the following console output:[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....
wide-angle
A: 

Thank you. I will update and try again. ...and maybe a little more reading as well. ;)

Tim