The xml would go like this :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
...
<LinearLayout
    android:id="@+id/headerLayout"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >
 
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:background="@drawable/headerImage"
        android:orientation="vertical" />
 
    <View
        android:layout_width="fill_parent"
        android:layout_height="5dip"
        android:background="@drawable/drop_shadow" >
    </View>
</LinearLayout>
...
cs



drop_shadow.xml :


1
2
3
4
5
6
7
8
9
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">    
    <gradient
        android:startColor="#404040"
        android:endColor="#F1F1F1"
        android:angle="270"
        >
    </gradient>
</shape>
cs



https://stackoverflow.com/questions/14463747/simple-layout-shadow-in-android

https://stackoverflow.com/questions/14463747/simple-layout-shadow-in-android

https://stackoverflow.com/questions/14463747/simple-layout-shadow-in-android

If anyone reading this has the same problem, this happened to me recently, and it was due to having the xml header written twice by mistake:



1
2
3
4
5
6
7
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?> <!-- Remove this one -->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
     <solid android:color="@color/mug_blue"/>
     <corners android:radius="@dimen/featured_radius" />
</shape>
 
cs



The error I was getting was completely unrelated to this file so it was a tough one to find. Just make sure all your new xml files don't have some kind of mistake like this (as it doesn't show up as an error). EDIT It seems like it shows up as an error now, make sure to check your error logs.




실수로 xml 태그 두번 적었을때 발생 가능



https://stackoverflow.com/questions/48549587/failed-linking-file-resource-i-am-getting-this-error-even-after-trying-all-po?rq=1

https://stackoverflow.com/questions/48549587/failed-linking-file-resource-i-am-getting-this-error-even-after-trying-all-po?rq=1

https://stackoverflow.com/questions/48549587/failed-linking-file-resource-i-am-getting-this-error-even-after-trying-all-po?rq=1








gradle.properties에


1
2
3
android.useAndroidX=true
android.enableJetifier=true
 
cs



값 추가 후 gradle sync



https://stackoverflow.com/questions/52497475/android-studio-adds-both-androidx-annotation-and-android-support-annotation-nu

https://stackoverflow.com/questions/52497475/android-studio-adds-both-androidx-annotation-and-android-support-annotation-nu

https://stackoverflow.com/questions/52497475/android-studio-adds-both-androidx-annotation-and-android-support-annotation-nu


+ Recent posts