I am working on Xamarin Android Application.When I run my application I am getting this error :
error: Unexpected install output: pkg: /data/local/tmp/com.iKart.androidapplication-Signed.apk
Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]
My Package Name is : com.iKart.androidapplication
I have already uninstall my application from device using adb uninstall,still I am getting this error.
What is the solution ? Please Help!
This is my Menifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.iKart.androidapplication">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="21" />
<application android:theme="#style/Theme.AppCompat.Light" android:label="Mono.Droid">
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="#string/facebook_app_id" />
<activity android:name="com.facebook.FacebookActivity" android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:theme="#android:style/Theme.Translucent.NoTitleBar" android:label="#string/app_name" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
In Android Device Logging(Visual Studio) I am getting :
09-16 11:16:20.736 D/AndroidRuntime(23211):
09-16 11:16:20.736 D/AndroidRuntime(23211): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
09-16 11:16:20.736 D/AndroidRuntime(23211): CheckJNI is OFF
09-16 11:16:20.746 D/dalvikvm(23211): Trying to load lib libjavacore.so 0x0
09-16 11:16:20.746 D/dalvikvm(23211): Added shared lib libjavacore.so 0x0
09-16 11:16:20.756 D/dalvikvm(23211): Trying to load lib libnativehelper.so 0x0
09-16 11:16:20.756 D/dalvikvm(23211): Added shared lib libnativehelper.so 0x0
09-16 11:16:20.957 D/AndroidRuntime(23211): Calling main entry com.android.commands.pm.Pm
09-16 11:16:20.967 D/PackageItemInfo(23211): PackageItemInfo static run
09-16 11:16:20.967 D/AndroidRuntime(23211): Shutting down VM
09-16 11:16:21.157 D/dalvikvm(23211): GC_FOR_ALLOC freed 3206K, 51% free 3107K/6332K, paused 5ms, total 7ms
09-16 11:16:21.167 I/dalvikvm-heap(23211): Grow heap (frag case) to 7.284MB for 2359312-byte allocation
09-16 11:16:21.177 D/dalvikvm(23211): GC_CONCURRENT freed 9K, 38% free 5402K/8640K, paused 2ms+4ms, total 10ms
09-16 11:16:21.247 D/dalvikvm(23211): GC_FOR_ALLOC freed 466K, 35% free 5674K/8640K, paused 5ms, total 5ms
09-16 11:16:21.247 I/dalvikvm-heap(23211): Grow heap (frag case) to 7.779MB for 250016-byte allocation
09-16 11:16:21.257 D/dalvikvm(23211): GC_FOR_ALLOC freed 34K, 34% free 5917K/8888K, paused 5ms, total 5ms
09-16 11:16:21.257 I/dalvikvm-heap(23211): Grow heap (frag case) to 7.823MB for 46672-byte allocation
09-16 11:16:21.297 D/PackageItemInfo(23211): MessageLoop costTime=336
09-16 11:16:21.307 D/dalvikvm(23211): GC_CONCURRENT freed 1102K, 27% free 6590K/8936K, paused 1ms+1ms, total 6ms
09-16 11:16:21.307 D/dalvikvm(23211): Compiler shutdown in progress - discarding request
09-16 11:16:21.307 D/dalvikvm(23211): Compiler shutdown in progress - discarding request
09-16 11:16:21.307 D/dalvikvm(23211): Compiler shutdown in progress - discarding request
09-16 11:16:21.307 D/dalvikvm(23211): Compiler shutdown in progress - discarding request
09-16 11:16:21.307 D/dalvikvm(23211): Compiler shutdown in progress - discarding request
I have solved this Myself :
uninstall app from device and then run again.If it still not work then open Android SDK Command Prompt
(open Xamrin-studio > Tools > open a Android SDK Command Prompt)
then write following :
D:\Android\android-sdk> adb uninstall (Applicationpackagename)
you can get application package name from Androidmenifest file which is in properties folder.
This will definitely solve the error.
Thank you
You should rename you package name
from
com.iKart.androidapplication
to
com.ikart.androidapplication
notice capital K is changd to small k
Go to settings and app and make sure any app with same package name is not installed try to reinstall again using adb install -r ikart.apk
There are possible solution based on different scenario
Case 1: Uninstalling an app does sometimes leave the data folder behind we need to manually uninstall the app folder from "Application Manager"
Case 2: In case app uninstalled and don't see the app folder [with the app package name] then we need to use adb commands to uninstall these folders. Use [adb shell pm list packages] command which will show a list of all packages available in the device. If you see your app package in the list then run another adb command to remove [adb shell pm uninstall package name]
Case 3: If none of these works then we need to check the options provided by the Xamarin studio. Enable Shared mono runtime under project options.
Hopefully one of these should resolve your issue.
I think you have a problem with facebook activity. this is how you correctly write it:
<activity android:name="com.facebook.FacebookActivity"
android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:theme="#android:style/Theme.Translucent.NoTitleBar"
android:label="#string/app_name" />
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<provider android:authorities="com.facebook.app.FacebookContentProvider[your app_id (without brackets)]"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
In the AndroidManifest.xml settings change the "Install Location" from Default to auto
In my case uninstalling all the previous apps that I had installed using Xamarin on the device solved the problem.
Related
I am using adb shell logcat -v time filename command programmatically to store logs into a file on an android device.
There are some internal logs for memory releasing activities which are stored under " dalvikvm " tag. (See the logs below). I don't have any problem with these logs but due to these logs, the log file gets heavier.
So my concern is reduce logs which have GC_CONCURRENT freed or WAIT_FOR_CONCURRENT_GC text in it.
I also tried to reduce logs by using it's tag, but it removes all logs related to that tag. I don't want to loose required tags under same tag name. I just don't want the logs which have GC_CONCURRENT freed or WAIT_FOR_CONCURRENT_GC text in it.
Is there any way or any adb command to resolve this problem. Thanks in advance.
04-18 01:02:53.644: D/dalvikvm(4302): GC_CONCURRENT freed 511K, 21% free 4106K/5192K, paused 5ms+1ms, total 19ms
04-18 01:02:53.644: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.684: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 1ms+1ms, total 15ms
04-18 01:02:53.684: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.724: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 2ms+1ms, total 16ms
04-18 01:02:53.724: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 6ms
04-18 01:02:53.764: D/dalvikvm(4302): GC_CONCURRENT freed 512K, 21% free 4106K/5192K, paused 1ms+1ms, total 16ms
04-18 01:02:53.764: D/dalvikvm(4302): WAIT_FOR_CONCURRENT_GC blocked 7ms
EDIT
I am using
adb shell logcat -v time | grep -v \"GC_CONCURRENT\\|WAIT_FOR_CONCURRENT_GC\" > " + filename command.
It was working when I gave filename as my computer's local path.
But when I tried same with android device /data/data/packagename/filename.txt, it was not working.
It says that bash: /data/data/packagename/filename.txt : No such file or directory Can anybody suggest solution for that.
Don't forget that you can use host side utilities with the output from logcat. I would recommend using grep. In particular, with it's -v/--invert-match option.
adb logcat | grep -v "GC_CONCURRENT\|WAIT_FOR_CONCURRENT_GC" > filename
The command to print specific logs using tag names. *:S which dont read logs related to GC_CONCURRENT freed and WAIT_FOR_CONCURRENT_GC
Syntax
adb logcat TAG_NAME:PRIORITY
Below line displays only logs with ActivityManager, MY_CUSTOM_TAG.. tags
adb logcat ActivityManager:I MY_CUSTOM_TAG:D ANOTHER_CUST_TAG:D *:S
S — Silent (highest priority, on which nothing is ever printed)
For more information visit Official Docs
Android Debug Bridge
Reading and Writing Logs
UPDATED Missed dumping to file.
Dump to file
`adb logcat -d ActivityManager:I MY_CUSTOM_TAG:D ANOTHER_CUST_TAG:D *:S > filename.txt`
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.
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.
I'm trying to install my apk (which uses google maps) in android device. Its not getting installed. when i collect the log from the device it shows "unavailable shared library com.google.android.maps; failing!"
how to solve the above problem.?
I have given following line inside application tag.
<uses-library
android:name="com.google.android.maps"
android:required="true" >
</uses-library>
Following is my logs
02-03 20:19:42.025 D/PackageManager( 2888): Scanning package com.test.sd.view
02-03 20:19:42.025 E/PackageManager( 2888): Package com.test.sd.view requires unavailable shared library com.google.android.maps; failing!
02-03 20:19:42.025 W/PackageManager( 2888): Package couldn't be installed in /data/app/com.test.sd.view.apk
02-03 20:19:42.085 D/dalvikvm( 2888): GC_EXPLICIT freed 823K, 60% free 15109K/36871K, paused 2ms+5ms
02-03 20:19:42.085 D/InstallAppProgress( 4485): Installation error code: -9
Guess it is an issue with the device. Refer http://innovator.samsungmobile.com/bbs/discussion/view.do?platformId=0&parentCategoryId=0&messageId=101074&boardId=10. Try loading maps library externally.
In case with real device try remove from manifest file:
<uses-library android:name="com.google.android.maps" />