cashmere
cashmere

Reputation: 925

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

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?

Upvotes: 9

Views: 11001

Answers (5)

naphier
naphier

Reputation: 276

Had this error and couldn't kick it. Some how my build settings had API 13 selected... Selected API 21 and yay no more issue!

Upvotes: 0

aimiliano
aimiliano

Reputation: 1145

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 :)

Upvotes: 3

cashmere
cashmere

Reputation: 925

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.

Upvotes: 3

Troy Yuan-Ting Wu
Troy Yuan-Ting Wu

Reputation: 171

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

Upvotes: 15

Jose L Ugia
Jose L Ugia

Reputation: 6260

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

Upvotes: 3

Related Questions