I am Developing an application that consists of a gauge view. I found code from here https://github.com/CodeAndMagic/GaugeView
I am getting an error of No resource identifier found forattribute'showOuterShadow' in package
'org.codeandmagic.android.gauge.demo. I added the library in the java build path of the project but it was still occurring please help me to solve this this is my xml code:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:gauge="http://schemas.android.com/apk/res/org.codeandmagic.android.gauge.demo"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="#drawable/background"
android:padding="20dp" >
<org.codeandmagic.android.gauge.GaugeView
android:id="#+id/gauge_view1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<org.codeandmagic.android.gauge.GaugeView <!--Error occurring here-->
android:id="#+id/gauge_view2"
android:layout_width="150dp"
android:layout_height="150dp"
android:layout_marginTop="10dp"
gauge:showOuterShadow="true"
gauge:showOuterRim="false"
gauge:showNeedle="false"
gauge:showRanges="false"
gauge:showText="true"
gauge:textUnit="%" />
</LinearLayout>
This is so ridiculous to answer my own question:
i didn't add the library in my android project that is
YOUR PROJECT->RIGHTCLICK->POPERTIES->ANDROID->CLICK "ADD"->SELECT LIBRARY->CLICK "APPLY"->CLICK "OK"->RUN YOUR PROJECT
Related
Here is my activity_main.xml :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="#android:color/white">
<include layout="#layout/toolbar"></include>
<RadioGroup
android:id="#+id/choixPersonnage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RadioButton
android:id="#+id/boutonGuerrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/personnage1"
android:textSize="20sp"/>
<RadioButton
android:id="#+id/boutonMage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="#string/personnage2"
android:textSize="20sp"/>
</RadioGroup>
</LinearLayout>
And here is what appears in my editor:
Both button texts work, but the RadioButton buttons just do not appear, nor do they take space. They are just not there...
In all the Radio Button problems I found, no one seemed to have the same problem I do. Anyone could help me out here with this basic thing?
I Just Copy Your Code And It's Working Fine
When rebuilding, I had this mistake:
ERROR:C:\Users\utilisateur\Desktop\APPLICATIONS MOBILES\BLOC C - INTERFACES\personnages\app\build\intermediates\packaged_manifests\debug\AndroidManifest.xml:11: AAPT: error: resource style/Theme.Personnages (aka uqac.dim.personnages:style/Theme.Personnages) not found.
So I just went in my manifest and erased the "Theme." before the "Personnages" and it worked.
Android Studio works in mysterious ways...
I have a nice FrameLayout as main container and some other views inside it's hierarchy.
But the preview shows a simple ActionBarOverlayLayout.
What is that? Why is it here?
I have Android Studio 3.0.0
I have tried:
Restart Android Studio. Refresh the preview by resizing. Changed the preview device, changed the SDK of the preview, changed the blueprint\design options, pressed "force refresh layout" Button.
XML:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:paddingTop="8dp">
<com.makeramen.roundedimageview.RoundedImageView
android:layout_width="match_parent"
android:layout_height="#dimen/walk_list_item_height"
android:adjustViewBounds="false"
android:cropToPadding="false"
android:scaleType="centerCrop"
app:layout_heightPercent="25%"
app:layout_marginLeftPercent="0%"
app:layout_marginTopPercent="0%"
app:layout_widthPercent="100%"
app:riv_corner_radius="#dimen/corner_radius"
android:id="#+id/walk_iv" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="#drawable/gradient"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="16dp">
<TextView
android:id="#+id/walk_name_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical"
android:padding="16dp"
android:text="New Text"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#fff" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/ic_duration_icon" />
<TextView
android:id="#+id/duration_tv"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:gravity="center|left"
android:text="TextView"
android:textColor="#fff" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="#drawable/ic_marker"
android:layout_marginLeft="16dp" />
<TextView
android:id="#+id/stops_tv"
android:layout_gravity="center"
android:layout_marginLeft="8dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="TextView"
android:textColor="#fff" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
That is because there is a broken build in your earlier build. It is coming from the intermediate files which is because the files are not proper in your xml files. There might be a broken link or a - in the drawables names.
Until you resolve this you cannot proceed to see the layout of your app in the layout-editor.
Moreover Android Studio will not show you any error in the error log or any other terminal.
Start from the styles/themes of the app, it might contain something which is missing from the gradle or resources of the project. Due to the support library still in the project it partially showcases it as missing control of XML files, but it will not let you load the xml editor visually for the project.
You have see that by yourself, start first from drawables and then move to values folder, if not check your gradle and then come back to Java files for the error.
Had to raise
buildToolsVersion to 26.0.0
previous was bugged (25.0.2)
I faced the same problem and, In my case, it was simpler than that. I just received a warning message recommending to remove the explict reference to the BuildToolsVerison from build.gradle file so I just did it, then saved all file, Menu >> Run >> Make a project and it worked fine.
I want to add fragments to my application and I installed the xamarin.android.support.v4 and other required but it gives an error
error: package android:support.v4.view or app or content etc. does not exist.
I have tried on a blank project with the same results.
I am using Android 7.0 and the latest support library.
For now,i want to also add RecyclerView and CardView
To use these two controls, you need to install the Xamarin.Android.Support.v7.RecyclerView package and Xamarin.Android.Support.v7.CardView in your project. When you install the Xamarin.Android.Support.v7.RecyclerView package using Nuget, the Xamarin.Android.Support.v4 package will automatically be installed.
And you can use RecyclerView like this:
<android.support.v7.widget.RecyclerView
android:id="#+id/recyclerView"
android:scrollbars="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
And so is the CardView:
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardElevation="4dp"
card_view:cardUseCompatPadding="true"
card_view:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="8dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/imageView"
android:scaleType="centerCrop" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="#333333"
android:text="Caption"
android:id="#+id/textView"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="4dp" />
</LinearLayout>
</android.support.v7.widget.CardView>
You can refer to the official document RecyclerView of Xamarin for using and customizing RecyclerView in Xamarin.Android applications.
If there is still problem, could you please provide a minimal reproducible demo, so can we continue to investigate this issue.
I downloaded sample android carousel demo source code in the below link http://www.codeproject.com/Articles/146145/Android-3D-Carousel#xx4884593xx
The main.xml is as follows:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pj="http://schemas.android.com/apk/res/carousel.main"
xmlns:bm="carousel.main"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#drawable/back"
android:orientation="vertical" >
<TextView
android:id="#+id/selected_item"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:background="#1E1921"
android:text="text"
android:textColor="#A85E4F"
android:textStyle="normal"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:gravity="top"
android:padding="5dip" >
<carousel.Carousel
android:id="#+id/carousel"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:animationDuration="200"
pj:Items="#array/entries"
pj:SelectedItem="0"
pj:UseReflection="true" />
</LinearLayout>
</LinearLayout>
However I'm now getting the following errors:
Description Resource Path Location Type
error: No resource identifier found for attribute 'UseReflection' in package 'carousel.main' main.xml
Suspicious namespace: should start with http:// main.xml
Each time I try and clean the project it deletes the R.file. I've tried changing the package name, and pasting all the contents again but that hasn't solved the problem.
I found where the problem was.
In the root of the xml:
xmlns:pj="http://schemas.android.com/apk/res/package_with_calling_class"
xmlns:bm="package_with_calling_class"
package_with_calling_class = the class which might be the main activity where the onCreate() is being called. In my case it was platinum.platinumstars
setContent(R.layout.main)
I am working on android source code 4.4.2. I tried to make a build adding a new layout file in Keyguard module in frameworks/base/ and I get the following errors.
frameworks/base/packages/Keyguard/res/layout-land/keyguard_host_view_ads.xml:57: error: No resource identifier found for attribute 'layout_childType' in package 'android'
frameworks/base/packages/Keyguard/res/layout-land/keyguard_host_view_ads.xml:64: error: No resource identifier found for attribute 'layout_centerWithinArea' in package 'android'
The new source file for key guard_host_view_ads.xml looks like:
<com.android.keyguard.KeyguardHostView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:androidprv="http://schemas.android.com/apk/res/android"
android:id="#+id/keyguard_host_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<com.android.keyguard.MultiPaneChallengeLayout
android:id="#+id/multi_pane_challenge"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipChildren="false"
android:orientation="vertical">
<include layout="#layout/keyguard_widget_remove_drop_target"
android:id="#+id/keyguard_widget_pager_delete_target"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|center_horizontal"
androidprv:layout_childType="pageDeleteDropTarget" />
<include layout="#layout/keyguard_widget_pager"
android:id="#+id/app_widget_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
androidprv:layout_centerWithinArea="0.5"
androidprv:layout_childType="widget"
androidprv:layout_maxWidth="480dp"
androidprv:layout_maxHeight="480dp" />
<include layout="#layout/keyguard_multi_user_selector"/>
<View android:layout_width="match_parent"
android:layout_height="match_parent"
androidprv:layout_childType="scrim"
android:background="#99000000" />
<com.android.keyguard.KeyguardSecurityContainer
android:id="#+id/keyguard_security_container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
androidprv:layout_centerWithinArea="0.5"
androidprv:layout_childType="challenge"
android:layout_gravity="center_horizontal|bottom">
<com.android.keyguard.KeyguardSecurityViewFlipper
android:id="#+id/view_flipper"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingLeft="#dimen/keyguard_security_view_margin"
android:paddingTop="#dimen/keyguard_security_view_margin"
android:paddingRight="#dimen/keyguard_security_view_margin"
android:paddingBottom="#dimen/keyguard_security_view_margin"
android:gravity="center">
</com.android.keyguard.KeyguardSecurityViewFlipper>
</com.android.keyguard.KeyguardSecurityContainer>
</com.android.keyguard.MultiPaneChallengeLayout>
Could some explain difference between android and androidprv?
How can I fix this issue?
The namespace androidprv is wrongly assigned. This is the correct link.
xmlns:androidprv="http://schemas.android.com/apk/res/com.android.keyguard"
You can use this as well.
xmlns:androidprv="http://schemas.android.com/apk/prv/res/android"