App was not installed error in Android sdk 19 - android

I am using a kitkat device to debug my app,when i run the app i am getting this error.
PackageManager: mismatched uid for com.ex.app_name, try to erase old data
PackageManager: Package com.compny.app_name has mismatched uid: 10258 on disk, 10259 in settings
E/PackageManager: Unable to copy native libraries
java.io.IOException: Cannot create /mismatched_uid/settings_10259/fs_10258
at com.android.server.pm.PackageManagerService.copyNativeLibrariesForInternalApp(PackageManagerService.java:5328)
at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:4810)
at com.android.server.pm.PackageManagerService.installNewPackageLI(PackageManagerService.java:9348)
at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:9794)
at com.android.server.pm.PackageManagerService.access$2300(PackageManagerService.java:182)
at com.android.server.pm.PackageManagerService$5.run(PackageManagerService.java:7512)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
I have searched for this ,but i could not find a solution .Can anyone help?

Related

How to debug an apk installed through google drive?

My Android App works fine in Emulator and on physical devices connected to the computer, but it (app) crashes when APK installed through Google Drive on the same device.
My app has two activities: Main and Game Play. On the main screen (activity) there is a Play button that starts the second activity (game play). I have a physical device (Galaxy Tab E) connected to my computer. When I test my app on the emulator and on the physical device, the app works fine without any problems. However, when I generate an APK for Google Play Store and uploading it on my Google Drive, and installing it on the same physical device, it crashes when I click/tap the Play button. Don't know how to debug it and I don't know what am I missing. Is there any difference between Android Studio package that tests on the emulator and the generated apk?
I don't know how to get any generated error to add here for troubleshooting, as the device is not connected to the computer.
I expect the APK to work exactly as on the emulator or USB-connected device. Any help is greatly appreciated.
Edit:
After connecting the cable, I got the following errors when pressing the Play button:
08-15 12:15:23.762 14689-14689/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: ca.simapp.kids, PID: 14689
java.lang.VerifyError: c/b/b/a/e/a/VJ
at c.b.b.a.e.a._J.f()
at c.b.b.a.e.a._m.a()
at c.b.b.a.e.a.oD.a(:16)
at c.b.b.a.e.a.CZ.a(:3)
at ca.simapp.kids.Game.onCreate(:5)
at android.app.Activity.performCreate(Activity.java:5447)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2393)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$800(ActivityThread.java:166)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5584)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
at dalvik.system.NativeStart.main(Native Method)
08-15 12:15:24.083 588-14754/? E/android.os.Debug: !#Dumpstate > sdumpstate -k -t -z -d -m 14689 -o /data/log/dumpstate_app_error
08-15 12:15:25.994 588-666/? E/ViewRootImpl: sendUserActionEvent() mView == null
08-15 12:15:26.105 588-721/? E/InputDispatcher: channel ~ Channel is unrecoverably broken and will be disposed!
08-15 12:15:31.720 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0
08-15 12:15:33.101 588-990/? E/WifiService: SEC_COMMAND_ID_SET_WIFI_SCAN_WITH_P2P : Start scan, start assoc
08-15 12:15:39.197 170-420/? E/audio_hw_primary: select_devices_signal starting... adev->out_devices 0x2 adev->in_devices 0x0
Line 5 in the error points to
import android.content.SharedPreferences;
Hi check this link it seems that some classes has changed between compile and runtime. Now i would suggest to debug by adding and removing libraries which you suspect and create APKs to see which one is causing the error. And keep internet connection proper so you don't get obfuscated log messages.
BTW you can still read obfuscated log using proguard file use that to find the name of the class causing error.

Need some help analyzing Android catlogs to solve constant crashes

I am an owner of a Lenovo K2; due to having a lot of reboots and application crashes, I flashed the official Lenovo Nougat ROM from their recovery tool, performed system factory reset, cleared cache of everything...
Doing so did not resolve the problem at all, so I replicated the crashes and reboots while logging via adb logcat (treshold level Warning).
Here is the complete log: https://www.dropbox.com/s/c9955zdinyemezx/log4.txt?dl=0
I am no expert so I'd appreciate if someone could help me analyse the log I'd be very thankful; here are the most recurring errors:
07-22 19:34:36.375 5135 5135 W PackageManager: Not granting permission android.permission.WRITE_EXTERNAL_STORAGE to package com.lenovo.leos.cloud.sync.row because it was previously installed without
07-22 19:34:36.375 5135 5135 W PackageManager: Unknown permission android.permission.ACCESS_SUPERUSER in package com.lenovo.leos.cloud.sync.row
07-22 19:34:39.504 5135 5135 E DeviceIdleController: Bad device idle settings
07-22 19:34:39.504 5135 5135 E DeviceIdleController: java.lang.IllegalArgumentException: 'null' in 'null' is not a valid key-value pair
And Fatal exceptions thrown when apps crash:
07-22 19:33:56.796 1422 1516 F art : art/runtime/gc/collector/mark_sweep.cc:413] Tried to mark 0x40 not contained by any spaces
07-22 19:34:28.815 4933 4933 F DEBUG : pid: 665, tid: 665, name: fingerprintd >>> /system/bin/fingerprintd <<<
There is a solution for this.
Go to the Settings Page.
Go to 'Apps' Settings.
Find the app package causing this problem and click into it.
Go to 'Permissions' settings and allow all the permissions shown there.
Hope the issue is now solved.

