mayur rahatekar
mayur rahatekar

Reputation: 4460

Run-time error when attempting to run a demo phone gap application

I want to run an Android application by using phonegap. I want to just run a simple demo application which has been given on this link.

I have put the phonegap-1.4.1.jar inside the libs folder and www inside the asset folder.

But I am getting a compile time error on the following lines of code:

import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;
    public class PhonegapActivity extends DroidGap
    {
        @Override
        public void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            super.loadUrl("file:///android_asset/www/index.html");
        }
    }

I am getting a run time error inside the manifest file also on the following code:

<supports-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="true"
        android:xlargeScreens="true"
        android:resizeable="true"
        android:anyDensity="true"
        />

Error is : error: No resource identifier found for attribute 'xlargeScreens' in package 'android

The android enviroment is installed properly on my system. Normal android applications are running properly but when I try to run the phone gap application above, this error is coming. For phonegap is there any other plugins required to Install so that my application will run properly?

Upvotes: 1

Views: 1918

Answers (3)

Sudhindra
Sudhindra

Reputation: 11

I could not help but delete the support-screens tags and attributes from the manifest file... $<supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" android:resizeable="true" android:anyDensity="true" /> also i did the changes in the default.properties, where the following line had to be altered...

target=android-8

it all worked for me because I wanted to run the app only on the emulator. and see its look and feel... but from what i have come to read the Android verion 2.2 and API level 8 are not sufficient to run our app on the Tab(Eg: Galaxy Tab)... if so please do check out and anyone who finds out do post your findings...

Upvotes: 1

Paul Beusterien
Paul Beusterien

Reputation: 29572

PhoneGap is designed to be built with the most recent Android build targets. You should support early Android versions (back to 2.1) by setting minSdk in AndroidManifest.xml, not be setting an old build target.

If you're using the Eclipse project creation wizard, set Minimum SDK on the Application Info pane, then click Back to reset the Build Target to the highest before clicking Finish.

Upvotes: 1

Tanmay Mandal
Tanmay Mandal

Reputation: 40168

xlargeScreens has been introduced in API Level 9.

http://developer.android.com/guide/topics/manifest/supports-screens-element.html#xlarge

For that you need to use at least android API Level 9 for android:xlargeScreens to be recognized in you AndroidManifest.xml.

Please make sure that you are building your project on atleast android 2.3.3 Sdk.

Upvotes: 1

Related Questions