Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait')

Tags:

android

I imported android project an I got 3 errors

error: Error: String types not allowed (at 'screenOrientation' with value 'sensorPortait'). AndroidManifest.xml /com.cartmillimaging.fishingmate.MapViewActivity    line 16 Android AAPT Problem

same error on different lines.

<activity android:name=".MapViewActivity" android:screenOrientation="sensorPortait">

For project build target I have selected Google APIs 2.3.3. 10. I also enabled Java compiler project specific settings and put compiler compliance error to 1.6.

I am new to android development, so can you help me?

like image 591
cashmere Avatar asked Aug 26 '12 11:08

cashmere


4 Answers

checkout your API level. The following attributes:

android:screenOrientation="sensorPortrait" only can work on API level 16+

android:screenOrientation="sensorPortait" can work under level 15

I think it's a fixed bug

like image 76
Troy Yuan-Ting Wu Avatar answered Nov 15 '22 21:11

Troy Yuan-Ting Wu


There's a typo error in the value. The correct name is "sensorPortrait"

like image 42
Jose L Ugia Avatar answered Nov 15 '22 19:11

Jose L Ugia


when you load project I get this error (I use api level 10). I found solution for this. You change screenOrientation to something else, save it, and then return to sensorPortait and everything now is working.

like image 22
cashmere Avatar answered Nov 15 '22 21:11

cashmere


Confirmed what cashmere said.

i changed all

android:screenOrientation="sensorPortrait"

to

android:screenOrientation="sensorLandscape"

built the project and then changed it back again for all my activites in the manifest and all works good :)

like image 36
aimiliano Avatar answered Nov 15 '22 20:11

aimiliano