Error when trying to install Instant App

I've a multi feature app.
Installed App version works perfectly.
n
Instant App version was working till yesterday. Now I can build it correctly but I get this error when trying to install any of the instant modules.
Does anyone have the same issue ?
I cannot understand the error message:
Failed to finalize session : INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: Failed parse during installPackageLI: Failed to read manifest from /data/app/vmdl138992238.tmp/base.apk: For input string: "otb"
I do not have any otb string.
otb is a the name of a feature module, but not the one I'm tring to install
EDIT:
I tried to rename the module otb to ootb. I got the same error having it "For input string: "ootb""
also I retrieved the logcat stacktrace:
07-01 01:51:37.516 776-817/? W/PackageManager: Failed parse during installPackageLI
android.content.pm.PackageParser$PackageParserException: Failed to read manifest from /data/app/vmdl1025494079.tmp/base.apk
at android.content.pm.PackageParser.parseBaseApk(PackageParser.java:1252)
at android.content.pm.PackageParser.parseClusterPackage(PackageParser.java:1133)
at android.content.pm.PackageParser.parsePackage(PackageParser.java:952)
at android.content.pm.PackageParser.parsePackage(PackageParser.java:966)
at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:16828)
at com.android.server.pm.PackageManagerService.installPackageTracedLI(PackageManagerService.java:16767)
at com.android.server.pm.PackageManagerService.-wrap29(Unknown Source:0)
at com.android.server.pm.PackageManagerService$7.run(PackageManagerService.java:14255)
at android.os.Handler.handleCallback(Handler.java:769)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.os.HandlerThread.run(HandlerThread.java:65)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
Caused by: java.lang.NumberFormatException: For input string: "ootb"
at java.lang.Integer.parseInt(Integer.java:608)
at com.android.internal.util.XmlUtils.convertValueToInt(XmlUtils.java:133)
at android.content.res.TypedArray.getInt(TypedArray.java:373)
at android.content.pm.PackageParser.parseActivity(PackageParser.java:4184)
at android.content.pm.PackageParser.parseBaseApplication(PackageParser.java:3612)
at android.content.pm.PackageParser.parseBaseApkCommon(PackageParser.java:2103)
at android.content.pm.PackageParser.parseBaseApk(PackageParser.java:1984)
at android.content.pm.PackageParser.parseBaseApk(PackageParser.java:1236)
at android.content.pm.PackageParser.parseClusterPackage(PackageParser.java:1133) 
at android.content.pm.PackageParser.parsePackage(PackageParser.java:952) 
at android.content.pm.PackageParser.parsePackage(PackageParser.java:966) 
at com.android.server.pm.PackageManagerService.installPackageLI(PackageManagerService.java:16828) 
at com.android.server.pm.PackageManagerService.installPackageTracedLI(PackageManagerService.java:16767) 
at com.android.server.pm.PackageManagerService.-wrap29(Unknown Source:0) 
at com.android.server.pm.PackageManagerService$7.run(PackageManagerService.java:14255) 
at android.os.Handler.handleCallback(Handler.java:769) 
at android.os.Handler.dispatchMessage(Handler.java:98) 
at android.os.Looper.loop(Looper.java:164) 
at android.os.HandlerThread.run(HandlerThread.java:65) 
at com.android.server.ServiceThread.run(ServiceThread.java:46) 
Ok I maybe found the source of the problem for anyone having the same issue.
This may be related to android O SDK (API 26).
Compiling and targeting API 26 works correctly for classical app but is giving this error for instant apps at install time.
Rolling back to compile SDK 25 solved the problem in my case.
I'll wait for the final API/gradle plugin before tryng again.

Android app crash with ResourceNotFoundException

