Error in integrating inmobi sdk in main.xml - android

here is my xml error report
The following classes could not be instantiated:
- com.inmobi.androidsdk.IMAdView (Open Class, Show Error Log)
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
and code of main.xml is like this
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<com.inmobi.androidsdk.IMAdView
android:id="#+id/imAdview"
android:layout_width="320dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
adSize="15"
appId="a521d7b121144753a4709e018826c487" />
Didn't get issue here ,why i am getting this error ,suggest some solution.
Thanks

Please use the following code in your xml
<com.inmobi.monetization.IMBanner android:layout_width="320dp"
android:layout_height="50dp" android:id="#+id/banner"
adSize="15" appId="YOUR-APP-ID" />
The code you are using is from the old integration guidelines. This will not work for the latest InMobi sdk. For more details please check https://www.inmobi.com/support/integration/23817448/22051163/android-sdk-integration-guide/

Related

No resource identifier found for attribute '' in package Android Layout

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.

How can I use the Android library ExtendedCalendarView

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>

Error inflating class com.google.android.ads.AdView

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"

XML error - Doing Google Android NDK Lesson 1

The Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:weightSum="1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<EditText android:id="#+id/edit_message"
android:layout_weight = "1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="#string/edit_message" />
<Button
android:id="#+id/bSend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="#string/button_send" />
</LinearLayout>
The error message:
BUILD FAILED
C:\My First App\res\layout\activity_main.xml:7: Unexpected element "{}LinearLayout" {antlib:org.apache.tools.ant}LinearLayout
The code is almost exactly the same as the code on the Android website and it's really frustrating that I can't seem to get it to work. Is the problem in the code, or is it on my side? I am using Eclipse
I was getting the same error. I was using Indigo in Ubuntu 12.04, and no matter what libraries I got or eclipse plugins I used it was always there.
What worked for me was re-downloading and reinstalling the Android SDK (probably not necessary in your case), and downloading Eclipse Classic (Juno) from the Eclipse website rather than using the Indigo package that was in the repos. The lesson said Classic was recommended anyway, so whatever, I'm just happy it works now.
If you are using Windows, I'd still suggest downloading the most recent Classic version, but otherwise I can't be of help there.

How to get "?android:attr/actionBarSize" with Compatibility Library

I'm trying to use Fragments and ActionBar in a Android 2.2 project. There is some error when using "?android:attr/actionBarSize", how to get and set that value correctly?
Example:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/frags">
<fragment class="com.example.android.hcgallery.TitlesFragment"
android:id="#+id/frag_title"
android:visibility="gone"
android:layout_marginTop="?android:attr/actionBarSize"
android:layout_width="#dimen/titles_size"
android:layout_height="match_parent" />
<fragment class="com.example.android.hcgallery.ContentFragment"
android:id="#+id/frag_content"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
Error: No resource found that matches the given name (at 'layout_marginTop' with value '?android:attr/actionBarSize').
You should just use:
android:layout_marginTop="?attr/actionBarSize"
See http://developer.android.com/training/basics/actionbar/overlaying.html
"...The one with the android: prefix is for versions of Android that
include the style in the platform and the one without the prefix is
for older versions that read the style from the Support Library..."
For me replacing
android:layout_marginTop="?android:attr/actionBarSize"
with
android:layout_marginTop="?attr/actionBarSize"
helped to launch app on Android 2.2 and Android 4.3 without any issues.
I think the problem is that actionbar comes with android 3.0 and you are using 2.2. But there is a way to skip this by a extension called "actionbarsherlock".

Categories

Resources