Android resource linking failed chat21 - android

I am trying to add chat21 API to my project but facing an error "Android resource linking failed"
I have tried looking at resource files for any errors as well as looking as similar posts but none of them helped me in this case
Android resource linking failed warn: removing resource
com.example.bartertrade:string/activity_public_profile_presence_not_available
without required default value.
/Users/neha/.gradle/caches/transforms-2/files-2.1/bc7291a5f042de9d7c80c9df50272833/res/layout/layout_custom_notification.xml:29:
error: resource style/TextAppearance.AppCompat.Notification.Title (aka
com.example.bartertrade:style/TextAppearance.AppCompat.Notification.Title)
not found.
error: failed linking file resources.
<RelativeLayout
android:id="#+id/box_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toEndOf="#id/image">
<TextView
android:id="#+id/title"
style="#style/TextAppearance.AppCompat.Notification.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_toStartOf="#+id/time"
android:maxLength="20"
android:maxLines="1" />
<TextView
android:id="#+id/time"
style="#style/TextAppearance.AppCompat.Notification.Time"
android:layout_width="100dp"
android:layout_marginTop="2dp"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:gravity="end" />
</RelativeLayout>

"Android resource linking failed" this error will delete your R.Java which contains your linking data, it occurs when some error have in the XML file.
Try to find the error on your XML file.
I guess you added style="#style/TextAppearance.AppCompat.Notification.Title" this , which is not supported.
I am trying to add chat21 API to my project but facing an error "Android resource linking failed"
I have tried looking at resource files for any errors as well as looking as similar posts but none of them helped me in this case
Android resource linking failed warn: removing resource com.example.bartertrade:string/activity_public_profile_presence_not_available without required default value. /Users/neha/.gradle/caches/transforms-2/files-2.1/bc7291a5f042de9d7c80c9df50272833/res/layout/layout_custom_notification.xml:29: error: resource style/TextAppearance.AppCompat.Notification.Title (aka com.example.bartertrade:style/TextAppearance.AppCompat.Notification.Title) not found.
And you can see that program could not find the that particular thing
. When you remove these lines from your XML file. Then your problem
will fix.

Related

Can I use a Flow helper with RadioButtons?

I found the following post on SO regarding constraint layout flow helpers ConstraintLayout Flow helper example and wondered if they could be used with radio buttons.
I can find little about using flow helpers anywhere.
I tried adding the following to my layout inside the RadioGroup.
<androidx.constraintlayout.helper.widget.Flow
android:id="#+id/flow1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="10dp"
app:constraint_referenced_ids="radioButton, radioButton2, radioButton3"
app:flow_horizontalBias="0"
app:flow_horizontalGap="10dp"
app:flow_horizontalStyle="packed"
app:flow_verticalBias="0"
app:flow_wrapMode="chain"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
When I try to run the app I get the following errors:
Android resource linking failed
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalBias (aka com.domain.myapp:flow_horizontalBias) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalGap (aka com.domain.myapp:flow_horizontalGap) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_horizontalStyle (aka com.domain.myapp:flow_horizontalStyle) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_verticalBias (aka com.domain.myapp:flow_verticalBias) not found.
C:\AndroidProjects\MyApp\app\src\main\res\layout\activity_main.xml:158: error: attribute flow_wrapMode (aka com.domain.myapp:flow_wrapMode) not found.
error: failed linking file resources.
Use constraintlayout:2.0.0-alpha5 in gradle
Refer Flow
Yes, you can use ConstraintLayout (and Flow) to arrange RadioButton, but you have to use a ConstraintLayout aware RadioGroup widget to manage RadioButton widgets.
Please visit https://github.com/samlu/ConstraintRadioGroup.
The blRadioGroup widget should be what you are looking for.

Compiler is showing this "error: failed linking file resources."

Compiler is showing Error in these lines: I can't seems to locate the problem kindly help me.
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="#id/ic_magnify"
android:layout_centerVertical="true"
android:textSize="15sp"
android:textColor="#000"
android:id="#+id/input_search"
android:background="null"
android:hint="Enter Address, City or Zip Code"
android:imeOptions="actionSearch" />
android:background="null" doesn't mean anything. You need to use android:background="#null".
In the future showing your actual error (likely something similar to the error below) will help people actually be able to help you, instead of guessing.
fragment_dashboard.xml:219: error: 'null' is incompatible with attribute background (attr) reference|color

Regular build works fine, but signed build errors on EXPECTED RESOURCE OF TYPE ID

When I build my app regularly, it builds with no errors. When I try to build the SIGNED APK, I get an error...
Error: Expected resource of type id [ResourceType]
The line of code that is flagged is...
tv = (TextView)myView.findViewById(R.id.tvTimestamp);
That ID is defined in the corresponding layout xml as follows:
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
>
<!-- Clock -->
<ImageView
android:layout_width="12dp"
android:layout_height="12dp"
android:src="#drawable/ic_clock_white"
android:layout_gravity="center_vertical"
/>
<TextView
android:id="#+id/tvTimestamp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="14sp"
android:layout_marginLeft="20dp"
/>
</FrameLayout>
Not sure why this one is erroring out.
Thanks
Pete
That is not a compiler error, it's a lint warning.
To solve it, try one of the following:
Clean your project and sync it again
Use View.generateViewId() to set an arbitrary id
Create an ids.xml file in res/values/
If the debug version is running correctly on the emulator/physical device then you can safely go ahead and suppress this warning by:
Clicking on the error and selecting Disable error
Adding the following lines in build.gradle
android {
lintOptions{
disable "ResourceType"
}
}

Android: importing projects/libraries?

I am trying to use code from a project that I downloaded from Github, however I am consistently getting errors.
Is there more steps needed to use a project than importing it into eclipse?
I am currently just copying and pasting code from the downloaded project to mine.
Attempting to use the following:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.mikhaellopez.circularimageviewsample"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:orientation="vertical" >
<com.mikhaellopez.circularimageview.CircularImageView
android:layout_width="250dp"
android:layout_height="250dp"
android:src="#drawable/image"
app:border="true"
app:border_color="#color/GrayLight"
app:border_width="4dp"
app:shadow="true" />
</LinearLayout>
But getting the error:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'border_color' in package
'com.mikhaellopez.circularimageviewsample'
- error: No resource identifier found for attribute 'shadow' in package
'com.mikhaellopez.circularimageviewsample'
- error: No resource identifier found for attribute 'border' in package
'com.mikhaellopez.circularimageviewsample'
- error: No resource identifier found for attribute 'border_width' in package
'com.mikhaellopez.circularimageviewsample'
Is there more steps needed to use a project than importing it into eclipse?
Well, that depends.
I am currently just copying and pasting code from the downloaded project to mine.
Depending upon how that code is written, that may not work well.
But getting the error:
Change:
xmlns:app="http://schemas.android.com/apk/res/com.mikhaellopez.circularimageviewsample"
to:
xmlns:app="http://schemas.android.com/apk/res-auto"
as your app does not have the package name of com.mikhaellopez.circularimageviewsample, apparently.

No Resource Identifier Found for Attribute textIsSelectable repeateadly occurs

I use Eclipse 4.3.0 with the latest Android SDK.
I have a textview which looks like this:
<TextView
android:id="#+id/list_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:onClick="onSave"
android:textIsSelectable="false"
android:textAppearance="?android:attr/textAppearanceLarge" />
I added the line android:textIsSelectable="false" manually because lint gave me a warning and I hate to have warnings. The warning goes away. However, as soon as I edit something in the layout, an error appears saying:
error: No resource identifier found for attribute 'textIsSelectable' in package 'android'
I have to go to the file, remove the line, the error disappears and the warning returns. Then I reinsert the line again, and the error AND the warning is gone, until next time I have to edit something.
This property is also not showing up anywhere in the editor screen, so maybe that is the reason, but then, how can I get rid permanently of this error loop? Or is this a bug in the SDK environment?

Categories

Resources