0

好的,所以我一直在阅读 AdMob 中的教程,在尝试编译后,我首先遇到了这个恼人的运行时错误。
在过去的几个小时里,我一直在尝试修复它并尝试一些解决方案,例如将 JAR 文件放在 libs 文件夹中等等。但我一直收到这个错误。
如果有人能调查我的问题并找出我可能做错了什么,我将非常感激。

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

这是它的外观:

在此处输入图像描述 在此处输入图像描述

我的清单:

<?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>

我的布局:

<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>

4

1 回答 1

0

好吧,终于知道问题出在哪里了。我不得不在 logcat 中看得更深一些。

我使用 HoloEverywhere 库,正如您在 logcat 文件末尾看到的那样,它说:

引起:java.lang.UnsatisfiedLinkError: HoloEverywhere: PreferenceFramework not found

解决方案:我必须将 HoloEverywhere Addons Preferences 库导入我的项目,现在它就像一个魅力。

于 2013-08-12T20:53:21.713 回答