I recently checked for my GP crash logs and I am getting this callstack very frequently. Could you please help me.
A few things:
The failed to add asset path sometimes shows /data/app/com.xxx.xxx.xxx-x/base.apk and sometimes /mnt/asec/com.xxx.xxx.xxx-x/base.apk.
The device android versions (where it is reported) varies from Android 4.4. to Android 7.0
In the GP console, Android version shows Android 7.0 for all crashes but the device list has devices with Android version 6.0, 5.0, etc which is unclear.
I have two apps with shared user Id, say with package names P1, P2. For P1, the failed to add asset path sometimes shows /data/app/P2 and sometimes /mnt/asec/P1. Isn't this incorrect and what could cause this?
Call stacks:
java.lang.RuntimeException: Unable to create BackupAgent android.app.backup.FullBackupAgent: android.content.res.Resources$NotFoundException: failed to add asset path data/app/com.P2.xxx/base.apk
at android.app.ActivityThread.handleCreateBackupAgent(ActivityThread.java:3452)
at android.app.ActivityThread.-wrap5(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1796)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6688)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: android.content.res.Resources$NotFoundException: failed to add asset path /data/app/com.P2.xxx/base.apk
at android.app.ResourcesManager.createAssetManager(ResourcesManager.java:281)
at android.app.ResourcesManager.createResourcesImpl(ResourcesManager.java:359)
at android.app.ResourcesManager.getOrCreateResources(ResourcesManager.java:638)
at android.app.ResourcesManager.getResources(ResourcesManager.java:730)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:2068)
at android.app.LoadedApk.getResources(LoadedApk.java:780)
at android.app.ContextImpl.<init>(ContextImpl.java:2244)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2184)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2175)
at android.app.ActivityThread.handleCreateBackupAgent(ActivityThread.java:3422)
Another crash:
android.content.res.Resources$NotFoundException: failed to add asset path /mnt/asec/com.P1.xxx/base.apk
at android.app.ResourcesManager.createAssetManager(ResourcesManager.java:281)
at android.app.ResourcesManager.createResourcesImpl(ResourcesManager.java:359)
at android.app.ResourcesManager.getOrCreateResources(ResourcesManager.java:638)
at android.app.ResourcesManager.getResources(ResourcesManager.java:730)
at android.app.ActivityThread.getTopLevelResources(ActivityThread.java:2052)
at android.app.LoadedApk.getResources(LoadedApk.java:787)
at android.app.ContextImpl.<init>(ContextImpl.java:2266)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2210)
at android.app.ContextImpl.createAppContext(ContextImpl.java:2196)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5861)
at android.app.ActivityThread.-wrap3(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1710)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
Please check if the App has external drive permissions.
In my case this issue triggered when ADB installed the App to the device which is screen locked, the same test has passed when the device is awake, so even though permissions available to this App
I have this error for com.android.billingclient:billing. Problem is "there is no account in the device", for example a new device or reset to vendor settings.
So just add an account in global settings.

Open Database for ReadWirte not possible on specific device

I simply try to open a database in READWRITE Mode. I get the following error: "not an error (code 0): Could not open the database in read/write mode." When opening the DB the same way but READONLY is works. On my 3 devices this is not a problem opening in READWRITE, but 2 users reported that following error.
the db exists on the users filesystem . I check this with file.exists() -> ok.
the db-file is readwrite able on the users device. I check this with file.canWrite() -> ok.
the dbfile is stored under :
StoragePath : /mnt/extSdCard/mypath/mydb.db
New Info on 09.03.2014 : It seems to be only a problem in KitKat 4.4.2. Since Users have updated to 4.4.2 they get this problem.
My Code:
public void onCreate(Bundle savedInstanceState) {
connectWriter(); // throws exception below.
public void connectWriter() {
chronica_connection_readwrite = SQLiteDatabase.openDatabase("MyPath", null, SQLiteDatabase.OPEN_READWRITE);
//chronica_connection_read.enableWriteAheadLogging();
}
Exception Report:
java.lang.RuntimeException: Unable to start activity ComponentInfo{...}: android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2282)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2340)
at android.app.ActivityThread.access$800(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5293)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode.
at android.database.sqlite.SQLiteConnection.nativeOpen(Native Method)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:342)
at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:232)
at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:515)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:207)
at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:178)
at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:891)
at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:859)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:696)
at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:671)
at myclass.connectWriter(ChronicBrowser.java:14286)
at myclass.LoadModule(ChronicBrowser.java:10792)
at myclass.onCreate(ChronicBrowser.java:761)
at android.app.Activity.performCreate(Activity.java:5389)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2246)
************ DEVICE INFORMATION ***********
Brand: samsung
Device: hlte
Model: SM-N9005
Id: KOT49H
Product: hltexx
************ FIRMWARE ************
SDK: 19
Release: 4.4.2
Incremental: N9005XXUENB7
Looks like that this is not bug, but "feature".
Google's KitKat Blocks Some Access to Micro SD Cards
It's really sad, but looks like true
I'll preface this by saying you should really be storing SQLite databases on internal storage, where you have the benefit of ext4 journaling to help with data recovery. There is also much better security on internal storage, since you don't have to worry about malicious apps adding triggers, etc that end up running in your process.
That all being said, starting in KitKat you can write to secondary storage devices through the new public APIs Context.getExternalFilesDirs() or Context.getExternalCacheDirs(). These methods are also available on ContextCompat in the support-v4 library.
Also note that if you're only interested in using the directories returned by Context, you no longer need the READ_ or WRITE_EXTERNAL_STORAGE permissions. Going forward, you'll always have read/write access to these directories with no additional permissions required.
Apps can also continue working on older devices by end-of-lifing their permission request like this:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="18" />

Categories

Resources