0

我在leadblot上注册了。下载他们的 SDK。在我的项目中创建文件夹:Plugins->Android。复制此文件夹中的 AndroidManifest 和我下载的 sdk。这就是我在 SDK 文件夹中的示例中所做的一切。此文件:https ://docs.google.com/document/d/1plndrafMw-jBQT6RfUL8H9TfbJcHlh_LgtxPXnLLXIU/pub 我的 AndroidManifest.xml :

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="com.ALTIMGAMES.SUV" android:versionName="1.0" android:versionCode="1">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="false">
    <activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
        <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" /> 
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
      <meta-data android:name="android.app.lib_name" android:value="unity" />
      <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />
    </activity>
    <receiver android:name="com.hewzyntzcrsflwjnemv.ReEngagement" />
    <service android:name="com.hewzyntzcrsflwjnemv.ReEngagementService" />
    <service android:name="com.hewzyntzcrsflwjnemv.AdBootReceiverService" />
  </application>
  <uses-feature android:glEsVersion="0x00020000" />
  <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"/>
  <uses-feature android:name="android.hardware.touchscreen" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
  <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="19" />
</manifest>

我的 c# 代码(我使用 adbolt 的地方):使用 UnityEngine;使用 System.Collections;

公共类LeadBoltAD:MonoBehaviour {

// Use this for initialization
void Start () {
    AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); 
    AndroidJavaObject jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
    using(AndroidJavaObject ad = new AndroidJavaObject("com.unity.wrapper.LeadBoltUnity", jo)){
     ad.Call("loadAd","820080475");
   }
}

// Update is called once per frame
void Update () {

}

我安装我的应用程序。当应用程序启动时,他崩溃了..请帮助我...

4

1 回答 1

0

你需要设置 <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="false" />

<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />

如您发布的自述文件的第 6 步所述。

除此之外,我需要更多信息才能提供帮助。您可以从命令行启动 adb logcat 并将您的测试电话插入您的计算机,以将任何错误消息流式传输回您的控制台。这对于查找特定错误很有用。

于 2014-03-02T07:07:49.767 回答