2014-01-23 49 views
0

我在leadblot上註冊過。下載他們的SDK。 在我的項目中創建文件夾:插件 - > Android。 將AndroidManifest複製到此文件夾和我下載的sdk中。 這就是我在SDK中的文件夾中的例子。 該文件:https://docs.google.com/document/d/1plndrafMw-jBQT6RfUL8H9TfbJcHlh_LgtxPXnLLXIU/pub 我的AndroidManifest.xml:Unity中的LeadBolt crash

<?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#代碼(其中i使用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() { 

} 

} 我安裝我的應用程序。當應用程序啓動,他崩潰.. 請幫助我......

回答

0

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

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

自述文件的步驟6的解釋,你發佈。

除此之外,我需要更多信息才能提供幫助。從命令行中,您可以啓動adb logcat,並將測試電話插入計算機,以便將任何錯誤消息傳回控制檯。這對於查找特定錯誤非常有用。