我是游戏设计师和团结开发者,我很少做任何Android原生开发,我希望你们能帮助我,在这个清单中,什么是主要活动?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" android:theme="@android:style/Theme.NoTitleBar" package="com.juiceglobal.lines" 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="true" android:name="com.soomla.SoomlaApp">
<activity android:name="com.unity3d.player.UnityPlayerActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
</activity>
<activity android:name="com.unity3d.player.UnityPlayerNativeActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name=".Main" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:label="@string/app_name">
</activity>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
<activity android:name="com.unity3d.player.UnityPlayerProxyActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<!-- Google Play -->
<!-- -->
<!-- -->
<meta-data android:name="billing.service" android:value="google.GooglePlayIabService" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<!-- End Google Play -->
<!-- -->
<!-- -->
<!-- -->
<!-- -->
<!-- voluum -->
<receiver android:exported="true" android:name="com.voluum.sdk.VoluumForwardingBroadcastReceiver">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<!-- End voluum -->
<!-- -->
<!-- -->
<!-- HeyZap -->
<activity android:name="com.heyzap.sdk.ads.HeyzapInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapVideoActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
<activity android:name="com.heyzap.sdk.ads.HeyzapProxyActivity" />
<!--<activity android:name="com.heyzap.sdk.ads.VASTActivity" />-->
<receiver android:name="com.heyzap.sdk.ads.PackageAddedReceiver">
<intent-filter>
<data android:scheme="package" />
<action android:name="android.intent.action.PACKAGE_ADDED" />
</intent-filter>
</receiver>
<!-- End HeyZap -->
<!-- -->
<!-- -->
<!-- Others -->
<activity android:name="com.mobilefuel.sdk.AdInterstitialActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:label="AD" android:exported="false" />
<activity android:name="com.soomla.store.billing.google.GooglePlayIabService$IabActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
<activity android:name="com.facebook.unity.FBUnityLoginActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.unity.FBUnityDialogsActivity" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.LoginActivity" android:configChanges="keyboardHidden|orientation" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity android:name="com.facebook.unity.FBUnityDeepLinkingActivity" android:exported="true">
</activity>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="\ 503591776472556" />
<!--End Others -->
<!-- TrialPay activities -->
<activity android:name="com.trialpay.android.views.webcontainer.WebContainerActivity" android:hardwareAccelerated="true" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.trialpay.android.views.webcontainer.WebContainerPopupActivity" android:hardwareAccelerated="true" android:launchMode="singleTop" android:windowSoftInputMode="adjustResize" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<activity android:name="com.trialpay.android.views.videocontainer.VideoContainerActivity" android:hardwareAccelerated="true" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:screenOrientation="fullSensor" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
<meta-data android:name="android.app.lib_name" android:value="unity" />
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</activity>
<!--End TrialPay activities -->
</application>
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
</manifest>
我在另一个“插件”的初始化中需要它,我试过:
我总是得到同样的错误:
AndroidJavaException: java.lang.NoSuchFieldError: no static field with name='one.of.the.package.above' signature='Ljava/lang/Object;' in class Lcom/unity3d/player/UnityPlayer;
编辑
我无法分享整个班级,因为它不是我的,但这是初始化,会产生错误:
private const string MainActivityName = "com.unity3d.player.UnityPlayerProxyActivity";
public void ReportConversion(string payload)
{
using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
{
using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>(MainActivityName))
{
AndroidJavaClass cls_MainActivity = new AndroidJavaClass("com.companyName.voluum.Main");
cls_MainActivity.CallStatic("ReportConversion", obj_Activity, payload);
}
}
}
谢谢
答案 0 :(得分:0)
com.unity3d.player.UnityPlayerProxyActivity
是您应用中的主要活动。清单文件中android.intent.category.LAUNCHER
的活动始终是主要活动(开始活动)。
答案 1 :(得分:0)
使用 currentActivity 修复问题(字面上输入currentActivity),当我这样做时
private const string MainActivityName = "currentActivity";
using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>(MainActivityName)) ;