I am new to android... I want to create simple android game using Andengine. Could you tell how to install Andengine in eclipse....I'm using eclipse on linux.
Edit:
Andengine is installed but I get this error message in logcat:
02-09 00:36:53.562: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg
02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager.
openAsset(Native Method)
02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager
.open(AssetManager.java:313)
02-09 00:36:53.562: ERROR/AndEngine(501): at android.content.res.AssetManager
.open(AssetManager.java:287)
02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.source.AssetTextureSource.<init>(AssetTextureSource.java:46)
02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.region.TextureRegionFactory.createFromAsset(TextureRegionFactory.java:66)
02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.examples.minimal
.AndEngineMinimalExample.onLoadResources(AndEngineMinimalExample.java:59)
02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity
.BaseGameActivity.doResume(BaseGameActivity.java:158)
02-09 00:36:53.562: ERROR/AndEngine(501): at org.anddev.andengine.ui.activity
.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:83)
02-09 00:36:53.562: ERROR/AndEngine(501): at com.android.internal.policy.impl
.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:1981)
02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.View
.dispatchWindowFocusChanged(View.java:3788)
02-09 00:36:53.562: ERROR/AndEngine(501): at android.view.ViewGroup
.dispatchWindowFocusChanged(ViewGroup.java:658)
02-09 00:36:53.562: ERROR/AndEngine(501): at
android.view.ViewRoot.handleMessage(ViewRoot.java:1921)
02-09 00:36:53.562: ERROR/AndEngine(501): at
android.os.Handler.dispatchMessage(Handler.java:99)
02-09 00:36:53.562: ERROR/AndEngine(501): at android.os.Looper.loop(Looper.java:123)
02-09 00:36:53.562: ERROR/AndEngine(501): at
android.app.ActivityThread.main(ActivityThread.java:4627)
02-09 00:36:53.562: ERROR/AndEngine(501): at
java.lang.reflect.Method.invokeNative(Native Method)
02-09 00:36:53.562: ERROR/AndEngine(501): at
java.lang.reflect.Method.invoke(Method.java:521)
02-09 00:36:53.562: ERROR/AndEngine(501): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-09 00:36:53.562: ERROR/AndEngine(501): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-09 00:36:53.562: ERROR/AndEngine(501): at dalvik.system.NativeStart.main
(Native Method)
02-09 00:36:53.821: DEBUG/dalvikvm(501): GC_EXTERNAL_ALLOC freed 1797 objects /
148120 bytes in 173ms
02-09 00:36:54.160: DEBUG/libEGL(501): egl.cfg not found, using default config
02-09 00:36:54.230: DEBUG/libEGL(501): loaded /system/lib/egl/libGLES_android.so
02-09 00:36:54.425: DEBUG/AndEngine(501): onSurfaceCreated
02-09 00:36:54.441: DEBUG/AndEngine(501): RENDERER: Android PixelFlinger 1.3
02-09 00:36:54.500: DEBUG/AndEngine(501): VERSION: OpenGL ES-CM 1.0
02-09 00:36:54.511: DEBUG/AndEngine(501): EXTENSIONS: GL_OES_byte_coordinates
GL_OES_fixed_point GL_OES_single_precision GL_OES_read_format
GL_OES_compressed_paletted_texture GL_OES_draw_texture GL_OES_matrix_get
GL_OES_query_matrix GL_OES_EGL_image GL_OES_compressed_ETC1_RGB8_texture
GL_ARB_texture_compression GL_ARB_texture_non_power_of_two
GL_ANDROID_user_clip_plane
GL_ANDROID_vertex_buffer_object GL_ANDROID_generate_mipmap
02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_VERXTEXBUFFEROBJECTS = false
02-09 00:36:54.531: DEBUG/AndEngine(501): EXTENSIONS_DRAWTEXTURE = true
02-09 00:36:54.541: DEBUG/AndEngine(501): onSurfaceChanged: pWidth=480 pHeight=320
02-09 00:36:54.630: ERROR/AndEngine(501): Failed loading Bitmap in
AssetTextureSource. AssetPath: ggg
02-09 00:36:54.630: ERROR/AndEngine(501): java.io.FileNotFoundException: ggg
02-09 00:36:54.630: ERROR/AndEngine(501): at
android.content.res.AssetManager.openAsset(Native Method)
02-09 00:36:54.630: ERROR/AndEngine(501): at
android.content.res.AssetManager.open(AssetManager.java:313)
02-09 00:36:54.630: ERROR/AndEngine(501): at
android.content.res.AssetManager.open(AssetManager.java:287)
02-09 00:36:54.630: ERROR/AndEngine(501): at
org.anddev.andengine.opengl.texture.source
.AssetTextureSource.onLoadBitmap(AssetTextureSource.java:95)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.Texture$TextureSourceWithLocation.onLoadBitmap(Texture.java:364)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.Texture.writeTextureToHardware(Texture.java:208)
02-09 00:36:54.630: ERROR/AndEngine(501): at
org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.TextureManager.updateTextures(TextureManager.java:136)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.engine.Engine
.onDrawFrame(Engine.java:508)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
02-09 00:36:54.630: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
02-09 00:36:54.751: ERROR/AndEngine(501): Error loading: AssetTextureSource(ggg)
02-09 00:36:54.751: ERROR/AndEngine(501): java.lang.IllegalArgumentException:
TextureSource: AssetTextureSource(ggg) returned a null Bitmap.
02-09 00:36:54.751: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.Texture.writeTextureToHardware(Texture.java:211)
02-09 00:36:54.751: ERROR/AndEngine(501): at
org.anddev.andengine.opengl.texture.Texture.loadToHardware(Texture.java:175)
02-09 00:36:54.751: ERROR/AndEngine(501): at org.anddev.andengine.opengl.texture
.TextureManager.updateTextures(TextureManager.java:136)
02-09 00:36:54.751: ERROR/AndEngine(501): at
org.anddev.andengine.engine.Engine.onDrawFrame(Engine.java:508)
02-09 00:36:54.751: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
02-09 00:36:54.751: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
02-09 00:36:54.751: ERROR/AndEngine(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
02-09 00:36:54.793: WARN/dalvikvm(501): threadid=7: thread exiting with uncaught
exception (group=0x4001d800)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): FATAL EXCEPTION: GLThread
02-09 00:36:54.831: ERROR/AndroidRuntime(501): java.lang.IllegalArgumentException:
TextureSource: AssetTextureSource(ggg) returned a null Bitmap.
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.texture
.Texture.writeTextureToHardware(Texture.java:211)
02-09 00:36:54.831: ERROR/AndroidRuntime(501):at org.anddev.andengine.opengl.texture
.Texture.loadToHardware(Texture.java:175)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at
org.anddev.andengine.opengl.texture
.TextureManager.updateTextures(TextureManager.java:136)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.engine
.Engine.onDrawFrame(Engine.java:508)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.view
.RenderSurfaceView$Renderer.onDrawFrame(RenderSurfaceView.java:148)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:617)
02-09 00:36:54.831: ERROR/AndroidRuntime(501): at org.anddev.andengine.opengl.view
.GLSurfaceView$GLThread.run(GLSurfaceView.java:549)
02-09 00:36:54.983: WARN/ActivityManager(66):Force finishing
activityorg.anddev.andengine.examples.minimal/.AndEngineMinimalExample
02-09 00:36:55.661: DEBUG/dalvikvm(66): GC_EXPLICIT freed 2704 objects /
163368 bytes in 265ms
02-09 00:36:55.743: INFO/WindowManager(66): Setting rotation to 0, animFlags=1
02-09 00:36:55.781: INFO/ActivityManager(66): Config changed: { scale=1.0 imsi=310/260
loc=en_US touch=3 keys=2/1/2 nav=3/1 orien=1 layout=18 uiMode=17 seq=13}
02-09 00:36:56.240: WARN/ActivityManager(66): Activity pause timeout for
HistoryRecord{43fd2338 org.anddev
.andengine.examples.minimal/.AndEngineMinimalExample}
02-09 00:36:56.922: WARN/IInputConnectionWrapper(288): showStatusIcon on inactive
InputConnection
02-09 00:36:57.416: WARN/WindowManager(66): Window freeze timeout expired.
02-09 00:36:57.416: WARN/WindowManager(66): Force clearing orientation change:
Window{43fecea8 StatusBarExpanded paused=false}
02-09 00:36:57.431: WARN/WindowManager(66): Force clearing orientation change:
Window{43fba7b0 com.android.launcher/com.android.launcher2.Launcher paused=false}
02-09 00:36:59.090: DEBUG/dalvikvm(335): GC_EXPLICIT freed 85 objects / 3560bytes
in 12084ms
02-09 00:36:59.891: DEBUG/dalvikvm(66): GC_EXPLICIT freed 1126 objects / 61592 bytes
in 399ms
02-09 00:37:07.941: WARN/ActivityManager(66): Activity destroy timeout for
HistoryRecord{43fd2338 org.anddev.andengine.examples.minimal/
.AndEngineMinimalExample}
just add the andengine.jar to your lib folder in your project (if you don't have one create it)
then add the jar on the project build path
there you have it, you succesfully installed andengine
How to get full sources in true way
cd EclipseWorkspace/
hg clone https://code.google.com/p/andengine/ AndEngine
hg clone https://code.google.com/p/andenginelivewallpaperextension/ AndEngineLiveWallpaperExtension
hg clone https://code.google.com/p/andenginemodplayerextension/ AndEngineMODPlayerExtension
hg clone https://code.google.com/p/andenginemultiplayerextension/ AndEngineMultiplayerExtension
hg clone https://code.google.com/p/andenginemultitouchextension/ AndEngineMultiTouchExtension
hg clone https://code.google.com/p/andenginephysicsbox2dextension/ AndEnginePhysicsBox2DExtension
hg clone https://code.google.com/p/andengineaugmentedrealityextension/ AndEngineAugmentedRealityExtension
hg clone https://code.google.com/p/andenginesvgtextureregionextension/ AndEngineSVGTextureRegionExtension
hg clone https://code.google.com/p/andenginetexturepackerextension/ AndEngineTexturePackerExtension
hg clone https://code.google.com/p/andengineexamples/ AndEngineExamples
mkdir AndEngine/res
mkdir AndEngineLiveWallpaperExtension/res
mkdir AndEngineMODPlayerExtension/res
mkdir AndEngineMultiplayerExtension/res
mkdir AndEngineMultiTouchExtension/res
mkdir AndEnginePhysicsBox2DExtension/res
mkdir AndEngineAugmentedRealityExtension/res
mkdir AndEngineSVGTextureRegionExtension/res
mkdir AndEngineTexturePackerExtension/res
then import all project into eclipse's workspace and run AndEngineExamples
Related
Are the androidx libraries available in Visual Studio's NuGet package manager?
My app is targeting Android P so I can use the androidx libraries in Android Studio but I can't find them in NuGet.
With Android Studio I can use:
<androidx.constraintlayout.widget.ConstraintLayout
but throws exception in Visual Studio:
02-09 21:31:59.970 I/MonoDroid( 8843): UNHANDLED EXCEPTION:
02-09 21:32:00.137 I/MonoDroid( 8843): Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout ---> Android.Views.InflateException: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout ---> Java.Lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.ConstraintLayout" on path: DexPathList[[zip file "/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk"],nativeLibraryDirectories=[/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/lib/x86, /data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk!/lib/x86, /system/lib]]
02-09 21:32:00.137 I/MonoDroid( 8843): --- End of inner exception stack trace ---
02-09 21:32:00.137 I/MonoDroid( 8843): --- End of inner exception stack trace ---
02-09 21:32:00.137 I/MonoDroid( 8843): at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <8acc8089c2ed40d08469fbaa6710a44c>:0
02-09 21:32:00.137 I/MonoDroid( 8843): at Java.Interop.JniPeerMembers+JniInstanceMethods.InvokeVirtualVoidMethod (System.String encodedMember, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0005d] in <8acc8089c2ed40d08469fbaa6710a44c>:0
02-09 21:32:00.137 I/MonoDroid( 8843): at Android.App.Activity.SetContentView (System.Int32 layoutResID) [0x00022] in <957bbfdfda4341e2939c881206c1140a>:0
02-09 21:32:00.137 I/MonoDroid( 8843): at Keystore.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00009] in H:\My Projects\Android\Samples\Keystore\MainActivity.cs:19
02-09 21:32:00.137 I/MonoDroid( 8843): at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <957bbfdfda4341e2939c881206c1140a>:0
02-09 21:32:00.138 I/MonoDroid( 8843): at (wrapper dynamic-method) System.Object.3(intptr,intptr,intptr)
02-09 21:32:00.138 I/MonoDroid( 8843): --- End of managed Android.Views.InflateException stack trace ---
02-09 21:32:00.138 I/MonoDroid( 8843): android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
02-09 21:32:00.138 I/MonoDroid( 8843): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class androidx.constraintlayout.widget.ConstraintLayout
02-09 21:32:00.138 I/MonoDroid( 8843): Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.ConstraintLayout" on path: DexPathList[[zip file "/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk"],nativeLibraryDirectories=[/data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/lib/x86, /data/app/Keystore.Keystore-aaHeQkjsNRoUnkfPmnf7Tw==/base.apk!/lib/x86, /system/lib]]
02-09 21:32:00.138 I/MonoDroid( 8843): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
02-09 21:32:00.138 I/MonoDroid( 8843): at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
02-09 21:32:00.138 I/MonoDroid( 8843): at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createView(LayoutInflater.java:606)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
02-09 21:32:00.138 I/MonoDroid( 8843): at md561c0eefc2ba1e38323457d81b00d3caf.MainActivity.n_onCreate(Native Method)
02-09 21:32:00.138 I/MonoDroid( 8843): at md561c0eefc2ba1e38323457d81b00d3caf.MainActivity.onCreate(MainActivity.java:31)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Activity.performCreate(Activity.java:7136)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Activity.performCreate(Activity.java:7127)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
02-09 21:32:00.138 I/MonoDroid( 8843): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.os.Handler.dispatchMessage(Handler.java:106)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.os.Looper.loop(Looper.java:193)
02-09 21:32:00.139 I/MonoDroid( 8843): at android.app.ActivityThread.main(ActivityThread.java:6669)
02-09 21:32:00.139 I/MonoDroid( 8843): at java.lang.reflect.Method.invoke(Native Method)
02-09 21:32:00.139 I/MonoDroid( 8843): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
02-09 21:32:00.139 I/MonoDroid( 8843): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
So is there a way to use the androidx libraries with Xamarin.Android?
The reason you cannot find it is because you must not have its NuGet
We need to add Xamarin.Android.Support.Constraint.Layout package to support ConstraintLayout in our Xamarin.Android project. So to add this package right click on
Packages > Add Packages. //MAC
References -> Manage NuGet Packages //Windows
Search for ConstraintLayout and add a package by accepting a licence.
And use the following namespace <android.support.constraint.ConstraintLayout> in XML
Update
In my knowledge <androidx.constraintlayout.widget.ConstraintLayout is unavailable in Mono.Droid and hence you might have to bind it to an AAR and then use that AAR to make a Xamarin Binding fix the issues that happen while making that binding and then use it into your Droid project as a .dll
So, it is finally available https://devblogs.microsoft.com/xamarin/androidx-for-xamarin/
The NuGet list is here.
I downloaded csipsimple and compile successfully. application is working fine on android version below lolipop (5.0) but while I run android APK in MARSHMALLOW (6.0), android app goes crashed and a give this toast as "Can't load native library. CPU arch invalid for this build".
I am getting the below exception while I am running this:
02-09 18:11:51.236: E/SIP SRV(4758): RESET SETTINGS !!!! 02-09
18:11:53.979: E/PjService(4758): We have a problem with the current
stack.... NOT YET Implemented 02-09 18:11:53.979: E/PjService(4758):
java.lang.UnsatisfiedLinkError: Cannot load library:
reloc_library[1290]: 113 cannot locate '__aeabi_ldiv0'... 02-09
18:11:53.979: E/PjService(4758): at
java.lang.Runtime.loadLibrary(Runtime.java:370) 08-05 18:11:53.979:
E/PjService(4758): at java.lang.System.loadLibrary(System.java:535)
02-09 18:11:53.979: E/PjService(4758): at
com.csipsimple.pjsip.PjSipService.tryToLoadStack(PjSipService.java:151)
02-09 18:11:53.979: E/PjService(4758): at
com.csipsimple.service.SipService.loadStack(SipService.java:1179)
02-09 18:11:53.979: E/PjService(4758): at
com.csipsimple.service.SipService.onStart(SipService.java:1099) 02-09
18:11:53.979: E/PjService(4758): at
android.app.Service.onStartCommand(Service.java:438) 02-09
18:11:53.979: E/PjService(4758): at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2715)
02-09 18:11:53.979: E/PjService(4758): at
android.app.ActivityThread.access$1900(ActivityThread.java:139) 02-09
18:11:53.979: E/PjService(4758): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1334)
02-09 18:11:53.979: E/PjService(4758): at
android.os.Handler.dispatchMessage(Handler.java:99) 02-09
18:11:53.979: E/PjService(4758): at
android.os.Looper.loop(Looper.java:154) 02-09 18:11:53.979:
E/PjService(4758): at
android.app.ActivityThread.main(ActivityThread.java:4944) 02-09
18:11:53.979: E/PjService(4758): at
java.lang.reflect.Method.invokeNative(Native Method) 02-09
18:11:53.979: E/PjService(4758): at
java.lang.reflect.Method.invoke(Method.java:511) 02-09 18:11:53.979:
E/PjService(4758): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
02-09 18:11:53.979: E/PjService(4758): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 02-09
18:11:53.979: E/PjService(4758): at
dalvik.system.NativeStart.main(Native Method)
could anyone help me to get rid of this.?
It means that your native libs missing some architecture specific builds specific to your device. E.g. in my project list of native libs looks like:
You have to check availability of your native libararies against used architecture
I renamed my Project in eclipse I tried to run my app on my device. but ever since I am getting Unfortunately, App has stopped. I manually edited the AndroidManifest.xml to check if the file paths are correct as AndroidManifest doesn't seem to reflect the changes after renaming project, I would be grateful if you help. Here is the logcat
02-09 11:38:43.872: D/AndroidRuntime(26838): Shutting down VM
02-09 11:38:43.880: E/AndroidRuntime(26838): FATAL EXCEPTION: main
02-09 11:38:43.880: E/AndroidRuntime(26838): Process: com.ummahtalk.community, PID: 26838
02-09 11:38:43.880: E/AndroidRuntime(26838): java.lang.RuntimeException: Unable to instantiate application com.ummahtalk.community.SpikaApp: java.lang.ClassNotFoundException: Didn't find class "com.ummahtalk.community.SpikaApp" on path: DexPathList[[zip file "/data/app/com.ummahtalk.community-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4491)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.os.Handler.dispatchMessage(Handler.java:102)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.os.Looper.loop(Looper.java:135)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.ActivityThread.main(ActivityThread.java:5221)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.reflect.Method.invoke(Native Method)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.reflect.Method.invoke(Method.java:372)
02-09 11:38:43.880: E/AndroidRuntime(26838): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
02-09 11:38:43.880: E/AndroidRuntime(26838): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
02-09 11:38:43.880: E/AndroidRuntime(26838): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ummahtalk.community.SpikaApp" on path: DexPathList[[zip file "/data/app/com.ummahtalk.community-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-09 11:38:43.880: E/AndroidRuntime(26838): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.Instrumentation.newApplication(Instrumentation.java:979)
02-09 11:38:43.880: E/AndroidRuntime(26838): at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
02-09 11:38:43.880: E/AndroidRuntime(26838): ... 10 more
02-09 11:38:43.880: E/AndroidRuntime(26838): Suppressed: java.lang.ClassNotFoundException: com.ummahtalk.community.SpikaApp
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.Class.classForName(Native Method)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-09 11:38:43.880: E/AndroidRuntime(26838): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-09 11:38:43.880: E/AndroidRuntime(26838): ... 13 more
02-09 11:38:43.880: E/AndroidRuntime(26838): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
02-09 11:38:53.991: D/AndroidRuntime(27142): Shutting down VM
02-09 11:38:53.993: E/AndroidRuntime(27142): FATAL EXCEPTION: main
02-09 11:38:53.993: E/AndroidRuntime(27142): Process: com.ummahtalk.community, PID: 27142
02-09 11:38:53.993: E/AndroidRuntime(27142): java.lang.RuntimeException: Unable to instantiate application com.ummahtalk.community.SpikaApp: java.lang.ClassNotFoundException: Didn't find class "com.ummahtalk.community.SpikaApp" on path: DexPathList[[zip file "/data/app/com.ummahtalk.community-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.LoadedApk.makeApplication(LoadedApk.java:563)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4491)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.ActivityThread.access$1500(ActivityThread.java:144)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1339)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.os.Handler.dispatchMessage(Handler.java:102)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.os.Looper.loop(Looper.java:135)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.ActivityThread.main(ActivityThread.java:5221)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.reflect.Method.invoke(Native Method)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.reflect.Method.invoke(Method.java:372)
02-09 11:38:53.993: E/AndroidRuntime(27142): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
02-09 11:38:53.993: E/AndroidRuntime(27142): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
02-09 11:38:53.993: E/AndroidRuntime(27142): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ummahtalk.community.SpikaApp" on path: DexPathList[[zip file "/data/app/com.ummahtalk.community-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
02-09 11:38:53.993: E/AndroidRuntime(27142): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.Instrumentation.newApplication(Instrumentation.java:979)
02-09 11:38:53.993: E/AndroidRuntime(27142): at android.app.LoadedApk.makeApplication(LoadedApk.java:558)
02-09 11:38:53.993: E/AndroidRuntime(27142): ... 10 more
02-09 11:38:53.993: E/AndroidRuntime(27142): Suppressed: java.lang.ClassNotFoundException: com.ummahtalk.community.SpikaApp
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.Class.classForName(Native Method)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
02-09 11:38:53.993: E/AndroidRuntime(27142): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
02-09 11:38:53.993: E/AndroidRuntime(27142): ... 13 more
02-09 11:38:53.993: E/AndroidRuntime(27142): Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
02-09 11:39:54.371: I/Process(27142): Sending signal. PID: 27142 SIG: 9
I had renamed the project using Android Tools>>Rename Application package but Then I figured out everything was not renamed correctly then I tried doing Refactor>Rename and It solved it
Just faced the exact problem. I tried all the solutions above non worked.
I got it fixed by exiting android studio, copying the entire project folder to a new location, launching android studio and opening the project from the new location.
Ok, I have been losing a lot of sleep over this, I can not seem to find what the issue is.
I am trying to integrate google drive with a big application I am working on with a team. .
Here is what logcat spits out:
02-09 10:13:40.979: E/AndroidRuntime(9768): java.lang.NoClassDefFoundError: com.google.android.gms.common.AccountPicker
02-09 10:13:40.979: E/AndroidRuntime(9768): at com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential.newChooseAccountIntent(GoogleAccountCredential.java:171)
02-09 10:13:40.979: E/AndroidRuntime(9768): at graef.mobile.activities.DriveHandler.onCreate(DriveHandler.java:36)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.Activity.performCreate(Activity.java:4465)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2033)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.ActivityThread.access$600(ActivityThread.java:132)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1157)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.os.Looper.loop(Looper.java:137)
02-09 10:13:40.979: E/AndroidRuntime(9768): at android.app.ActivityThread.main(ActivityThread.java:4575)
02-09 10:13:40.979: E/AndroidRuntime(9768): at java.lang.reflect.Method.invokeNative(Native Method)
02-09 10:13:40.979: E/AndroidRuntime(9768): at java.lang.reflect.Method.invoke(Method.java:511)
02-09 10:13:40.979: E/AndroidRuntime(9768): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
02-09 10:13:40.979: E/AndroidRuntime(9768): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
02-09 10:13:40.979: E/AndroidRuntime(9768): at dalvik.system.NativeStart.main(Native Method)
I have all the libraries I need, I have also gotten a few Multiple dex errors. so I have nothing in my libs folder because I found that as a solution to that problem because of double jars in /libs and /bin/dexedLibs
Any help would much be appreciated
Let me know what other information I need to provide.
I needed to make sure I had google play service imported and checked in order and export
I also had same problem, until I add:
import com.google.android.gms.common.AccountPicker;
in my activity.java file. Hope it works for your problem too.
I have add a ImageView and assign a jpg file(a1.jpg), the file is 770Kb. When I run the project, that will Crash and show a lot of error log. I have try another jpg file, the the size is 70KB and run the project, that become no problem. Why? Thanks!
<ImageView
android:id="#+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:contentDescription="#string/Test_string"
android:src="#drawable/a1" />
The error log
02-09 12:47:34.692: D/AndroidRuntime(1023): Shutting down VM
02-09 12:47:34.692: W/dalvikvm(1023): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
02-09 12:47:34.802: E/AndroidRuntime(1023): FATAL EXCEPTION: main
02-09 12:47:34.802: E/AndroidRuntime(1023): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lighter.androidntest4/com.lighter.androidntest4.MainActivity}: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.os.Handler.dispatchMessage(Handler.java:99)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.os.Looper.loop(Looper.java:137)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-09 12:47:34.802: E/AndroidRuntime(1023): at java.lang.reflect.Method.invokeNative(Native Method)
02-09 12:47:34.802: E/AndroidRuntime(1023): at java.lang.reflect.Method.invoke(Method.java:511)
02-09 12:47:34.802: E/AndroidRuntime(1023): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-09 12:47:34.802: E/AndroidRuntime(1023): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-09 12:47:34.802: E/AndroidRuntime(1023): at dalvik.system.NativeStart.main(Native Method)
02-09 12:47:34.802: E/AndroidRuntime(1023): Caused by: android.view.InflateException: Binary XML file line #7: Error inflating class <unknown>
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
02-09 12:47:34.802: E/AndroidRuntime(1023): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-09 12:47:34.802: E/AndroidRuntime(1023): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.Activity.setContentView(Activity.java:1881)
02-09 12:47:34.802: E/AndroidRuntime(1023): at com.lighter.androidntest4.MainActivity.onCreate(MainActivity.java:15)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.Activity.performCreate(Activity.java:5104)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-09 12:47:34.802: E/AndroidRuntime(1023): ... 11 more
02-09 12:47:34.802: E/AndroidRuntime(1023): Caused by: java.lang.reflect.InvocationTargetException
02-09 12:47:34.802: E/AndroidRuntime(1023): at java.lang.reflect.Constructor.constructNative(Native Method)
02-09 12:47:34.802: E/AndroidRuntime(1023): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
02-09 12:47:34.802: E/AndroidRuntime(1023): ... 24 more
02-09 12:47:34.802: E/AndroidRuntime(1023): Caused by: java.lang.OutOfMemoryError
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.content.res.Resources.loadDrawable(Resources.java:1965)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.widget.ImageView.<init>(ImageView.java:120)
02-09 12:47:34.802: E/AndroidRuntime(1023): at android.widget.ImageView.<init>(ImageView.java:110)
02-09 12:47:34.802: E/AndroidRuntime(1023): ... 27 more
It's probably because you're trying to load too large file. Even your error says so:
Caused by: java.lang.OutOfMemoryError
770KB image is quite large for android application. You should really think about something smaller.
You can also increase heap size for your emulator in AVD, but still in your situation it's better to use smaller image if you can.
Hmmm... it sounds like your drawable may not be setup correctly. Are you sure about the name etc?
The emulator cannot support that large an image, as shown by java.lang.OutOfMemoryError. You should be able to customise the emulator to allow larger memory by going into the AVD manager (I believe it is Max VM application heap size).
I had the same issue and Piotr Chojnacki was right; it was a image size issue. I assume that this is more of an issue for older devices and the emulator.