3

I'm getting this error when trying to run my android application.

The strange thing: It only happens when the android application was built (and signed) with Jenkins.

When I use the local apk file from eclipse and push it to my device (or emulator), everything works fine

Any ideas?

Edit: AndroidManifest.xml

<application
    android:name="at.my.test.App"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyActionBarTheme" >
    <activity
        android:name="SplashActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="LoginActivity"
        android:screenOrientation="portrait"
        android:windowSoftInputMode="stateHidden" >
    </activity>
    <activity
        android:name="MyFirstActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="MySecondActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="MyThirdActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="WebActivity"
        android:screenOrientation="portrait" >
    </activity>
    <activity
        android:name="ErrorActivity"
        android:screenOrientation="portrait"
        android:theme="@android:style/Theme.Black.NoTitleBar" >
    </activity>
</application>  

And the themes.xml file:

<style name="MyActionBarTheme" parent="@style/Theme.AppCompat">

    <item name="android:actionBarStyle">@style/MyActionBar</item>
    <item name="android:homeAsUpIndicator">@drawable/ic_up_arrow</item>
    <item name="android:windowActionBar">true</item>
    <item name="android:windowBackground">@android:color/white</item>
    <item name="android:windowContentOverlay">@null</item>

    <!-- Support library compatibility -->
    <item name="actionBarStyle">@style/MyActionBar</item>
    <item name="homeAsUpIndicator">@drawable/ic_up_arrow</item>

</style>

<!-- ActionBar styles -->
<style name="MyActionBar" parent="@style/Widget.AppCompat.ActionBar">

    <item name="android:background">@color/my_highlight</item>

    <!-- Support library compatibility -->
    <item name="background">@color/my_highlight</item>

</style>
user3231849
  • 31
  • 1
  • 1
  • 4
  • Did you use ActionbarCombat or Navigation Drawer in it? – ASP Jan 24 '14 at 11:48
  • It's possible that the resource your theme reference is pointed to is unavailable. Especially if it's on a remote location (e.g. Jenkins server). Make sure you're using either a default (built-in) Holo theme or a theme that is available on local storage. – nstosic Jan 24 '14 at 11:49
  • @NitroNbg The themes should be available to jenkins as they are referenced in my pom.xml. If I remove them from my pom.xml and add them in a library folder the jenkins build fails – user3231849 Jan 24 '14 at 12:05
  • Possible duplicate of [You need to use a Theme.AppCompat theme (or descendant) with this activity](http://stackoverflow.com/questions/21814825/you-need-to-use-a-theme-appcompat-theme-or-descendant-with-this-activity) –  Nov 02 '15 at 06:05

3 Answers3

10

May this will help you to solve your problem. (I haven't familiar with Jenkins.) Please put this attribute to Activity (in which you used the Actionbar/Drawer) in Manifest

android:theme="@style/Theme.AppCompat"
Jared Burrows
  • 54,294
  • 25
  • 151
  • 185
ASP
  • 1,974
  • 3
  • 18
  • 30
  • I edited the original post with my AndroidManifest and themes.xml – user3231849 Jan 24 '14 at 13:05
  • I won't downvote, but this doesn't address the problem. – weberc2 Apr 06 '14 at 19:54
  • @weberc2 This is what "comments" are used for. – Jared Burrows Nov 09 '14 at 04:20
  • @jared-burrows I don't think I understand you. My interaction was, in fact, a comment... – weberc2 Nov 10 '14 at 06:43
  • @weberc2 I know but the purpose of comments is to prevent a downvote or further downvote. I am just saying, you could have said "This does not solve my problem because ...". Add value to your comment. – Jared Burrows Nov 10 '14 at 21:00
  • @jared-burrows If I knew why it didn't work, I would have elaborated. As it is, his answer doesn't even provide a rationale for his snippet, so i can't even posit why it might fail. What would you have me do? – weberc2 Nov 10 '14 at 21:29
  • @weberc2 It is not a big deal, I am just hoping people would explain first before downnvoting is all. Thus, "this is what comments used for". – Jared Burrows Nov 10 '14 at 22:05
  • @weberc2 That's the point. Lol. I am just saying, I hope someone would explain that it didn't work before downvoting. That is why I said, that is what comments are for. – Jared Burrows Nov 10 '14 at 22:09
2

styles.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
</style>

saneryee
  • 3,239
  • 31
  • 22
0

This is happen only for missing styles from values-21,values-18 missing in resource folder in android project or you are not used to declared the correct theme in Manifest in appropriate project.

Mahendran Candy
  • 1,114
  • 17
  • 17