I've created a simple application with Xamarin trial edition, which just shows a splash screen. After I hit "Run" in Xamarin studio it deploys and runs just fine, but if I click "Home" on the device and try to run application from the application list - screen flickers for a moment and application gets terminated, no breakpoints get hit on the second run. This is true for both emulator and a physical device.
I doubt it matters, but my code is as following.
Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<ImageView
android:src="#drawable/splash"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="#+id/imageView1" />
</LinearLayout>
Activity:
using Android.App;
using Android.OS;
using System;
using Android.Views;
namespace MyApplication.Activities
{
[Activity(Label = "My application", MainLauncher = true)]
public class SplashActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
RequestWindowFeature(WindowFeatures.NoTitle);
SetContentView(Resource.Layout.Splash);
}
}
}
Does the problem occur because it's a trial edition of Xamarin?
Ok, it looks like trial edition is indeed causing my problems. Adb logcat had lines:
I/ActivityManager( 308): Displayed MyApplication/MyApplication.Activities.SplashActivity: +845ms
D/Finsky ( 759): [1] 5.onFinished: Installation state replication succeeded.
I/ActivityManager( 308): START {act=android.intent.action.MAIN cat=[android.int
ent.category.LAUNCHER] flg=0x10200000 cmp=MyApplication/MyApplication.TrialSplashS
creenf2b499ae00e24b5ba2aa0253572b8e1e u=0} from pid 518
D/dalvikvm( 308): GC_FOR_ALLOC freed 1293K, 15% free 18885K/22023K, paused 66ms
, total 67ms
D/dalvikvm( 7162): Late-enabling CheckJNI
I/ActivityManager( 308): Start proc MyApplication for activity MyApplication/MyApplication.TrialSplashScreenf2b499ae00e24b5ba2aa0253572b8e1e: pid=7162 uid=10067 g
ids={3003, 1015, 1028}
I/dalvikvm( 7162): Turning on JNI app bug workarounds for target SDK version 10.
..
I/ActivityThread( 7162): Pub MyApplication.mono.MonoRuntimeProvider.__mono_init__
: mono.MonoRuntimeProvider
D/dalvikvm( 7162): Trying to load lib /data/data/MyApplication/lib/libmonodroid.s
o 0x4266ae60
D/dalvikvm( 7162): Added shared lib /data/data/MyApplication/lib/libmonodroid.so
0x4266ae60
F/MonoDroid( 7162): **This installation has expired**.
D/Zygote ( 125): Process 7162 exited cleanly (11)
Although, trial splash screen states, that build will work for 24 hours - it expires immediately for some reason. Oh well, I can live with that.
Update:
Yep, problem went away after I purchased and activated a license.
Related
I use the Android studio 2.0, and configure the project with the official doc , the config of instant run in the setting window of AS has changed from disabled to enabled state. As well the run icon has lightning now,but when i change the code, just add a toast in a function, and click the lightning run, the application will be exit, and log show like below:
11-24 19:59:40.382 20951-20957/com.ss.android.essay.joke I/art: System.exit called, status: 1
11-24 19:59:40.383 20951-20957/com.xxx I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.
11-24 19:59:40.475 4922-14521/? I/WindowState: WIN DEATH: Window{651bd86 u0 com.ss.android.essay.joke/com.xxx.MainActivity}
Edit:The status of bug has updated,crash not happened again with alpha2,but still can't use instant-run, more detail:https://code.google.com/p/android/issues/detail?id=195064
Edit: Android studio 2.1.1 with 2.12 gradle work well now.
Pretty sure your change is not covered by Instant Run, check out Android tools site for a list of supported hot swap actions:
I have an app that I have been using for a long while now. It's open source and fell out of development. I started modifying it when it broke and it worked fine on my Epic Touch. I recently picked up the Sprint Note 2 and installed it. It forced closed on me. I decided "OK lets see whats going on and why its FCing". I ran it in an emulator 4.1.2 and it worked fine. When I tried to debug it in eclipse using the real phone my logcat showed problems and never loaded:
D/dalvikvm( 1032): Added shared lib libnativehelper.so 0x0
D/dalvikvm( 1032): Note: class Landroid/app/ActivityManagerNative; has 153 ulemented (abstract) methods
D/AndroidRuntime( 1032): Calling main entry com.android.commands.pm.Pm
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
I/ApplicationPolicy( 2487): isApplicationInstallationEnabled
W/zipro (30332): Unable to open zip '/data/local/tmp/BalanceWidget.apk': Permission denied
D/asset (30332): failed to open Zip archive '/data/local/tmp/BalanceWidget'
D/dalvikvm( 2487): WAIT_FOR_CONCURRENT_GC blocked 0ms
W/DefContainer(30332): Failed to parse package
W/PackageManager( 2487): verifying app can be installed or not
W/DefContainer(30332): Failed to parse package
D/dalvikvm( 2487): GC_EXPLICIT freed 329K, 14% free 44856K/51591K, paused 4ms, total 96ms
D/AndroidRuntime( 1032): Shutting down VM
D/dalvikvm( 1032): GC_CONCURRENT freed 128K, 87% free 568K/4096K, paused 0ms, total 2ms
D/jdwp ( 1032): Got wake-up signal, bailing out of select
I tried wiping the cache, chmoding the folders, but nothing worked. I changed to a different project to see if it was that project but it did the same thing.
Does anyone have any ideas on what the problem could be and how to fix it?
My phone:
Rooted Stock Sprint Note 2
L900VPALJC
OS Running - Android 4.1.1
Thanks
I have a Samsung Galaxy S3 and I've built the stock AOSP ICS Launcher2 app. I then tried to install the apk via "adb install" but I get an "INSTALL_FAILED_DEXOPT" error when I do that. The device logcat is as follows:
D/AndroidRuntime( 5431):
D/AndroidRuntime( 5431): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
D/AndroidRuntime( 5431): CheckJNI is OFF
D/AndroidRuntime( 5431): setted country_code = France
D/AndroidRuntime( 5431): setted countryiso_code = FR
D/AndroidRuntime( 5431): setted sales_code = XEF
D/AndroidRuntime( 5431): readGMSProperty: start
D/AndroidRuntime( 5431): readGMSProperty: already setted!!
D/AndroidRuntime( 5431): readGMSProperty: end
D/LibQmg_native( 5431): register_android_app_LibQmg
D/AndroidRuntime( 5431): Calling main entry com.android.commands.pm.Pm
W/PackageManager( 2093): verifying app can be installed or not
I/ApplicationPolicy( 2093): isApplicationInstallationEnabled
D/dalvikvm( 2093): GC_CONCURRENT freed 7885K, 31% free 32346K/46791K, paused 2ms+6ms
D/dalvikvm( 2093): GC_CONCURRENT freed 1834K, 31% free 32555K/46791K, paused 3ms+5ms
E/PackageManager( 2093): Package XXX.XXXXXXX.XXXXXXXX has mismatched uid: 10130 on disk, 10131 in settings
I/PackageManager( 2093): Running dexopt on: XXX.XXXXXXX.XXXXXXXX
I/PackageManager( 2093): Linking native library dir for |XXXX|XXX|XXXXXXXXXXXXXXXXXXXXXX.XXX
W/dalvikvm( 5442): DexOptZ: zip archive '/data/app/com.android.launcher-1.apk' does not include classes.dex
W/installd( 1907): DexInv: --- END '/data/app/com.android.launcher-1.apk' --- status=0xff00, process failed
E/installd( 1907): dexopt failed on '/data/dalvik-cache/data#app#com.android.launcher-1.apk#classes.dex' res = 65280
W/PackageManager( 2093): Package couldn't be installed in /data/app/com.android.launcher-1.apk
What could I have done wrong?
Thanks.
You need to increase the Android emulator's memory capacity, there are 2 ways for that:
1- Right click the root of your Android Project, go to "Run As" then go to "Run Configurations..." locate the "Android Application" node in the tree at the left, then select your project and go to the "Target" tab on the right side of the window look down for the "Additional Emulator Command Line Options" field (sometimes you'll need to make the window larger) and finally paste "-partition-size 1024" there. Click Apply and then Run to use your emulator.
2- Go to Eclipse's Preferences, then Select “Launch” Add “-partition-size 1024” on the “Default emulator option” field, then click “Apply” and use your emulator as usual.
My app is using NDK (4r-crystax in my case) to proccess images from a camera. Problem is, it falls after few minutes of work. I guess there can be some memory leaks or something like that, but i dont know how to find out where the problem is. This is a log around this error:
04-14 23:07:37.133: INFO/NATIVE CODE(14895): Detection percentage counted.
04-14 23:07:37.163: DEBUG/MDDetectorView(14895): Some debug info
04-14 23:07:37.193: DEBUG/dalvikvm(14895): GC_EXTERNAL_ALLOC freed 19 objects / 872 bytes in 27ms
04-14 23:07:37.283: INFO/NATIVE CODE(14895): Image to proccess loaded.
04-14 23:07:37.493: INFO/ActivityManager(92): Process com.motiondetector (pid 14895) has died.
04-14 23:07:37.493: DEBUG/CameraService(67): Client::~Client E (pid 67, client 0xad08)
04-14 23:07:37.503: INFO/WindowManager(92): WIN DEATH: Window{46590698 com.motiondetector/com.motiondetector.MDMenuActivity paused=false}
04-14 23:07:37.513: ERROR/CameraService(67): getClientFromCookie: client appears to have died
Any ideas? Are there any usefull tools to help me find answer?
Is possible that Android kill on screen activity during proccessing a native code?
If you're using NDK r5 or greater, you can use the ndk-gdb script to run your program and connect to it via GDB. If your native code is crashing, it should drop you into the GDB command line, where you can examine the area of code that's causing the problem.
I am runing junit test for native library(C++), native library process crashed and logcat shows:
I/ActivityManager( 161): Force stopping package xxxxx uid=10043
I/ActivityManager( 161): Start proc xxxxx for added application xxxx: pid=1656 uid=10043 gids={1015}
I/TestRunner( 1656): started: testAddressBook(xxxxx.AddressBookTest)
F//system/bin/app_process( 1656): stack corruption detected: aborted
I/ActivityManager( 161): Process xxxxx (pid 1656) has died.
Where xxxxx is the process name.
I try to follow instruction on http://source.android.com/porting/debugging_native.html , but the instruction is confusing:
If it crashes, connect with aproto and run logcat on the device
What is aproto? I can't find it. Nor "stack" tool.
Any suggestion is appreciated!
-Henry
F//system/bin/app_process( 1656): stack corruption detected: aborted
That sounds like you're trashing a local variable. Here's a really popular way to do that:
char localVar[16];
sprintf(localVar, "And this is why sprintf is the devil");
That's not exactly what you asked for, but I hope it helps anyway.