# Android resource linking failed

**URL:** <https://bbs.aprbrother.com/t/android-resource-linking-failed/1396>\
**Category:** AprilBeacon\
**Created:** [December 10, 2018, 2:08pm UTC](https://bbs.aprbrother.com/t/android-resource-linking-failed/1396 "2018-12-10T14:08:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wanchart](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/w/13edae/32.png) [@wanchart](https://bbs.aprbrother.com/u/wanchart)\
**Post date:** [December 10, 2018, 2:08pm UTC](https://bbs.aprbrother.com/t/android-resource-linking-failed/1396/1 "2018-12-10T14:08:22Z")

</div>

小弟為Android studio新手，用了AS 開啟github上提供的AprilBeaconDemos\_android\_studio文件出現以下錯誤訊息，請問如何解決，另外文件中的R都會出現紅色的錯誤`cannot resolve symbol 'R'`，不知道是否有關連。

```
   Android resource linking failed
Output: warn: removing resource com.aprbrother.aprilbeacondemos:string/advinterval without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/battery without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/cancel without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_model_to_ibeacon without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_model_to_ibeacon_uid_url without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_model_to_uid without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_model_to_ulr without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_uid without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_uid_custom without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_uid_name_space without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/change_url without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/current_model without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/firmware_version without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/getBattery without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/get_advinterval without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/get_device_info without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/get_firmware_version without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/get_manufacturer without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/get_transmitting_power without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/input_password without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/manufacturer without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/modify_beacon without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/start_background_notify without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/start_modify without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/sure without required default value.
warn: removing resource com.aprbrother.aprilbeacondemos:string/transmitting_power without required default value.
E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/fontStyle not found.
E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/font not found.
E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/fontWeight not found.
error: failed linking references.

Command: C:\Users\user\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\4b861536d966c8af1cbf767deafa585e\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
        C:\Users\user\AppData\Local\Android\Sdk\platforms\android-25\android.jar\
        --manifest\
        E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.aprbrother.aprilbeacondemo\
        -0\
        apk\
        --output-text-symbols\
        E:\Users\user\AndroidStudioProjects\AprilBeaconDemos_android_studio\app\build\intermediates\symbols\debug\R.txt\
        --no-version-vectors
Daemon: AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
```

---

<div class="post-metadata">

**Author:** ![hell](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/h/278dde/32.png) [@hell](https://bbs.aprbrother.com/u/hell)\
**Post date:** [December 11, 2018, 1:18am UTC](https://bbs.aprbrother.com/t/android-resource-linking-failed/1396/2 "2018-12-11T01:18:19Z")

</div>

E:\Users\user\AndroidStudioProjects\AprilBeaconDemos\_android\_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/fontStyle not found.  
E:\Users\user\AndroidStudioProjects\AprilBeaconDemos\_android\_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/font not found.  
E:\Users\user\AndroidStudioProjects\AprilBeaconDemos\_android\_studio\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:208: error: resource android:attr/fontWeight not found

---

<div class="post-metadata">

**Author:** ![hell](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/h/278dde/32.png) [@hell](https://bbs.aprbrother.com/u/hell)\
**Post date:** [December 11, 2018, 1:22am UTC](https://bbs.aprbrother.com/t/android-resource-linking-failed/1396/3 "2018-12-11T01:22:13Z")

</div>

在project的build.gradle中添加  
`maven { url "https://maven.google.com" }`

---

<div class="post-metadata">

**Author:** ![a076902768](https://bbs.aprbrother.com/letter_avatar_proxy/v4/letter/a/8e8cbc/32.png) [@a076902768](https://bbs.aprbrother.com/u/a076902768)\
**Post date:** [February 25, 2019, 10:18am UTC](https://bbs.aprbrother.com/t/android-resource-linking-failed/1396/4 "2019-02-25T10:18:30Z")

</div>

hello hell!， 我在build apk時也遇到這個問題 maven也加入了build.gradle中，但是仍然沒有作用
