Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/184.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法安装我的apk(无法加载memtrack模块,java.lang.ClassCastException)_Java_Android_Unity3d - Fatal编程技术网

无法安装我的apk(无法加载memtrack模块,java.lang.ClassCastException)

无法安装我的apk(无法加载memtrack模块,java.lang.ClassCastException),java,android,unity3d,Java,Android,Unity3d,我正在用unity制作android游戏。我的apk构建中有一个错误。 我不知道怎么修理它。我在下面附上androidmanifest.xml和android日志 androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android

我正在用unity制作android游戏。我的apk构建中有一个错误。 我不知道怎么修理它。我在下面附上androidmanifest.xml和android日志

androidmanifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1" package="com.mycom.myapp" android:installLocation="auto">

  <supports-screens android:anyDensity="true" android:largeScreens="true" 
                    android:normalScreens="true" android:smallScreens="true" 
                    android:xlargeScreens="true" />

  <uses-permission android:name="android.permission.INTERNET" />
  <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="android.permission.SEND_SMS" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="android.permission.READ_CONTACTS" />
  <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />

  <application android:icon="@drawable/app_icon" 
               android:label="@string/app_name" 
               android:theme="@style/UnityThemeSelector" 
               android:debuggable="false" android:isGame="true">


  <!-- Unity Activity-->
  <activity android:label="@string/app_name" 
            android:name="com.unity3d.player.UnityPlayerActivity" 
            android:screenOrientation="sensorLandscape" 
            android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">

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

     <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"     
                      android:label="@string/app_name" android:name="com.aoneg.unity.permissioncheck.PermissionRequestActivity" 
                      android:screenOrientation="landscape" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
     <intent-filter>
       <action android:name="android.intent.action.MAIN" />
       <category android:name="android.intent.category.LAUNCHER" />
       <category android:name="android.intent.category.LEANBACK_LAUNCHER" />
     </intent-filter>
  </activity>

    <activity android:label="@string/app_name" 
              android:name="com.mycom.myapp.MainActivity" 
              android:screenOrientation="landscape">
    </activity>

  </application>

  <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="26" />
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />

</manifest>

任何帮助/想法都将不胜感激,谢谢

我认为您的MainActivity扩展了应用程序而不是活动。在清单中使用应用程序标记


希望能有所帮助。

谢谢您的评论。我检查了我的管理能力。这是扩展UnityPlayerPractivity。什么是应用程序标记?应用程序标签是这个意思吗<代码>
E/memtrack(4684): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(4684): failed to load memtrack module: -2
E/memtrack(4701): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug(4701): failed to load memtrack module: -2
E/AndroidRuntime(4714): FATAL EXCEPTION: main
E/AndroidRuntime(4714): Process: com.mycom.myapp, PID: 4714
E/AndroidRuntime(4714): java.lang.RuntimeException: Unable to instantiate application com.mycom.myapp.MainActivity: java.lang.ClassCastException: com.mycom.myapp.MainActivity cannot be cast to android.app.Application
E/AndroidRuntime(4714):     at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
E/AndroidRuntime(4714):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4345)
E/AndroidRuntime(4714):     at android.app.ActivityThread.access$1500(ActivityThread.java:135)
E/AndroidRuntime(4714):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
E/AndroidRuntime(4714):     at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(4714):     at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(4714):     at android.app.ActivityThread.main(ActivityThread.java:5045)
E/AndroidRuntime(4714):     at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(4714):     at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(4714):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(4714):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(4714):     at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(4714): Caused by: java.lang.ClassCastException: com.mycom.myapp.MainActivity cannot be cast to android.app.Application
E/AndroidRuntime(4714):     at android.app.Instrumentation.newApplication(Instrumentation.java:1007)
E/AndroidRuntime(4714):     at android.app.Instrumentation.newApplication(Instrumentation.java:992)
E/AndroidRuntime(4714):     at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
E/AndroidRuntime(4714):     ... 11 more
E/FastMixer(167): did not receive expected priority boost
E/BandwidthController(160): Updating quota globalAlert failed (No such file or directory)
E/Drm(167): Failed to open plugin directory /vendor/lib/mediadrm
E/BandwidthController(160): Updating quota globalAlert failed (No such file or directory)