I am using Android Studio to build and run a simple application. My problem is that i can't run the project on the emulator although there are no errors except these weird ones:
11-15 17:12:25.250 704-772/system_process I/art: Explicit concurrent mark sweep GC freed 73473(4MB) AllocSpace objects, 28(834KB) LOS objects, 33% free, 9MB/14MB, paused 1.578ms total 87.751ms
11-15 17:12:25.250 704-719/system_process I/art: WaitForGcToComplete blocked for 104.615ms for cause Background
11-15 17:12:25.283 2403-2403/? D/AndroidRuntime: Shutting down VM
11-15 17:12:25.292 2403-2408/? I/art: Debugger is no longer active
11-15 17:12:27.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:12:47.778 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:07.776 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:30.131 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:47.779 704-797/system_process E/WifiStateMachine: CMD_START_SCAN : connected mode and no configuration
11-15 17:13:53.387 82-82/? D/Genyd: Received Set Clipboard
11-15 17:13:53.387 82-82/? D/Genymotion: Received Set Clipboard
I have tried to run another project of mine and it worked perfectly (The problem is related to this specific project). Also, i have tried to kill the adb process and close and reopen this project but the problem persisted.
How to solve this problem?
After spending hours searching to solve this problem, I found that the problem is related to my AndroidManifest.xml, and this is how I found the solution:
Let's have a see at this message in the logcat connected mode and no configuration. Here I have thought about something missed in my project configuration, so I have checked it
Here is the key to finding the solution Run Configuration Error: Default Activity not found. So I have known that the debuger didn't know what is the default activity (the main activity). And now I have checked my AndroidManifest XML file and I have found an important part missing which is the part to tell the debuger which activity is the enter point of my app
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
After updating the AndroidManifest file, everything goes well now, but I still can't understand why Android Studio 1.4 didn't generate it for me automatically.
Hope I have helped.
Related
I am new in android and I am using genymotion emulator, but suddenly i an getting Late-Enabling Check problem in log cat and my app crashed. I try to run it on other emulator but still got the same message in log cat. I search many site but still cant get proper way to solve it. Any help is appreciated.
Here is my logcat:
08-22 02:24:26.639 1323-1323/? D/AndroidRuntime﹕ CheckJNI is OFF
08-22 02:24:29.803 1388-1388/? D/AndroidRuntime﹕ CheckJNI is OFF
08-22 02:24:30.343 1418-1418/? D/dalvikvm﹕ Late-enabling CheckJNI
I also faced this problem. Now I am resolved it.
Just go to Build tab on the top of andorid studio.
then click on Build apk. then run that apk in your device it works and not take much time.
Thank you
I am trying to run my app on a emulator. It used to work but now it does not load properly. The debug error I get is:
static = libcore.io.Posix
Exception = {android.system.ErrnoException#3564}
When I right click on the Exception line and Copy Value I get:
android.system.ErrnoException: stat failed: ENOENT (No such file or directory)
My app does not have any file io programed so the exception must relate to something the system requires.
Looking back in the LogCat I get a match for ENOENT, several lines before are:
com.google.process.location W/art? Suspending all threads took: 7.795ms
com.google.process.location I/art? Background partial concurrent mark sweep GC freed 2094(165KB) AllocSpace objects, 0(0B) LOS objects, 40% free, 3MB/5MB, paused 9.486ms total 274.854ms
com.google.process.location I/GCoreUlr? DispatchingService.onCreate()
com.google.process.location I/GCoreUlr? WorldUpdater received intent Intent { act=com.google.android.location.reporting.ACTION_UPDATE_WORLD cmp=com.google.android.gms/com.google.android.location.reporting.service.DispatchingService (has extras) } with receiverAction android.location.PROVIDERS_CHANGED
com.google.process.location E/copresGcore? Couldn't load settings: /data/data/com.google.android.gms/files/copresence_settings: open failed: ENOENT (No such file or directory)
I cannot see what file it cannot read/write to. I do not have any file IO programmed but I am using sqlite3, maybe to system cannot find the database file.
To get some relief from this error for a while I created a new project in Android Studio. Shut down AS and copied my source files into the new AS project. Then when I ran the new project, the error had gone. It came back after several hours of programing and editing.
I have looked for solutions on the internet for 2 days now without success. Any help would be appreciated.
Further details:
If I run (not debug) the app on the emulator or the device it works.
If I run/debug on the emulator or the device it crashes with the same libcore exception.
Part conclusion: it is something to do with debugging.
I thought I had come across a workaround:
I closed the existing AVD
I ran the AVD from the AS AVD manager
I re-installed the app: adb install -r C:\Users...\app-debug.apk
I ran the app from AS by pushing the debug button
This worked once then the libcore error appeared. This workaround is not good, even if it worked, as the edit run/cycle is too long.
I think the only way is to breakpoint the Google source to determine what it is excepting on. I spent much time searching the internet to find out how to do this without success. If anybody can point me to relevant articles I would be grateful.
I raised Android Open Source Project issue 126510. The comments by jcossi...#gmail.com gave the answer. I had turned on "Java Exception Breakpoints" with "Any exception" checked. This caused the problem when I restarted the project. I seems that applications may use exception handling for not just errors. So if you use "Any exception" be sure to remember to disable it again ASAP.
This answer helped me a lot, but I found that I had to uncheck some of the other fields on the right side of the box.
It seems that this should be a bug in Android Studio - using a provided feature disables the debugger, with no apparent reason or warning.
I'm trying to render a model in libgdx - everything runs perfectly on the desktop, but on android force stop on modelBatch.render(poleInstance, environment);
Log:
03-30 16:37:40.317 5249-5249/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:42.621 5269-5269/? E/cutils-trace﹕ Error opening trace file: No such file or directory (2)
03-30 16:37:46.181 5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache
03-30 16:37:46.209 5283-5283/com.badlogic.gdx.tests E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints()
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ [getAttribValue] Bad attribute idx
03-30 16:37:46.533 5283-5297/com.badlogic.gdx.tests E/EGL_genymotion﹕ tid 5297: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
03-30 16:37:46.825 5283-5297/com.badlogic.gdx.tests E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 168
com.badlogic.gdx.utils.GdxRuntimeException: File not found: com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl (Classpath)
at com.badlogic.gdx.files.FileHandle.read(FileHandle.java:134)
at com.badlogic.gdx.backends.android.AndroidFileHandle.read(AndroidFileHandle.java:78)
at com.badlogic.gdx.files.FileHandle.length(FileHandle.java:548)
at com.badlogic.gdx.backends.android.AndroidFileHandle.length(AndroidFileHandle.java:167)
at com.badlogic.gdx.files.FileHandle.estimateLength(FileHandle.java:229)
at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:194)
at com.badlogic.gdx.files.FileHandle.readString(FileHandle.java:187)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.getDefaultVertexShader(DefaultShader.java:409)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:504)
at com.badlogic.gdx.graphics.g3d.shaders.DefaultShader.<init>(DefaultShader.java:500)
at com.badlogic.gdx.graphics.g3d.utils.DefaultShaderProvider.createShader(DefaultShaderProvider.java:46)
at com.badlogic.gdx.graphics.g3d.utils.BaseShaderProvider.getShader(BaseShaderProvider.java:34)
at com.badlogic.gdx.graphics.g3d.ModelBatch.render(ModelBatch.java:269)
at com.badlogic.gdx.tests.PathTest.render(PathTest.java:221)
at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:391)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
03-30 16:37:51.401 5283-5283/com.badlogic.gdx.tests E/AndroidGraphics﹕ waiting for pause synchronization took too long; assuming deadlock and killing
03-30 16:37:51.521 475-517/system_process E/InputDispatcher﹕ channel '528ce2b4 com.badlogic.gdx.tests/com.badlogic.gdx.tests.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
Yes, my question is similar to this, but updating the library didn't helped
And yes, file com/badlogic/gdx/graphics/g3d/shaders/default.vertex.glsl in place
My code place here
The error is File not found, so apparently it cannot find the file. If you are sure the file is included, this might be caused by duplicate references (although it doesn't have to). For example if you include (and export) the gdx library in both your core and android project. You could check this by right clicking each project, click on Java Build Path and then the Order and Export tab. Make sure that the gdx project (or jar, depending if you work from source or nightly/stable) is only included (and exported by clicking the checkbox) in the core project.
However, having assets (which the shader files are) on the classpath is merely to support out-of-box rendering for libgdx. In your case would advise to copy the shader files to (a subfolder of) your assets folder and use those instead. That makes managing your assets a lot cleaner. You can load the shaders using the constructor of ModelBatch, e.g.:
modelbatch = new ModelBatch(Gdx.files.internal("data/default.vertex.glsl"), Gdx.files.internal("data/default.fragment.glsl"));
Of course, you still might want to double check your project configuration.
Please install Arm Transition on your Genymotion Emulator
Here is a detailed guide on How to install this transition :
How to install Google Play Services in a Genymotion VM (with no drag and drop support)?
I hope this helps.
My wifi works through proxy, so I am using rooted phone with asproxy to connect to the internet.
most of the apps use standard ports (that's my belief), but some uses special ports like play.google.com uses 5228 to connect.
is there a way to know which port my other apps are using (probably to listen) example mighty text so i can configure them in asproxy. I have tried logcat but i doesnot give much details.
logcat extract:
W/com.Alsu.ASProxy( 757): Network connected, starting
> D/WifiWatchdogService( 251): (android.server.ServerThread) wi-fi
> (.f....) does not require the watchdog D/Tethering( 251):
> MasterInitialState.processMessage what=3 D/GTalkService( 2257): #####
> Network broadcast (connected=true) type=WIFI, state=CONNECTED
> I/MediaUploader( 6574): No need to wake up D/GTalkService( 2257):
> [GTalkConnection.1] ### networkStateChanged: active and curr network
> type/state are the same(1/CONNECTED), ignore D/CMStats ( 6594):
> CONNECTIVITY_ACTION: noConnectivity = false D/CMStats ( 6594):
> CONNECTIVITY_ACTION: starting service D/CMStats ( 6594): User has not
> opted in -- skipping reporting.
> **V/texty ( 5190): Data connection is ON.** D/dalvikvm( 370): GC_CONCURRENT freed 390K, 45% free 3913K/7047K, external 133K/513K,
> paused 4ms+6ms W/KeyCharacterMap( 370): Can't open keycharmap file
> W/KeyCharacterMap( 370): Error loading keycharmap file
> '/system/usr/keychars/europa_keypad0.kcm.bin'.
> hw.keyboards.0.devname='europa_keypad0'
When I run my application it does not launch, and shows me this message in Console:
[2012-05-20 17:36:58 - TravelersDictionary] Installation error:
INSTALL_FAILED_INSUFFICIENT_STORAGE
[2012-05-20 17:36:58 - TravelersDictionary] Please check logcat output for more details.
[2012-05-20 17:36:58 - TravelersDictionary] Launch canceled!
I did check my Logcat but there is nothing written in red.
Here is the last 5 logcat messages:
05-20 14:37:36.520: D/ExchangeService(438): Received deviceId from Email app: androidc259148960
05-20 14:37:36.520: D/ExchangeService(438): Reconciling accounts...
05-20 14:37:48.555: W/ThrottleService(75): unable to find stats for iface rmnet0
05-20 14:44:00.404: D/dalvikvm(75): GC_CONCURRENT freed 648K, 13% free 8475K/9735K, paused 12ms+11ms
05-20 14:44:32.975: D/dalvikvm(170): GC_CONCURRENT freed 397K, 13% free 6241K/7111K, paused 8ms+7ms
You get the next error: Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE and as the error said you don't have enough space in your device to install the app, therefore delete some unwanted apps and other data and try again.
it seems that your device is running out of internal storage space, where the application are typically installed. You have two options. Remove some application, or, since you are developing, if you are is going to target API level grater than 8 (Android 2.2), you can set the android:installLocation="preferExternal", in the AndroidManifest.xml file. Android will try to install the application in the external storage, as the doc says:
If you declare "preferExternal", you request that your application be
installed on the external storage, but the system does not guarantee
that your application will be installed on the external storage. If
the external storage is full, the system will install it on the
internal storage.