Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install signed app - NullPointerException on installing

I can't install my own app, i follow every documentation from android developement, i created 5 sign keys, but i still get this error:

I/PackageManager: error while grant permission
05-30 19:06:12.446 1301-1434/? W/System.err: java.lang.NullPointerException: Attempt to read from field 'android.content.pm.ApplicationInfo android.content.pm.PackageParser$Package.applicationInfo' on a null object reference
        at com.android.server.pm.PackageManagerService$PackageHandler.doHandleMessage(PackageManagerService.java:1830)
        at com.android.server.pm.PackageManagerService$PackageHandler.handleMessage(PackageManagerService.java:1568)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        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)
05-30 19:06:12.453 1301-3673/? I/ActivityManager: START u0 {dat=file:///data/user_de/0/com.google.android.packageinstaller/no_backup/package3183593356569820254.apk flg=0x2000000 cmp=com.google.android.packageinstaller/com.android.packageinstaller.InstallFailed (has extras)} from uid 10022 pid 2400
05-30 19:06:12.461 1301-1361/? D/RestartProcessManager: Update Total Launch Times :com.google.android.packageinstaller
05-30 19:06:12.462 1301-1361/? D/RestartProcessManager: sLastRunningPackage (null) : com.google.android.packageinstaller
05-30 19:06:12.471 2400-2400/? D/InstallFailed: Installation status code: 1
05-30 19:06:12.506 1301-1402/? I/ActivityManager: Displayed com.google.android.packageinstaller/com.android.packageinstaller.InstallFailed: +43ms
05-30 19:06:12.506 1301-1402/? E/ANDR-PERF-JNI: com_qualcomm_qtiperformance_native_perf_io_prefetch_start
05-30 19:06:12.506 1301-1402/? E/ANDR-IOP: IOP HAL: Received pkg_name = com.google.android.packageinstaller pid = 2400
05-30 19:06:12.506 822-861/? E/ANDR-PERF-OPTSHANDLER: perf_lock_rel: updated /sys/class/scsi_host/host0/../../../clkscale_enable with 1
     return value 2

But, using the android studio debugging install the application works perfectly.

Here is a part of my ApplicationInfo (from manifest tags) :

android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".meniu">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />

        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

and here is a part of my build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'android-P'
    defaultConfig {
        applicationId "g3org3.limatexmm"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
like image 708
George O Avatar asked Feb 03 '26 06:02

George O


1 Answers

I had the same issue.

I tried adb uninstall <packageName> as well as manually uninstalling the application (using uninstall for all users options as well).

It was finally solved when I bumped the version of the new app.

Change the versionCode and versionName in your android/app/build file by simply increment it. It should do the trick.

Upgraded android/app/build is now:

versionCode 2
versionName "2.0"

Assuming this error is during testing of the released apk, for full production I would suggest using google's signing option.

Let me know if it helps.

like image 99
ironhide96 Avatar answered Feb 05 '26 19:02

ironhide96