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 !
Related
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
I'm trying to transition my app to the action bar. I'm following Google's tutorial. Unfortunately, when trying to build the app, AAPT returns the following error:
menu.xml:6: AAPT: Error parsing XML: unbound prefix
I did some research and found out that this error usually happens when the line xmlns:android="http://schemas.android.com/apk/res/android" isn't included in the XML because then AAPT doesn't know how to interpret the android.xxx tag. However, as you can see from my code, I've included this line in the first node:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="#+id/my_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="4dp"
android:theme="#style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="#style/ThemeOverlay.AppCompat.Light"/>
</LinearLayout>
So why doesn't this compile?
You have not declared the app namespace via xmlns:app, but you use it in app:popupTheme. IIRC, there is a quick-fix for that in Android Studio. If not, add xmlns:app="http://schemas.android.com/apk/res-auto" to your root element.
i am facing this error ...tried my best to sort out..but all in vain..if someone can help
below is the screenshot:
Problem is in the following lines of code
<android.support.constraint.ConstraintLayout 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"
I am able to test my android app on my mobile 5.0 perfectly fine, but testing it on anything lower than 5.0 throws an exception.
"Binary XML file line #16: Error inflating class android.support.design.widget.NavigationView"
My line 16 is basically this
<?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/main_app_bar"
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>
I did see other posts about this error, but none of it seems to fix my issue.
This is the full callstack of the error
http://pastebin.com/raw/FaJQFCie
I found it. The error comes from navigation's menu. When I created new project with navigation drawer, Android Studio generates complete work for me. There's a drawable folder named drawable-v21 which stores the icon xml files
I had had the same problem some time ago.
1) Look at your gradle dependencies: you should add library -
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
2) Look at your based colors: you should have
colorPrimary
colorPrimaryDark
colorAccent
3) Look at your layout.nav_header_main. If you will have in the end of error log some message like "Caused by: java.lang.OutOfMemoryError: Failed to" - background image of nav_header_main has a very big resolution or kb weight. Change it and will have success ;)
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.