Unity崩溃的LeadBolt

时间:2014-01-23 14:08:42

标签: android sdk leadbolt

我在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 () {

}

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

1 个答案:

答案 0 :(得分:0)

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

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

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

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