SOに投稿されたこの質問と同様の質問をたくさん見ましたが、私の質問に答えるものはないようです。簡単に言えば、エミュレーターでアプリを実行しようとするたびに、メイン メニューに戻り、「残念ながら、Scribble Runner が停止しました」というダイアログが表示されます。これが私のBaseActivity
クラスと私のAndroidManifest.xml
ファイルです。
ベースアクティビティ:
import java.io.IOException;
import java.io.InputStream;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.util.FPSLogger;
import org.andengine.opengl.font.Font;
import org.andengine.opengl.font.FontFactory;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.bitmap.BitmapTexture;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.TextureRegion;
import org.andengine.opengl.texture.region.TextureRegionFactory;
import org.andengine.ui.activity.SimpleBaseGameActivity;
import org.andengine.util.adt.io.in.IInputStreamOpener;
import org.andengine.util.debug.Debug;
import android.util.Log;
public class BaseActivity extends SimpleBaseGameActivity {
//CONSTANTS AND FIELDS
public static int CAMERA_WIDTH = 720;
public static int CAMERA_HEIGHT = 480;
public Font mFont;
public Camera mCamera;
private ITextureRegion mBackgroundTextureRegion, mEnemyTextureRegion;
private BitmapTextureAtlas mAutoParallaxBackgroundTexture;
private TextureRegion mParallaxLayerFront;
private TextureRegion mParallaxLayerMid;
private TextureRegion mParallaxLayerBack;
public Scene mCurrentScene;
public static BaseActivity instance;
@Override
public EngineOptions onCreateEngineOptions() {
instance = this;
mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
System.out.println("Engine Created");
return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new
RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), mCamera);
}
@Override
protected void onCreateResources() {
BitmapTextureAtlasTextureRegionFactory.setAssetBasePath("gfx/");
try{
this.mAutoParallaxBackgroundTexture = new BitmapTextureAtlas(this.getTextureManager(), 1024, 1024);
this.mParallaxLayerFront = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mAutoParallaxBackgroundTexture, this, "parallax_background_layer_front.png", 0, 0);
this.mParallaxLayerBack = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mAutoParallaxBackgroundTexture, this, "parallax_background_layer_back.png", 0, 188);
this.mParallaxLayerMid = BitmapTextureAtlasTextureRegionFactory.createFromAsset(this.mAutoParallaxBackgroundTexture, this, "parallax_background_layer_mid.png", 0, 669);
this.mAutoParallaxBackgroundTexture.load();
System.out.println("Resources Created");
}catch(Exception e){
Debug.e(e);
}
}
@Override
protected Scene onCreateScene() {
mEngine.registerUpdateHandler(new FPSLogger());
mCurrentScene = new Scene();
Sprite backgroundSprite1 = new Sprite(0, 0, this.mParallaxLayerBack, getVertexBufferObjectManager());
Sprite backgroundSprite2 = new Sprite(0, 0, this.mParallaxLayerMid, getVertexBufferObjectManager());
Sprite backgroundSprite3 = new Sprite(0, 0, this.mParallaxLayerFront, getVertexBufferObjectManager());
mCurrentScene.attachChild(backgroundSprite1);
mCurrentScene.attachChild(backgroundSprite2);
mCurrentScene.attachChild(backgroundSprite3);
System.out.println("Scene Created");
return mCurrentScene;
}
public static BaseActivity getSharedInstance(){
return instance;
}
//change the current main scene
public void setCurrentScene(Scene scene){
mCurrentScene = scene;
getEngine().setScene(mCurrentScene);
}
}
マニフェスト:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.provisionalsolutions.scribblerunner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.provisionalsolutions.scribblerunner.BaseActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
LogCat は次のとおりです。
02-06 13:41:21.664: W/ActivityManager(275): Unable to start service Intent { act=com.android.email.ACCOUNT_INTENT } U=0: not found
02-06 13:41:21.674: W/Trace(589): Unexpected value from nativeGetEnabledTags: 0
02-06 13:41:21.697: E/ActivityThread(589): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cf2458 that was originally bound here
02-06 13:41:21.697: E/ActivityThread(589): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cf2458 that was originally bound here
02-06 13:41:21.697: E/ActivityThread(589): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
02-06 13:41:21.697: E/ActivityThread(589): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
02-06 13:41:21.697: E/ActivityThread(589): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
02-06 13:41:21.697: E/ActivityThread(589): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
02-06 13:41:21.697: E/ActivityThread(589): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
02-06 13:41:21.697: E/ActivityThread(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
02-06 13:41:21.697: E/ActivityThread(589): at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-06 13:41:21.697: E/ActivityThread(589): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-06 13:41:21.697: E/ActivityThread(589): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-06 13:41:21.697: E/ActivityThread(589): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-06 13:41:21.697: E/ActivityThread(589): at java.lang.Thread.run(Thread.java:856)
02-06 13:41:21.714: E/StrictMode(589): null
02-06 13:41:21.714: E/StrictMode(589): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40cf2458 that was originally bound here
02-06 13:41:21.714: E/StrictMode(589): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
02-06 13:41:21.714: E/StrictMode(589): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
02-06 13:41:21.714: E/StrictMode(589): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
02-06 13:41:21.714: E/StrictMode(589): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
02-06 13:41:21.714: E/StrictMode(589): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
02-06 13:41:21.714: E/StrictMode(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
02-06 13:41:21.714: E/StrictMode(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
02-06 13:41:21.714: E/StrictMode(589): at com.android.emailcommon.service.AccountServiceProxy.getDeviceId(AccountServiceProxy.java:116)
02-06 13:41:21.714: E/StrictMode(589): at com.android.exchange.ExchangeService.getDeviceId(ExchangeService.java:1249)
02-06 13:41:21.714: E/StrictMode(589): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1856)
02-06 13:41:21.714: E/StrictMode(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
02-06 13:41:21.714: E/StrictMode(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
02-06 13:41:21.714: E/StrictMode(589): at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-06 13:41:21.714: E/StrictMode(589): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-06 13:41:21.714: E/StrictMode(589): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-06 13:41:21.714: E/StrictMode(589): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-06 13:41:21.714: E/StrictMode(589): at java.lang.Thread.run(Thread.java:856)
02-06 13:41:21.714: W/ActivityManager(275): Unbind failed: could not find connection for android.os.BinderProxy@40e80c68
02-06 13:41:21.724: E/ActivityThread(589): Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d19e88 that was originally bound here
02-06 13:41:21.724: E/ActivityThread(589): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d19e88 that was originally bound here
02-06 13:41:21.724: E/ActivityThread(589): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
02-06 13:41:21.724: E/ActivityThread(589): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
02-06 13:41:21.724: E/ActivityThread(589): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
02-06 13:41:21.724: E/ActivityThread(589): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
02-06 13:41:21.724: E/ActivityThread(589): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
02-06 13:41:21.724: E/ActivityThread(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
02-06 13:41:21.724: E/ActivityThread(589): at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-06 13:41:21.724: E/ActivityThread(589): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-06 13:41:21.724: E/ActivityThread(589): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-06 13:41:21.724: E/ActivityThread(589): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-06 13:41:21.724: E/ActivityThread(589): at java.lang.Thread.run(Thread.java:856)
02-06 13:41:21.734: E/StrictMode(589): null
02-06 13:41:21.734: E/StrictMode(589): android.app.ServiceConnectionLeaked: Service com.android.exchange.ExchangeService has leaked ServiceConnection com.android.emailcommon.service.ServiceProxy$ProxyConnection@40d19e88 that was originally bound here
02-06 13:41:21.734: E/StrictMode(589): at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:969)
02-06 13:41:21.734: E/StrictMode(589): at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:863)
02-06 13:41:21.734: E/StrictMode(589): at android.app.ContextImpl.bindService(ContextImpl.java:1418)
02-06 13:41:21.734: E/StrictMode(589): at android.app.ContextImpl.bindService(ContextImpl.java:1407)
02-06 13:41:21.734: E/StrictMode(589): at android.content.ContextWrapper.bindService(ContextWrapper.java:473)
02-06 13:41:21.734: E/StrictMode(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:157)
02-06 13:41:21.734: E/StrictMode(589): at com.android.emailcommon.service.ServiceProxy.setTask(ServiceProxy.java:145)
02-06 13:41:21.734: E/StrictMode(589): at com.android.emailcommon.service.ServiceProxy.test(ServiceProxy.java:191)
02-06 13:41:21.734: E/StrictMode(589): at com.android.exchange.ExchangeService$7.run(ExchangeService.java:1850)
02-06 13:41:21.734: E/StrictMode(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:551)
02-06 13:41:21.734: E/StrictMode(589): at com.android.emailcommon.utility.Utility$2.doInBackground(Utility.java:549)
02-06 13:41:21.734: E/StrictMode(589): at android.os.AsyncTask$2.call(AsyncTask.java:287)
02-06 13:41:21.734: E/StrictMode(589): at java.util.concurrent.FutureTask.run(FutureTask.java:234)
02-06 13:41:21.734: E/StrictMode(589): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
02-06 13:41:21.734: E/StrictMode(589): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
02-06 13:41:21.734: E/StrictMode(589): at java.lang.Thread.run(Thread.java:856)
エラーを示すスタック トレースの別の部分を次に示します。
02-06 13:45:37.300: E/AndroidRuntime(815): FATAL EXCEPTION: main
02-06 13:45:37.300: E/AndroidRuntime(815): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.provisionalsolutions.scribblerunner/com.provisionalsolutions.scribblerunner.BaseActivity}: java.lang.ClassNotFoundException: Didn't find class "com.provisionalsolutions.scribblerunner.BaseActivity" on path: /data/app/com.provisionalsolutions.scribblerunner-2.apk
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.os.Handler.dispatchMessage(Handler.java:99)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.os.Looper.loop(Looper.java:137)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-06 13:45:37.300: E/AndroidRuntime(815): at java.lang.reflect.Method.invokeNative(Native Method)
02-06 13:45:37.300: E/AndroidRuntime(815): at java.lang.reflect.Method.invoke(Method.java:511)
02-06 13:45:37.300: E/AndroidRuntime(815): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-06 13:45:37.300: E/AndroidRuntime(815): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-06 13:45:37.300: E/AndroidRuntime(815): at dalvik.system.NativeStart.main(Native Method)
02-06 13:45:37.300: E/AndroidRuntime(815): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.provisionalsolutions.scribblerunner.BaseActivity" on path: /data/app/com.provisionalsolutions.scribblerunner-2.apk
02-06 13:45:37.300: E/AndroidRuntime(815): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-06 13:45:37.300: E/AndroidRuntime(815): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-06 13:45:37.300: E/AndroidRuntime(815): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
02-06 13:45:37.300: E/AndroidRuntime(815): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
02-06 13:45:37.300: E/AndroidRuntime(815): ... 11 more