已签名的APK,“未安装应用"在某些设备中,并且在某些设备中,相同的apk正常工作 [英] Signed APK, "App not installed" in some devices, and in some devices same apk is working fine

查看:74
本文介绍了已签名的APK,“未安装应用"在某些设备中,并且在某些设备中,相同的apk正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是android开发的新手. 我正在一个项目中进行不同的活动,其中两个使用jSon解析.

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

我的问题是,即使在测试时,我的ap在某些设备上也可以正常工作,而在某些设备上却无法正常工作.在这个问题上,我看上去无数烦恼,但没有任何解决方法可以解决我的问题.另外,我还有其他一些问题,但是我通过查看可用的答案解决了这些问题,但是这个未安装"的问题仍然存在.我已完成以下操作:

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:

  • 创建签名的APK
  • 使用发布"选项签名的APK
  • 两个选项均勾选了"JAR签名"和完整apk签名"
  • 在gradle文件中提及正确的最低和目标sdk版本
  • 使用诸如排球,毕加索之类的图书馆的最新版本
  • 从设置">应用">我的应用"中卸载后,尝试重新安装.

我担心的是活动内部可能存在什么问题,最后应安装该应用程序并启动第一个活动(即通过线程实现的启动屏幕),但是: 该应用程序在两种方式下都可以在我的设备(Redmi 4)上正常运行,即通过USB和带有签名的apk. 该应用程序在我的一些朋友的设备中运行良好,这些设备来自Honor,Lenovo,MI等制造商. 但是相同的apk无法在其他设备 Redmi 4 的另一个版本上安装,这对我来说是最奇怪的问题. 在某些设备中,无论是通过USB还是使用签名的APK进行安装,都会在我打开它时立即崩溃.

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 i.e. 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:

无法将签名的APK安装到手动设备,出现错误未安装应用程序"

在某些设备上获取未安装应用程序"来自已签名的APK

答案中提供了每个内部链接.

And every internal link provied in the answers.

注意:有些活动完全是出于测试目的.

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

这是我的清单文件:

<?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>

这是我的build.gradle文件(应用程序)

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

这是build.gradle文件(项目级别):

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

此行告诉您您的xml格式错误.尝试检查android.widget.RelativeLayout

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

这篇关于已签名的APK,“未安装应用"在某些设备中,并且在某些设备中,相同的apk正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