I have the following layout in Android Studio 2.1
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:mapbox="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="#dimen/activity_vertical_margin"
android:paddingLeft="#dimen/activity_horizontal_margin"
android:paddingRight="#dimen/activity_horizontal_margin"
android:paddingTop="#dimen/activity_vertical_margin"
tools:context="com.kea.trimetrail.MainActivityFragment"
tools:showIn="#layout/activity_main">
<com.mapbox.mapboxsdk.maps.MapView
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
mapbox:accessToken="#string/mapbox_access_token"/>
</RelativeLayout>
It displays the following error:
No resource identifier found for attribute 'accessToken' in package 'com.example.myapp'
In this case, the error is generated building a simple Mapbox application. I'm developing mapbox from source (yes, I need the source build, not the pre-built).
See:
https://github.com/mapbox/mapbox-gl-native/blob/master/INSTALL.md
The source tree is for multiple platforms, I'm using:
https://github.com/mapbox/mapbox-gl-native/tree/master/platform/android
The source build is located as a dependent library located at:
myapp/app/libs/mapbox-gl-native/platform/android
I've tried importing the module and more using other similar posts, but nothing helps.
While a solution to my particular issue would be awesome, simply understanding the cause of the message might help too. Everything I read is about specific solutions to similar messages, but I can't find any information about the message itself.
Thx
Not sure, but looks like they changed the name from accessToken to access_token. I can't tell for sure because this just brings up a new error. I'll assume the new error is something beyond the old error and not instead of.
Related
I've checked online for a solution tried solutions from this page: Error: Suspicious namespace and prefix combination [NamespaceTypo] when I try create Signed APK and also errors in hello world xml but there's no solution. The funny thing is when I try to build a debug of the app or a release for tv and wear everything works well. Error:
(9) Error: Suspicious namespace and prefix combination [NamespaceTypo]
xmlns:app="http://schemas.android.com/tools"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Explanation for issues of type "NamespaceTypo":
Accidental misspellings in namespace declarations can lead to some very
obscure error messages. This check looks for potential misspellings to help track these down.
1 errors, 0 warnings
Layout file part of the code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:materialdesign="http://schemas.android.com/apk/res-auto"
xmlns:app="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
A solution to this is very helpful
Instead of what you have on line 3:
xmlns:app="http://schemas.android.com/tools"
Use:
xmlns:tools="http://schemas.android.com/tools"
Please change your namespace
xmlns:app="http://schemas.android.com/tools"
to
xmlns:app="http://schemas.android.com/apk/res-auto"
Fixed the problem...I had been working on the project using Android Studio version 1.0 and got the problem when I updated to version 1.5.1 So all I did is just getting back to the old version and things were okay, I have no idea why this is the case...
You can reproduce those errors by using the tool Analyse->Inspect code in android studio.
in the xml make sure that
xmlns:app="http://schemas.android.com/apk/res-auto"
and
xmlns:tools="http://schemas.android.com/tools".
If you can write like xmlns:app="http://schemas.android.com/tools" ,you will get an error.
Problem is that just I can't user overlayTop but I've got Support Design Library 23.1 included and every component usable just this one not
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/nes_scroll"
app:layout_behavior="#string/appbar_scrolling_view_behavior"
app:behavior_overlayTop="44dp">
...
and here's error:
Error:(50) No resource identifier found for attribute behavior_overlayTop in package com.scroll.example
also it's not usable in Java source too, it's just red line and offers to create class related to setOverlapTop().
I have got a strange situation when I working on my project.I have just run my application once. Then I changed some "android:margin" properties for my XML files. Then the problem came. I ran the project and it crashed. The log says it comes Resource Not Found Exception. Next I tried to export it but it failed to export. I'll post the log and error dialog below.
What have I done:
I reinstalled everything such as eclipse,ADT and SDK. Not work at all. I'm absolutely sure that the resource exists and stays in right position.**
All useful information is needed.
ps: The resource file that not found is an activity layout xml file--my intro activity and I've found the resource id in my R file.
ps: My friends use the same code as me.They don't have any problem.
here's my layout xml file:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/fl_base_activity"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="#+id/iv_base_wallpaper"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="#color/trans_cc" />
</FrameLayout>
Try re-building your project , If that doesn't work , delete the 'build' and 'gen' folders of project(you can take a backup elsewhere but remove them from your project folder) and then try running it again.
Let me know if that works.....
I've found why : So stupid fail that there is a resource with no suffix has been add in my project from SVN. It has a same name with correct resource name but without .png, eclipse can't distinguish what's the difference between them. It has no error notice. WTF!
I am new in Android-Programming and I and my programmer team have to program a little app for our college. So we need the ExtendedCalendarView-Library and we already imported it in our AndroidStudio-project but we always get the same failure:
Can not find the following classes com.tyczj.extendedcalendarview.ExtendedCalendarView
try to fix Build Path
and so on.
Code in our test.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<com.tyczj.extendedcalendarview.ExtendedCalendarView
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.tyczj.extendedcalendarview.ExtendedCalendarView>
</RelativeLayout>
But we have imported another library at the same way and it works. We also get a suggestion from com.tyczj.extendedcalendarview.ExtendedCalendarView when we open the '<' in a .xml file but always the same failure.
Meanwhile time is pressing so we have not so much time anymore.
Could anyone help us?
Have you copied the provider tag in your android manifest if not then copy it in application tag of AndroidManifest:
<application>
...
<provider
android:name="com.tyczj.extendedcalendarview.CalendarProvider"
android:authorities="com.tyczj.extendedcalendarview.calendarprovider" />
</application>
I've got quite weird problem with new AdView creation in layout XML while migrating from old AdMob.
OK.
Product target- Google API 19
Default properties- Google API 8
google play lib is referenced in the project and seems to be dexed and then included into resulting apk (proof is below).
I have the following code in my layout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="0"
android:orientation="vertical" >
...
<com.google.android.gms.ads.AdView
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
ads:adSize="BANNER"
ads:adUnitId="#string/admob_unit_id"
/>
When I load the layout I've got the exception.
I see the following suspicious things:
I have specially put code which uses AdView BEFORE the XML loading and have no exception there
com.google.android.gms.ads.AdView ad= new com.google.android.gms.ads.AdView(this);
try
{
setContentView(R.layout.ap_map);
}
catch(RuntimeException e)
{
throw e;
}
So, I assume that there is no prob with google play library inclusion itself.
However, when I debugged the exception- I've got an internal exception- NoClassDefFoundException, so it looks exactly like I have google play lib missed
I have weird probs with AdView declaration- if I declare it as google suggest
I've got an error saying that
- error: No resource identifier found for attribute 'adSize' in package MYPACKAGE
So I had to add
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"
in the top of the layout declaration to get rid of this
Any ideas? I've read a few related topics here and all of them seems to be related with google play lib absence but it does not seem to be the case
Change :
xmlns:ads="http://schemas.android.com/apk/lib/com.google.android.gms.ads"
to:
xmlns:ads="http://schemas.android.com/apk/res-auto"