Android Question Holo theme missing resource files

Dario126

Member
Licensed User
Longtime User
If I try to use holo theme I get this error:

AndroidManifest.xml:33: error: Error: No resource found that matches the given name (at 'theme' with value '@android:style/Theme.Holo').

My manifest is this one:
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

SetApplicationAttribute(android:theme, "@android:style/Theme.Holo")

AddManifestText(<uses-permission android:name="android.permission.GET_ACCOUNTS" />)
AddPermission (android.permission.CHANGE_NETWORK_STATE)

What is missing and where do I get it?
What to do??
 

Dario126

Member
Licensed User
Longtime User
No, for compilation it's connected to device with android 4.2.2

but, I was not clear maybe, error above is generated during compilation ..

In SDK manager I have android completely 4.2.2 (API 17) installed, parts of API14 and API 8 (android 8). Also support library, repository library, Google play services and web driver ..

What is missing?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Here barx is referencing to a thema named
B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light")

Maybe yours should be THIS (for light theme) or

B4X:
SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Dark")

for the dark theme!? I dont know... I just saw this fine difference in barxs tutorial and your post...
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Open Basic for Android and go to the menu Tools > Configure Paths

What version of android.jar have you referenced?

The path will look something like this

C:\Program Files\Android\sdk\platforms\android-17\android.jar

This one being version 17
 
Upvote 0

Dario126

Member
Licensed User
Longtime User
Thank You both.

After "Tools > Configure Paths" set to "android-17" (previously was -8) I can compile without error.
And default "Theme.Holo" was giving me black menus, and modifications "Theme.Holo.Light" gives mi wished white menus.

One more verification. If I use this in manifest
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="19"/>

and compile with "android-17", then still older devices with android 10 (example) can run app ?
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
I believe if you wish to target V19 and use features available in V19 then you should compile with V19. I generally always compile with the latest. They backwards compatible. So yes, if you compile with V19 (or 17) older devices will run the app; but if you use features that are only available in higher versions and don't use any version checking, you could get errors.

An example in your instance would be the Holo theme. If you state the application to use Holo or Holo Light and then run the app on a device with Gingerbread installed, you will get an error. As the Holo theme simply doesn't exist.
 
Upvote 0
Top