简体   繁体   中英

Signed APK, “App not installed” in some devices, and in some devices same apk is working fine

I am new to android development. I am working on a project which has diffrent activities out of which two use jSon parsing.

My problem is, even while testing, my ap is working fine on some devices and failing on some. I have looked numerous answes on this issue, but nothing solves my problems. Also I had some other problems but I solved them by looking on the available answers, but this "not installed" issue remains the same. I have done the following:

  • Created signed apk
  • Signed apk with "Release" option
  • Both the options ticked "JAR Signature" and "Full apk Signature"
  • Mentioned proper minimum and target sdk versions in gradle files
  • Using latest vesions of libraries like volley, picasso
  • Tried re-installing it after uninstalling it from Settings>Apps>My app..

My concern is whatever the problems might there be inside the activities, at last the app should get installed and start the first activity(which is the splash screen, achieved by threading), but: The app is working perfectly fine on my device(Redmi 4) in both ways ie via USB and with the signed apk. The app is working fine in some of my friends' devices which are from manufacturers like Honor, Lenovo, MI. But the same apk is failing to install on another device Redmi 4 another version, which is the weirdest issue for me. And in some devices is getting installed but crashes the moment I open it, whether I do it via USB or with the signed APK.

But as the app is running fine on some devices, I think the problem isn't in the internal activities.

Some of the answers that I have read and tried are:

Cannot install signed apk to device manually, got error “App not installed”

Getting “App Not Installed” on some devices from signed apk

And every internal link provied in the answers.

Note: Some of the activity are entirely for testing purposes.

Here's my Manifest file:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.diginfoexpert.MBAutodeals">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
        android:name=".Globals"
        android:allowBackup="true"
        android:icon="@mipmap/audi"
        android:roundIcon="@mipmap/audi_round"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.Light.NoActionBar"
        android:testOnly="false"
        android:largeHeap="true">
        <activity android:name=".Web_json_product_Activity"></activity>
        <activity android:name=".Web_jsonActivity">

        </activity>
        <activity android:name=".jSonParseActivity"></activity>
        <activity android:name=".SignUpActivity"
            android:noHistory="true"/>
        <activity android:name=".LoginActivity"
            android:noHistory="true"/>
        <activity android:name=".ProductActivity" />
        <activity android:name=".IntroActivity" />
        <activity
            android:name=".SplashScreenActivity"
            android:noHistory="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <activity android:name=".MainActivity" />
    </application>

</manifest>

