10

I am getting this error in the android studio when I am trying to build android code into my device?

error: resource style/Theme.Base (aka com.example.android.bluetoothlegatt:style/Theme.Base) not found. error: failed linking references.

Zoe
  • 27,060
  • 21
  • 118
  • 148
tshivam
  • 137
  • 1
  • 1
  • 7

2 Answers2

5

Use AppTheme in your manifest file check code and see the line where i will comment

     <application
        android:name=".application.MyApplication"
        android:allowBackup="true"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:roundIcon="@drawable/app_icon"
        android:supportsRtl="true"
        android:largeHeap="true"
        android:networkSecurityConfig="@xml/network_security_config"
        android:theme="@style/AppTheme">  // here

Check style have to be like this :

<style name="AppTheme" parent="Theme.AppCompat.Light">
       ....customize Theme....
</style>

and Appcompat library should be updated :

implementation 'com.android.support:appcompat-v7:28.0.0'

and check this link also.

Abhinav Gupta
  • 2,225
  • 1
  • 14
  • 30
  • Yeah i have changed it as : android:theme="@style/AppTheme" But still it is not working. @Abhinav Gupta – tshivam Jan 18 '19 at 11:50
  • I did both the changes as you suggested but still i am getting the error below: error: resource style/Theme.Base (aka com.example.android.bluetoothlegatt:style/Theme.Base) not found. Actually my end goal is to build BLE terminal like application for which i have imported bluetoothLEGATT sample code into android studio. – tshivam Jan 21 '19 at 06:47
  • How to remove the error as below: ERROR: Certificate for doesn't match any of the subject alternative names: [*.iitk.ac.in, iitk.ac.in] – tshivam Jan 21 '19 at 07:36
  • @tshivam check this link : https://stackoverflow.com/a/45159167/7319704 – Abhinav Gupta Jan 21 '19 at 09:49
  • Still facing the same error below @abhinav gupta: Android resource linking failed error: resource style/Theme.Base (aka com.example.android.bluetoothlegatt:style/Theme.Base) not found. error: failed linking references. – tshivam Jan 22 '19 at 10:06
  • @tshivam after 9pm shall we connect on teamviewer? – Abhinav Gupta Jan 22 '19 at 10:09
  • hi i have a question, i am sending ascii text from arduino side and receiving it in android mobile application through bluetooth low energy module. My problem is that on the android side i am getting hexadecimal equivalent symbols along with ascii text characters. i want to remove all hexa decimal symbols from the pattern. – tshivam Jan 30 '19 at 05:18
5

Either change:

style name="AppBaseTheme" 

to

style name="AppTheme" 

in your styles.xml file. Or change:

android:theme="@style/AppTheme"

to

android:theme="@style/AppBaseTheme"

in your manifest application tag.

Both should be the same. Basically, your app is trying to use AppBaseTheme which doesn't exist.