I have tried implementing the banner ad code following the correct documentation as seen here. Now when I run the app both on my Virtual Device and Mobile phone crashes after showing the splash screen.
My error is pointing to:
setContentView(R.layout.activity_main);
I have also implemented MaxAdViewAdListener in my MainActivity.java
On my activity_main design below is how I have added the banner ad code as below:
<com.applovin.mediation.ads.MaxAdView
android:layout_width="match_parent"
android:layout_height="#dimen/banner_height"
android:background="#color/banner_background_color"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
maxads:adUnitId="e96696c22#####" />
The Ad although displays in the Design section on Android studio. Below are the exceptions displayed in the Run section:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.packagename.eaxample/com.packagename.eaxample.MainActivity}: android.view.InflateException: Binary XML file line #371 in com.packagename.eaxample:layout/activity_main: Binary XML file line #371 in com.packagename.eaxample:layout/activity_main: Error inflating class com.applovin.mediation.ads.MaxAdView
Caused by: android.view.InflateException: Binary XML file line #371 in com.packagename.example:layout/activity_main: Binary XML file line #371 in com.packagename.example/activity_main: Error inflating class com.applovin.mediation.ads.MaxAdView
Caused by: android.view.InflateException: Binary XML file line #371 in com.packagename.example:layout/activity_main: Error inflating class com.applovin.mediation.ads.MaxAdView
With this Error inflating class com.applovin.mediation.ads.MaxAdView, you have to check the following:
Check if your com.applovin.mediation.ads.MaxAdView in XML file can be referenced. If not, you may have to confirm if you have imported the correct libraries.
It uses an additional namespace: maxads:adUnitId. Check if the corresponding link for this namespace is correctly set: xmlns:maxads="http://schemas.applovin.com/android/1.0"
Related
i get this error when i run android app i using camera kit for display my camera frontend phone this error is visible sometime.
Images
Error :
Error image
Xml :
xml file line 17
Version Camera Kit :
Version i using for camera kit
I am reviving an old github repo of an instagram clone. The problem is, the manifest merger keeps failing.
I have tried updating, adding overrides, downgrading, removing then syncing then re-adding but nothing works.
I end up with the error:
Manifest merger failed with multiple errors, see logs
I think it has something to do with firebase starting because one of the error is as follows
2019-08-21 19:24:34.311 32240-32240/? E/FirebaseInstanceId: Failed to start service while in background: java.lang.IllegalStateException: Not allowed to start service Intent { act=com.google.firebase.INSTANCE_ID_EVENT pkg=com.facebook.orca cmp=com.facebook.orca/com.facebook.push.fcm.FcmInstanceIDListenerService (has extras) }: app is in background uid UidRecord{c44bfd u0a246 TRNB idle change:uncached procs:1 proclist:32240, seq(0,0,0)}
Then again I get hundreds of other errors thrown at me upon running.
https://pastebin.com/TMsesZUX <- The full logcat
EDIT:
The error I get is:
Error: tools:replace specified at line:17 for attribute android:appComponentFactory, but no new value specified Android-Instagram-Clone-master-app main manifest (this file), line 16
SOLVED:
All I had to do was add
android:appComponentFactory="android.support.v4.app.CoreComponentFactory"
in the application tag in my AndroidManifest.xml
I build the project successfully but when I run the project on emulator I get this error on screen.
Unfortunately Linphone has stop working!
While the logcat displays the runtime errors
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo
{org.linphone/org.linphone.LinphoneActivity}:
android.view.InflateException: Binary XML file line #60:
Error inflating class org.linphone.ui.Numpad at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
Please do help me solve this out. I will totally appreciate!
I have an app that I put in package/app/myappfolder, I use a library android-support-v4.jar from google, and it is in myappfolder/libs, in Android.mk file I add below lines:
LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := android-support-v4:libs/android-support-v4.jar
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_DEX_PREOPT := false
and my code has using android.support.v4.app.* package.
then, I build using "mmm -b packages/app/myappfolder", it gives out build message, it contains below lines
Install: out/target/product/target/system/app/myapp.apk
target Prebuilt: android-support-v4 (out/target/product/target/obj/JAVA_LIBRARIES/android-support-v4_intermediates/javalib.jar)
I thought, it means that build has generated myapp.apk and javalib.jar, the javalib.jar has the library the same as android-support-v4.jar, right?
I just know adb install -r myapp.apk to my target board, and the app can't run, and crashs with errors:
E/AndroidRuntime(24403): Caused by: android.content.res.Resources$NotFoundException: Resource is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f020000 a=-1 r=0x7f020000}
E/AndroidRuntime(24403): at android.content.res.Resources.loadDrawable(Resources.java:1927)
E/AndroidRuntime(24403): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
E/AndroidRuntime(24403): at android.view.View.<init>(View.java:3330)
E/AndroidRuntime(24403): at android.view.ViewGroup.<init>(ViewGroup.java:431)
E/AndroidRuntime(24403): at android.widget.FrameLayout.<init>(FrameLayout.java:101)
E/AndroidRuntime(24403): at android.widget.FrameLayout.<init>(FrameLayout.java:97)
E/AndroidRuntime(24403): ... 28 more
E/AndroidRuntime(24422): FATAL EXCEPTION: main
E/AndroidRuntime(24422): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.changhong.factorymode/com.changhong.factorymode.MainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class <unknown>
And this app is run well if using eclipse with ADT build and install, Is it the reason that I don't push the javalib.jar to my target board? if so, how to do this? and has any other reason?
This question already has answers here:
Android app fail to start after adding admob
(4 answers)
Closed 9 years ago.
I'm trying to add AdMob ads to my app but when I do it, as soon as I launch my app it crashes.
This is my XML code:
<com.google.ads.AdView
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
ads:adUnitId="mydevid"
ads:adSize="BANNER"
ads:testDevices="mydeviceid"
ads:loadAdOnCreate="true"/>
Also, once I get it to work, how do I set where exactly is the ad going to be shown? Thank you
Logcat file:
06-13 23:41:03.576: E/AndroidRuntime(17419): FATAL EXCEPTION: main
06-13 23:41:03.576: E/AndroidRuntime(17419): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.matthewstudios.gw2legendary/com.example.gw2legendary.MainActivity}: android.view.InflateException: Binary XML file line #18: Error inflating class com.google.ads.AdView
I don't want to leave the question unanswered so I'll just link to the awesome answer that helped me solve the problem!
Follow these stepes and adMob will work 100%!