简体   繁体   English

使用Eclipse进行构建时Android构建失败

[英]Android build fails when build with Eclipse

I got a strange problem lately with my eclipse build. 最近我的日食版本出现了一个奇怪的问题。 When building my app via Unity everything works fine and the build runs ok, but I need to get it working with eclipse as I have some plugins I want to use. 通过Unity构建我的应用程序时,一切正常,并且构建可以正常运行,但是我需要使其与eclipse一起使用,因为我想使用一些插件。

I'm using the same Manifest.xml as generated by Unity only changing the package name and the name of the activity as stated in the docs. 我使用的是与Unity生成的Manifest.xml相同的文件,只是更改了包名和文档中所述的活动名称。 Has someone a hint what could be the problem? 有人暗示可能是什么问题吗?

Logcat throws out: Logcat抛出:

03-27 15:08:39.632: W/dalvikvm(5289): Unable to resolve superclass of Lde/indiegames/hyperjump/HyperJumpActivity; (34)
03-27 15:08:39.632: W/dalvikvm(5289): Link of class 'Lde/indiegames/hyperjump/HyperJumpActivity;' failed
03-27 15:08:39.632: D/AndroidRuntime(5289): Shutting down VM
03-27 15:08:39.632: W/dalvikvm(5289): threadid=1: thread exiting with uncaught exception (group=0x40015560)
03-27 15:08:39.679: E/AndroidRuntime(5289): FATAL EXCEPTION: main
03-27 15:08:39.679: E/AndroidRuntime(5289): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{de.indiegames.hyperjump/de.indiegames.hyperjump.HyperJumpActivity}: java.lang.ClassNotFoundException: de.indiegames.hyperjump.HyperJumpActivity in loader dalvik.system.PathClassLoader[/mnt/asec/de.indiegames.hyperjump-2/pkg.apk]
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.os.Handler.dispatchMessage(Handler.java:99)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.os.Looper.loop(Looper.java:130)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at java.lang.reflect.Method.invokeNative(Native Method)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at java.lang.reflect.Method.invoke(Method.java:507)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at dalvik.system.NativeStart.main(Native Method)
03-27 15:08:39.679: E/AndroidRuntime(5289): Caused by: java.lang.ClassNotFoundException: de.indiegames.hyperjump.HyperJumpActivity in loader dalvik.system.PathClassLoader[/mnt/asec/de.indiegames.hyperjump-2/pkg.apk]
03-27 15:08:39.679: E/AndroidRuntime(5289):     at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
03-27 15:08:39.679: E/AndroidRuntime(5289):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
03-27 15:08:39.679: E/AndroidRuntime(5289):     ... 11 more
03-27 15:08:39.687: W/ActivityManager(104):   Force finishing activity de.indiegames.hyperjump/.HyperJumpActivity
03-27 15:08:40.202: W/ActivityManager(104): Activity pause timeout for HistoryRecord{405479b8 de.indiegames.hyperjump/.HyperJumpActivity}

My HyperJump.java class 我的HyperJump.java类

package de.indiegames.hyperjump;

import android.os.Bundle;
import android.util.Log;

import com.unity3d.player.UnityPlayerActivity;

public class HyperJumpActivity extends UnityPlayerActivity {

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        Log.d(TAG, "onCreate instance");
    }

    @Override
    public void onResume(){
        Log.d(TAG, "onResume called..");

        super.onResume();
    }
}

My Manifest.xml: 我的Manifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="preferExternal" package="de.indiegames.hyperjump" android:versionName="1.1" android:versionCode="1">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <uses-sdk android:minSdkVersion="5" android:targetSdkVersion="15" />
  <!-- PERMISSIONS -->
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.GET_TASKS" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE" />
  <uses-permission android:name="com.android.vending.BILLING" />
  <uses-permission android:name="com.android.vending.CHECK_LICENSE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

  <uses-feature android:glEsVersion="0x00010001" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="true" />

  <application android:icon="@drawable/app_icon" android:label="@string/app_name">
    <!-- ACTIVITIES -->
    <activity android:configChanges="keyboardHidden|orientation" android:label="@string/app_name" android:name=".HyperJumpActivity" android:screenOrientation="landscape">
      <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.VideoPlayer" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:screenOrientation="landscape">
    </activity>
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:screenOrientation="landscape">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <activity android:name="com.openfeint.internal.ui.IntroFlow" android:label="IntroFlow" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="landscape" />
    <activity android:name="com.openfeint.api.ui.Dashboard" android:label="Dashboard" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="landscape" />
    <activity android:name="com.openfeint.internal.ui.Settings" android:label="Settings" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="landscape" />
    <activity android:name="com.openfeint.internal.ui.NativeBrowser" android:label="NativeBrowser" android:configChanges="orientation|keyboardHidden" android:theme="@android:style/Theme.NoTitleBar" android:screenOrientation="landscape" />
    <activity android:name="com.chartboost.sdk.CBDialogActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:configChanges="orientation|keyboard|keyboardHidden" android:screenOrientation="landscape">
    </activity>
    <activity android:name="com.flurry.android.CatalogActivity" android:theme="@android:style/Theme.Translucent">
      <intent-filter>
        <action android:name="make.me.unique.please" />
        <category android:name="android.intent.category.DEFAULT" />
      </intent-filter>
    </activity>
    <!-- Tapjoy -->
    <activity android:name="com.tapjoy.TJCOffersWebView" android:configChanges="keyboardHidden|orientation" />
    <activity android:name="com.tapjoy.TapjoyFeaturedAppWebView" android:configChanges="keyboardHidden|orientation" />
    <activity android:name="com.tapjoy.TapjoyVideoView" android:configChanges="keyboardHidden|orientation" />
    <!-- SERVICES AND RECEIVERS -->
    <service android:name="com.prime31.billing.BillingService" />
    <receiver android:name="com.prime31.billing.BillingReceiver">
      <intent-filter>
        <action android:name="com.android.vending.billing.IN_APP_NOTIFY" />
        <action android:name="com.android.vending.billing.RESPONSE_CODE" />
        <action android:name="com.android.vending.billing.PURCHASE_STATE_CHANGED" />
      </intent-filter>
    </receiver>
  </application>
</manifest>

Any hint would be helpful! 任何提示都会有所帮助!

It says it can't resolve the superclass, UnityPlayerActivity. 它说它无法解析超类UnityPlayerActivity。 I've never used Unity, so I don't know how you include their code library; 我从来没有使用过Unity,所以我不知道您如何包括他们的代码库。 maybe you need to do something special to include the Unity classes. 也许您需要做一些特别的事情来包含Unity类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM