2012-03-27 58 views
2

我的eclipse构建最近出现了一个奇怪的问题。当通过Unity构建我的应用程序时,一切正常,构建运行正常,但是我需要使用eclipse来处理它,因为我有一些我想要使用的插件。使用Eclipse构建时,Android构建失败

我使用与Unity生成的相同的Manifest.xml,只是按照文档中所述更改包名和活动名称。有人提示可能是什么问题?

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} 

我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(); 
    } 
} 

我的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> 

任何暗示将是有益的!

+0

无论出于何种原因,您的HyperActivity超类无法找到。你可以清理你的构建,然后重建,以确保它在上传的pkg中? – KevinDTimm 2012-03-27 16:38:38

回答

0

它说它无法解析超类UnityPlayerActivity。我从来没有使用Unity,所以我不知道你是如何包含他们的代码库的;也许你需要做一些特别的事情来包含Unity类。