简体   繁体   English

膨胀com.google.ads.AdView类时出错

[英]Error inflating class com.google.ads.AdView

Alright, so I've been going through the tutorial in AdMob, and after trying to compile, I was first faced this annoying run time error. 好吧,所以我一直在阅读AdMob中的教程,尝试编译后,我首先遇到了这个令人讨厌的运行时错误。
I've been trying for the past few hours to fix it and trying some solutions, such as putting the JAR file in the libs folder and so on.. but I keep getting this error. 在过去的几个小时中,我一直在尝试对其进行修复,并尝试了一些解决方案,例如将JAR文件放在libs文件夹中,等等。但是我一直收到此错误。
I will be very thankfull if someone could look into my problem and figure out what I am probably doing wrong. 如果有人可以调查我的问题并弄清楚我可能做错了什么,我将非常感激。

First, my logcat: http://pastebin.com/4tRh31Xh 首先,我的logcat: http : //pastebin.com/4tRh31Xh

Here's how it looks: 外观如下:

在此处输入图片说明在此处输入图片说明

My Manifest: 我的清单:

<?xml version="1.0" encoding="utf-8"?>

<uses-sdk
    android:minSdkVersion="9"
    android:targetSdkVersion="18" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.flash" />

<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

<application
    android:name="org.holoeverywhere.app.Application"
    android:allowBackup="true"
    android:hardwareAccelerated="true"
    android:icon="@drawable/safecam_icon"
    android:label="@string/app_name"
    android:theme="@style/Holo.Theme.Light.DarkActionBar" >
    <activity
        android:name="com.inturnex.safecam.MainActivity"
       android:configChanges="orientation|screenSize|keyboardHidden"
       android:screenOrientation="portrait"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.NoTitleBar" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
       <activity android:name="com.google.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
</application>

My layout: 我的布局:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/lib/com.google.ads"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<ProgressBar
    android:id="@+id/progressBar"
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true" />

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_above="@+id/linearLayout1"
    android:divider="@null"
    android:dividerHeight="0dp" />

<LinearLayout
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:orientation="vertical" >

    <com.google.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        ads:adSize="BANNER"
        ads:adUnitId="xxxx"
        ads:loadAdOnCreate="true"/>
</LinearLayout>

Alright, finally, I figured out what the problem is. 好吧,最后,我弄清楚了问题所在。 I had to look a bit deeper in the logcat. 我不得不更深入地研究logcat。

I use HoloEverywhere library, as you can see in the end of the logcat file, it says: 我使用HoloEverywhere库,如您在logcat文件末尾所看到的,它说:

Caused by: java.lang.UnsatisfiedLinkError: HoloEverywhere: PreferenceFramework not found 造成原因:java.lang.UnsatisfiedLinkError:HoloEverywhere:找不到PreferenceFramework

The solution: I had to import the HoloEverywhere Addons Preferences library into my project, and now it works like a charm. 解决方案:我必须将HoloEverywhere Addons Preferences库导入到我的项目中,现在它就像一个魅力一样工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM