I am making app for phones, but I wan’t them to be usable on tablets. I don’t know why can’t. I use this in my android manifest file:
android:xlargeScreens="true"
I get this error:
error: No resource identifier found for attribute 'xlargeScreens' in package 'android'
This is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cro.perger.bonbon"
android:versionCode="5"
android:versionName="1.4">
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="11" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".bonbon"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Broadcast Receiver that will process AppWidget updates -->
<receiver android:name=".HelloWidget" android:label="#string/w_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/hello_widget_provider" />
</receiver>
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
</application>
<supports-screens android:resizeable="true"
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:anyDensity="true"/>
<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
<uses-permission android:name="android.permission.CALL_PHONE"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_SMS"/>
</manifest>
What should I do?
Please check your project Build Target To support xlarge screen your project build target should be atleast android 2.3.3 adk.
In Eclipse -?right click on project -> Properties -> Android -> Select Project Build Tagrget as 2.3.3 or onwards
My application supports android versions 1.5 to the latest version and this is what I have in my manifest:
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
This is what shows up on the android market developer site for my app:
Screen layouts: SMALL NORMAL LARGE XLARGE
Required device features
android.hardware.touchscreen
This application is available to over 555 devices.
Also, my project build target is 2.3.3, but I still have many installs on devices running android 3.0
And this is just a guess, im not sure about this, but wouldn't including permissions like CALL_PHONE filter your application from search on a tablet since they dont have that feature?
It looks like you need to build different APKs for older and new versions. Checkout out the blog posted on http://android-developers.blogspot.com/search/label/Android%20Market about multiple APK support: "Multiple APK support gives you a variety of ways to control app distribution. For example, you could use it to create separate APKs for phones and tablets under the same product listing."
You need to use at least android API Level 9 for android:xlargeScreens to be recognized in AndroidManifest.xml.
For this make sure in your default.properties file you have target=android-9 or higher. This also can be set using Project Properties, in Android section.
The problem is your minSdkVersion.
The xlargeScreens-attribute was introduced in API-Level 9. Since you specified that your application will probably run under API-Level 4, android can't find this attribute.
Change the minSdkVersion-attribute to 11 and it should work.
The targetSdkVersion-attribute, which you set to be 11 only indicates that the App was developed to target this version (so it's "recommended"), but the minSdkVersion specifies the minimum API-Level, see here.
What is your API level set to? It says in the documentation that it requires API 9 or higher. 9 is 2.3. See this link which says:
android:xlargeScreens Indicates whether the application supports extra
large screen form-factors. An xlarge screen is defined as a screen
that is significantly larger than a "large" screen, such as a tablet
(or something larger) and may require special care on the
application's part to make good use of it, though it may rely on
resizing by the system to fill the screen. The default value for this
actually varies between some versions, so it's better if you
explicitly declare this attribute at all times. Beware that setting it
"false" will generally enable screen compatibility mode. This
attribute was introduced in API level 9.
android:xlargeScreens :
This attribute was introduced in API level 9 (Android 2.3.3). If you have your build target lesser than API level 9, then you will get error "No resource identifier found for attribute 'xlargeScreens' in package 'android"
Set your build target to API level 9 or above and this error will vanish.
Related
What parts of the Android project makes devices incompatible?
My first project was released, and it's pretty simple. It only works on 6880 devices according do Google Play.
My girlfriend's phone is incompatible, although she always used this app when I installed direct through the .apk file.
The manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="my.project" android:installLocation="auto" android:versionCode="1" android:versionName="1.0">
<application android:label="AppName" android:icon="#drawable/icon" android:allowBackup="true" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" android:hardwareAccelerated="true">
<activity android:name="my.project.AppName" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mnc|mcc|locale|fontScale|uiMode" android:label="Credito">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<!-- Android 2.3.3 -->
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="14" />
<!-- OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" />
<!-- USB support -->
<uses-feature android:name="android.hardware.usb.host" />
<!-- Disable screen compatibility modes -->
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Device compatibility described on here. In general it includes 3 sections:
* Device features;
* Platform version
* Screen configuration;
According to your manifest there are next possible problems:
"android.hardware.usb.host" - app need a device that guaranteed to support the USB host APIs. According to the official documentation:
Because not all Android-powered devices are guaranteed to support the USB host APIs, include a "uses-feature" element that declares that your application uses the android.hardware.usb.host feature.
this basically means that the app might even work on the phone (by direct install for example) till the moment when such API are called.
android:minSdkVersion="9" android:targetSdkVersion="14"
Does your girlfriend's phone have something earlier than Android 2.3.3 (like 2.2)? And again, this does not means that it won't work, it just means that it might fail on her phone if there is a call to any method that is not exists prior to the Android 2.3.
uses-feature android:glEsVersion="0x00020000"
This should not be a problem since:
OpenGL ES 2.0 - This API specification is supported by Android 2.2 (API level 8) and higher.
screen resolutions also should not be a problem since you have switched on all 4 possible major resolutions.
I have developed and Simple android application in Java and also uploaded it on play.google.com. I uploaded successfully and also published well and I made all steps to published and save the app.after publishing it is showing on app store.Problem is that when I searched the app on my android device then it give the error of "This item is not compatible with your device". I don't understand why this error is being occurred. Kindly any one tell me how can I make and android app which is compatible with all versions of android or any other method through which my app should sun on all android devices.
Here is my manifest file code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sml.sml.pkg"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity
android:name=".SMLActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
There are a number of reasons why this might occur. Most likely you are either:
Not specifying the correct minimum SDK your application is compatible with. To do this, you should add to your AndroidManifest.xml the following.
<uses-sdk android:minSdkVersion="#" />
where the # should be replaced with the integer corresponding to the minimum SDK number your application supports. For example, if your application has features that are supported by Gingerbread (API 10) but not Froyo (API 8), then you should specify the number to be 10. Note that you rarely want to add the android:maxSdkVersion attribute, as this will prevent devices from using your application when new SDK versions are released.
Your application uses a feature that is not supported by your device. This might be the case if you have declared in your manifest the <uses-feature> tag.
Edit:
I just saw the code you added to your original post. Your code, specifically, <uses-sdk android:minSdkVersion="15" />, will prevent Android devices running Android versions lower than 15 from using your device. To allow older versions to use your application, you'll need to lower this number. Make sure you are 100% certain that the SDK you choose supports 100% of the features that your application requires.
you need to provide android:minSdkVersion & android:maxSdkVersion in AndroidManifest.xml.
i think your mobile version is not supported to the version you implemented in your project. So, in Androidmanifest file just follow the following changes as shown......
Androidmanifest.xml
<uses-sdk android:minSdkVersion="7" android:maxSdkVersion="11"/>
provide those versions based on your mobile version also. if you are using android 2.2 means its API level is 8. so provide minSdkVersion as 8.
There are numerous helpful posts regarding this topic but all require me to use a later sdk than I have written my app for.In an effort to make my app as backwards compatible as possible I chose to create it using Android 1.5 (sdk v 3).
With the code suggested for declaring the manifest I have some issues with eclipse giving me an error as the code refers to later sdk functions not available in Android 1.5
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
/>
Eclipse is telling me that everything after orientation is the problem.
error: Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize').
Can someone please point me in the right direction insofar as code for the manifest or how to compile for a later target?
Cheers!!
Ok.....here is the code from the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ohmywebdesign.trigsolver"
android:versionCode="5"
android:versionName="1.3" >
<uses-sdk android:minSdkVersion="8" />
<uses-sdk android:targetSdkVersion="8" />
<uses-sdk android:maxSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:icon="#drawable/icon"
android:label="#string/app_name" >
<meta-data android:value="YOURPUBIDHERE" android:name="ADMOB_PUBLISHER_ID" />
<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Something like this:
<uses-sdk android:minSdkVersion="3" />
<uses-sdk android:targetSdkVersion="8" />
<uses-sdk android:maxSdkVersion="15" />
In you manifest will allow you to do what you want.
Also, be sure you have the latest AdMob SDK ie version 4.3.1 http://code.google.com/mobile/ads/download.html
and that you include
<meta-data android:value="YOURPUBIDHERE" android:name="ADMOB_PUBLISHER_ID" />
As MisterSquonk's comment on the question stated, some of the configChanges values were introduced in API levels higher than that of 1.5. Merely changing the values of the minimum/target/maximum API levels in the manifest alone won't solve your issue, you have to make sure to build against an SDK level that declares those values.
For Ant-based builds, this would entail altering the target property's value in project.properties; I don't use Eclipse for my Android projects, so I'm not 100% sure, but here's an excerpt from the Eclipse/ADT documentation that seems relevant to what you'd need to do:
Note: You can change your the Build Target for your project at any time: Right-click the project in the Package Explorer, select Properties, select Android and then check the desired Project Target.
Of course, if you do this, you have to ensure not to directly use any classes/methods from API levels higher than your minimum, or your application will fail at runtime when run on devices implementing lower API levels.
Remember, the manifest is only used at runtime on the device (and by most distribution channels, such as the Android Market). The build target is something completely separate which is used at compile-time.
when I tried to add
android:installLocation="auto"
in my AndroidManifest.xml file I found the following error in eclipse
error: No resource identifier found for attribute "installLocation" in package "android"
how to overcome this problem ?
edited :
My Manifest file is :
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="1"
android:versionName="1.0"
package="com.xxxx.yyyy">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:label="#string/app_name" android:icon="#drawable/icon">
<activity
android:screenOrientation="portrait"
android:name=".StarterActivity"
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:screenOrientation="portrait"
android:name="GamePlayActivity"></activity>
<activity
android:screenOrientation="portrait"
android:name="LoginActivity"></activity>
<activity
android:screenOrientation="portrait"
android:name="SignupActivity"></activity>
<activity
android:screenOrientation="portrait"
android:name="MainMenuActivity"></activity>
<activity
android:screenOrientation="portrait"
android:name="InfoActivity"></activity>
<activity
android:screenOrientation="portrait"
android:name="ViewScoreActivity"></activity>
<activity
android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"></activity>
</application>
<uses-sdk
android:minSdkVersion="7"
/>
</manifest>
error is showing in line
android:installLocation="auto"
Thanks
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation=["auto" | "internalOnly" | "preferExternal"] >
. . .
</manifest>
Introduced in: API Level 8.
Backward Compatibility
The ability for your application to install on the external storage is a feature available only on devices running API Level 8 (Android 2.2) or greater. Existing applications that were built prior to API Level 8 will always install on the internal storage and cannot be moved to the external storage (even on devices with API Level 8). However, if your application is designed to support an API Level lower than 8, you can choose to support this feature for devices with API Level 8 or greater and still be compatible with devices using an API Level lower than 8.
To allow installation on external storage and remain compatible with versions lower than API Level 8:
Include the android:installLocation attribute with a value of "auto" or "preferExternal" in the element.
Leave your android:minSdkVersion attribute as is (something less than "8") and be certain that your application code uses only APIs compatible with that level.
In order to compile your application, change your build target to API Level 8. This is necessary because older Android libraries don't understand the android:installLocation attribute and will not compile your application when it's present.
When your application is installed on a device with an API Level lower than 8, the android:installLocation attribute is ignored and the application is installed on the internal storage.
Caution: Although XML markup such as this will be ignored by older platforms, you must be careful not to use programming APIs introduced in API Level 8 while your minSdkVersion is less than "8", unless you perform the work necessary to provide backward compatibility in your code. For information about building backward compatibility in your application code, see the Backward Compatibility article.
==>
go to eclipse project settings -> SEction "Android" and select at least API Level 8 there.
referenced by user "user370305" as comment:
change your application's api version from properties make it 8 or greater. then its work fine. Look at my edited answer. – user370305 Oct 13 '11 at 8:06
thx && good luck!
:=)
Just a simple XMl file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0"
android:installLocation="auto"
>
<application android:label="#string/app_name">
<activity android:name=".MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Yet, I receive an error
"No resource identifier found for attribute 'installLocation' in
package 'android'"
Why is this happening?
EDIT
It seems that this is an issue with IntelliJ. At least mine. This is the screen of Project Structure. I clicked Android 2.3.3 SDK and changed its build target. I did this after the attribute
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="8"/>
did not do the trick. Any ideas?
You must specify the android:minSdkVersion and android:targetSdkVersion and compile your APK using, at least, API 8. For instance:
....
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="8" />
</manifest>
This will compile the APK using API 8. Handsets running Froyo or above, will be able to use that feature. Eclair and older versions won't (in this case, only Eclair).
The error happens because you are trying to compile the project with an API 7 or older, and installLocation was added on API 8.
Short answer: set your build target to an API level >= 8 and your problem is solved.
Changing the build target is easy:
Right-click the project in the Package Explorer, select Properties, select Android and then check the desired Project Target.
Explanation:
The android:installLocation attribute is available since API level 8, so you'll need to make sure your build target is set to API level 8 or higher, else it will not compile your application.
android:minSdkVersion can be less than 8 and your application will still work on older devices, but devices with API level < 8 will simply ignore the attribute.