Here's my build.gradle file (app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.0"
    defaultConfig {
        applicationId "com.diginfoexpert.MBAutodeals"
        minSdkVersion 18
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.preference:preference:1.1.0-alpha05'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'gr.pantrif:easy-android-splash-screen:0.0.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-appindexing:19.0.0'
    implementation 'com.google.firebase:firebase-auth:18.0.0'
    implementation 'com.google.firebase:firebase-database:18.0.0'
    implementation 'com.google.firebase:firebase-storage:18.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

apply plugin: 'com.google.gms.google-services'

Here's the logcat for when the app gets installed but crashes when I try to open it:

07-10 12:31:25.402 2278-4229/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f5d1f6b60
07-10 12:31:25.408 4049-4177/? E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f47e481c0
07-10 12:31:25.508 22804-22804/? E/Minikin: addFont failed to create font /system/fonts/NanumGothic.ttf
07-10 12:31:25.508 22804-22804/? E/Minikin: addFont failed to create font /system/fonts/DroidSansFallback.ttf
07-10 12:31:25.508 22804-22804/? E/Minikin: addFont failed to create font /system/fonts/MTLmr3m.ttf
07-10 12:31:25.603 22804-22804/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.diginfoexpert.MBAutodeals, PID: 22804
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.diginfoexpert.MBAutodeals/com.diginfoexpert.MBAutodeals.SplashScreenActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2560)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626)
        at android.app.ActivityThread.-wrap11(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
        at android.os.Handler.dispatchMessage(Handler.java:111)
        at android.os.Looper.loop(Looper.java:207)
        at android.app.ActivityThread.main(ActivityThread.java:5740)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766)
     Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
        at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:532)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
        at com.diginfoexpert.MBAutodeals.SplashScreenActivity.onCreate(SplashScreenActivity.java:14)
        at android.app.Activity.performCreate(Activity.java:6543)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5740) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
     Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout
        at android.view.LayoutInflater.createView(LayoutInflater.java:645)
        at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:532) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
        at com.diginfoexpert.MBAutodeals.SplashScreenActivity.onCreate(SplashScreenActivity.java:14) 
        at android.app.Activity.performCreate(Activity.java:6543) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5740) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance(Native Method)
        at android.view.LayoutInflater.createView(LayoutInflater.java:619)
        at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) 
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:532) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
        at com.diginfoexpert.MBAutodeals.SplashScreenActivity.onCreate(SplashScreenActivity.java:14) 
        at android.app.Activity.performCreate(Activity.java:6543) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5740) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
     Caused by: android.content.res.Resources$NotFoundException: Resource "com.diginfoexpert.MBAutodeals:drawable/car_background" (7f070069) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f070069 a=-1 r=0x7f070069}
        at android.content.res.Resources.loadDrawableForCookie(Resources.java:2842)
        at android.content.res.Resources.loadDrawable(Resources.java:2764)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:870)
        at android.view.View.<init>(View.java:4001)
        at android.view.ViewGroup.<init>(ViewGroup.java:599)
        at android.widget.RelativeLayout.<init>(RelativeLayout.java:268)
        at android.widget.RelativeLayout.<init>(RelativeLayout.java:264)
        at android.widget.RelativeLayout.<init>(RelativeLayout.java:260)
        at java.lang.reflect.Constructor.newInstance(Native Method) 
        at android.view.LayoutInflater.createView(LayoutInflater.java:619) 
        at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58) 
        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:694) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:762) 
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:532) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161) 
        at com.diginfoexpert.MBAutodeals.SplashScreenActivity.onCreate(SplashScreenActivity.java:14) 
        at android.app.Activity.performCreate(Activity.java:6543) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1113) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2513) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2626) 
        at android.app.ActivityThread.-wrap11(ActivityThread.java) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475) 
        at android.os.Handler.dispatchMessage(Handler.java:111) 
        at android.os.Looper.loop(Looper.java:207) 
        at android.app.ActivityThread.main(ActivityThread.java:5740) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:766) 
07-10 12:31:26.339 1012-1724/? E/Sensors: handleToDriver handle(0)
07-10 12:31:26.339 1012-1724/? E/Sensors: handleToDriver handle(0)
07-10 12:31:26.340 1012-1724/? E/Sensors: new setDelay handle(0),ns(20000000)m, error(0), index(2)
07-10 12:31:26.341 1012-1724/? E/Accel: ACC batch: handle:0, en:0,samplingPeriodNs:20000000 maxBatchReportLatencyNs:0 
07-10 12:31:26.341 1012-1724/? E/Sensors: sensor 0 go to common batch
07-10 12:31:26.341 1012-1724/? E/Sensors: handleToDriver handle(0)
07-10 12:31:26.362 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.382 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.402 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.422 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.442 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.462 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.482 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.502 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.522 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.542 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.562 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.582 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.602 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.622 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.642 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.663 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.682 1012-1263/? E/Sensors: readEvents: no events readed, continue to try next fd
07-10 12:31:26.847 285-569/? E/MAL-Daemon:  (  rds_ru_3gpp_status_ind, 1421) [RDS-E][RU][EVENT_RU_DM_3GPP_STATUS_IND] Invalid u43gpp_status:0x6

Here's build.gradle file (project level):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.1'
        classpath 'com.google.gms:google-services:4.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.widget.RelativeLayout

This line is telling you that your xml is malformed. Try to check the settings for android.widget.RelativeLayout

Steps to Check for -Check if the app is already installed on that phone on which you not getting app not installed issue -As you are sharing apk file kindly make sure security settings of that phone Redmi4 from play store is off.

than you wont be getting that issue

I also faced similar issues on Redmi Devices, the work around for me is to Copy Signed apk in Downloads using Device file explorer option in Android Studio and then installing the apk.

Installing using ADB doesn't work for Redmi Devices

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM