Facing issue when sdk version is updated in Android Studio - android

I am using intercom sdk version 3.+ for notification purpose. I need to update the intercom sdk version to 5.+. After updating the sdk version in gradle file I faced the below error.
AGPBI: {"kind":"error","text":"No resource found that matches the given name (at \u0027textAppearance\u0027 with value \u0027#style/TextAppearance.AppCompat.Notification\u0027).","sources":[{"file":"C:\Users\Android-2\.android\build-cache\971cf0b344c5894d7c756a8e5b80dd3e25a942ef\output\res\layout\activity_add_source.xml","position":{"startLine":32,"startColumn":40,"startOffset":1209,"endColumn":84,"endOffset":1253}}],"original":"","tool":"AAPT"}
C:\Users\Android
2\Desktop\Files\OriginalCode\android\app\build\intermediates\res\merged\debug\layout\activity_add_source.xml:28: error: Error: No resource found that matches the given name (at 'textAppearance' with value '#style/TextAppearance.AppCompat.Notification').
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
I also checked in different ways to resolve the above issue. But I can't. If I created a new project in android studio and checked with intercom sdk version 5.+. It accepts and no issues. I faced only in my existing app. Kindly help me on this issue.
activity_add_source.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.stripe.android.view.CardMultilineWidget
android:id="#+id/add_source_card_entry_widget"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_margin="#dimen/add_card_total_margin"
/>
<FrameLayout
android:id="#+id/add_source_error_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="#id/add_source_card_entry_widget"
>
<TextView
android:id="#+id/tv_add_source_error"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="#dimen/add_card_total_margin"
android:textAppearance="#style/TextAppearance.AppCompat.Notification"
android:visibility="gone"
/>
</FrameLayout>
</RelativeLayout>
</ScrollView>

I think you should try adding the following style in your styles.xml
<style name="TextAppearance.AppCompat.Notification">
<item name="android:textSize">12sp</item>
<item name="android:textColor">#ccc</item>
</style>
NB: Change text and color as per your preferences

Related

Android resource linking failed chat21

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.

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"
}
}

Can't migrate my project to Android API 27

I have an android project which was developed according to API 25 and was running fine. But, now i wanted to change some code in it and i have also updated my Android Studio to 3.0 since(may be that's the problem). Following are the errors i receive :
C:\Users\nutty geek\Desktop\Ankur\app\build\intermediates\res\merged\debug\layout\activity_main.xml:17: error: No resource identifier found for attribute 'headerLayout' in package 'com.nuttygeek.vastucosmos.vastucompass'
C:\Users\nutty geek\Desktop\Ankur\app\build\intermediates\res\merged\debug\layout\activity_main.xml:17: error: No resource identifier found for attribute 'menu' in package 'com.nuttygeek.vastucosmos.vastucompass'
C:\Users\nutty geek\Desktop\Ankur\app\build\intermediates\res\merged\debug\layout\content_main.xml:2: error: No resource identifier found for attribute 'layout_behavior' in package 'com.nuttygeek.vastucosmos.vastucompass'
C:\Users\nutty geek\Desktop\Ankur\app\build\intermediates\res\merged\debug\layout\content_main.xml:2: error: Error: No resource found that matches the given name (at 'layout_behavior' with value '#string/appbar_scrolling_view_behavior').
Failed to execute aapt
com.android.ide.common.process.ProcessException: Failed to execute aapt
i also have added this line to gradle.properties :
android.enableAapt2=false
for disabing AAPT2 but it still give some errors.
Questions:
1. Why has this problem occured ?
2. How can i resolve this issue ?
here is the activity_main.xml of the project...
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="#+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
<include
layout="#layout/app_bar_main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.design.widget.NavigationView
android:id="#+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
android:fitsSystemWindows="true"
app:headerLayout="#layout/nav_header_main"
app:menu="#menu/activity_main_drawer" />
</android.support.v4.widget.DrawerLayout>
Seems like i was your using some features which demanded the need of this dependency.
compile 'com.android.support:design:26.1.0'
i added it and the problem is finally solved !

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.

Error when Importing jazzylistview sample project

Hello I'm importing jazzylistview sample project and i get the following error in the layout file:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/com.twotoasters.jazzylistview.sample"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/background"
tools:context=".MainActivity" >
<com.twotoasters.jazzylistview
android:id="#id/android:list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#null"
app:effect="helix"
app:only_animate_new_items="false"
app:only_animate_fling="false"
app:max_velocity="0" />
</FrameLayout>
I get the following error on com.twotoasters.jazzylistview line:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'only_animate_fling' in package
'com.twotoasters.jazzylistview.sample'
- error: No resource identifier found for attribute 'max_velocity' in package 'com.twotoasters.jazzylistview.sample'
- error: No resource identifier found for attribute 'effect' in package 'com.twotoasters.jazzylistview.sample'
- error: No resource identifier found for attribute 'only_animate_new_items' in package
'com.twotoasters.jazzylistview.sample'
please help me what should i do?
xmlns:app="http://schemas.android.com/apk/res/com.twotoasters.jazzylistview.sample"
here instead of using /com.twotoasters.jazzylistview.sample use your package name.

Categories

Resources