应用程序在 Playstore 上传时停止工作

阿米特·库马尔·帕瓦尔

我刚刚在 Google Play 商店上传了我的应用程序,但它使用以下代码崩溃了

 Process: com.trifidresearch.trplsg, PID: 30335
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.trifidresearch.trplsg/com.trifidresearch.trplsg.intro.Country}: android.view.InflateException: Binary XML file line #36: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2423)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483)
    at android.app.ActivityThread.access$900(ActivityThread.java:153)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5438)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
 Caused by: android.view.InflateException: Binary XML file line #36: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar
    at android.view.LayoutInflater.inflate(LayoutInflater.java:543)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
    at android.support.v7.app.am.v(Unknown Source)
    at android.support.v7.app.am.b(Unknown Source)
    at android.support.v7.app.x.setContentView(Unknown Source)
    at com.trifidresearch.trplsg.intro.Country.onCreate(Unknown Source)
    at android.app.Activity.performCreate(Activity.java:6303)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) 
    at android.app.ActivityThread.access$900(ActivityThread.java:153) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5438) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 
 Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class android.support.v7.widget.Toolbar
    at android.view.LayoutInflater.createView(LayoutInflater.java:649)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:768)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:708)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:839)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:842)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:427) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
    at android.support.v7.app.am.v(Unknown Source) 
    at android.support.v7.app.am.b(Unknown Source) 
    at android.support.v7.app.x.setContentView(Unknown Source) 
    at com.trifidresearch.trplsg.intro.Country.onCreate(Unknown Source) 
    at android.app.Activity.performCreate(Activity.java:6303) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) 
    at android.app.ActivityThread.access$900(ActivityThread.java:153) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5438) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 
 Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at android.view.LayoutInflater.createView(LayoutInflater.java:623)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:768) 
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:708) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:839) 
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:842) 
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:519) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:427) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
    at android.support.v7.app.am.v(Unknown Source) 
    at android.support.v7.app.am.b(Unknown Source) 
    at android.support.v7.app.x.setContentView(Unknown Source) 
    at com.trifidresearch.trplsg.intro.Country.onCreate(Unknown Source) 
    at android.app.Activity.performCreate(Activity.java:6303) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) 
    at android.app.ActivityThread.access$900(ActivityThread.java:153) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5438) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 
 Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.aj.a()' on a null object reference
    at android.support.v7.widget.at.setBackgroundDrawable(Unknown Source)
    at android.view.View.setBackground(View.java:17244)
    at android.view.View.<init>(View.java:4337)
    at android.widget.ImageView.<init>(ImageView.java:145)
    at android.widget.ImageButton.<init>(ImageButton.java:84)
    at android.widget.ImageButton.<init>(ImageButton.java:80)
    at android.support.v7.widget.at.<init>(Unknown Source)
    at android.support.v7.widget.Toolbar.y(Unknown Source)
    at android.support.v7.widget.Toolbar.c(Unknown Source)
    at android.support.v7.widget.Toolbar.<init>(Unknown Source)
    at android.support.v7.widget.Toolbar.<init>(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Native Method) 
    at android.view.LayoutInflater.createView(LayoutInflater.java:623) 
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:768) 
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:708) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:839) 
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802) 
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:842) 
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:802) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:519) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:427) 
    at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
    at android.support.v7.app.am.v(Unknown Source) 
    at android.support.v7.app.am.b(Unknown Source) 
    at android.support.v7.app.x.setContentView(Unknown Source) 
    at com.trifidresearch.trplsg.intro.Country.onCreate(Unknown Source) 
    at android.app.Activity.performCreate(Activity.java:6303) 
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108) 
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2376) 
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2483) 
    at android.app.ActivityThread.access$900(ActivityThread.java:153) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1349) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:148) 
    at android.app.ActivityThread.main(ActivityThread.java:5438) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629) 
    09-13 11:50:51.764 1585-2906/? E/ActivityManager: Invalid thumbnail dimensions: 0x0

从安装时,它在模拟器和我的手机上运行良好,Android Studio但是一旦我将它上传到 Play 商店,它就无法启动。

我的代码是

package com.trifidresearch.trplsg.intro;
import android.os.Bundle;
import android.os.StrictMode;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.ListView;

import com.trifidresearch.trplsg.R;

import java.util.ArrayList;
import java.util.Locale;

public class Country extends AppCompatActivity {
    ListView list;
    ListViewAdapter adapter;
    EditText editsearch;
    String[] country;
    ArrayList<CountryNames> arraylist = new ArrayList<CountryNames>();
    @Override
    public void onCreate(Bundle savedInstanceState) {


        StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
                .detectDiskReads()
                .detectDiskWrites()
                .detectNetwork()   // or .detectAll() for all detectable problems
                .detectAll()
                .penaltyLog()
                .build());

        StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder()
                .detectLeakedSqlLiteObjects()
                .detectLeakedClosableObjects()
                .penaltyLog()
                .detectAll()
                .penaltyDeath()
                .build());
    super.onCreate(savedInstanceState);
    setContentView(R.layout.listview_main);
        getSupportActionBar().setBackgroundDrawable(ContextCompat.getDrawable(getApplicationContext(), R.drawable.gradi));
    country = new String[] {
            "AFGHANISTAN(93)",
            "ALBANIA(355)",
            "ALGERIA(213)",
            "AMERICAN SAMOA(1684)",
            "ANDORRA(376)",
            "ANGOLA(244)",
            "ZIMBABWE(263)"
    };
    list = findViewById(R.id.listview);
    for (int i = 0; i < country.length; i++)
    {
        CountryNames wp = new CountryNames(country[i]);
        arraylist.add(wp);
    }
    adapter = new ListViewAdapter(this, arraylist);
    list.setAdapter(adapter);
    editsearch = findViewById(R.id.search);
    editsearch.addTextChangedListener(new TextWatcher() {
        @Override
        public void afterTextChanged(Editable arg0) {
            String text = editsearch.getText().toString().toLowerCase(Locale.getDefault());
            adapter.filter(text);
        }
        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1,
                                      int arg2, int arg3) {
        }
        @Override
        public void onTextChanged(CharSequence arg0, int arg1, int arg2,
                                  int arg3) {
        }
    });
}

我的 gradle 文件 ID

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        vectorDrawables.useSupportLibrary = true
        applicationId 'com.trifidresearch.trplsg'
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 20201
        versionName '2.2.1'
        useLibrary 'org.apache.http.legacy'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86_64', 'x86', 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'mips'
            //select ABIs to build APKs for
            universalApk true //generate an additional APK that contains all the ABIs
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), "proguard-rules.pro"
            debuggable false
            jniDebuggable false
            renderscriptDebuggable false
            // signingConfig playStoreConfig //Add your own signing config
            pseudoLocalesEnabled false
            zipAlignEnabled true
        }
        debug {

        }
    }
    productFlavors {
    }
    lintOptions {
        checkReleaseBuilds false
    }
    aaptOptions {
        cruncherEnabled = true
    }
    buildToolsVersion '27.0.3'
}


ext.versionCodes = ['armeabi': 1, 'armeabi-v7a': 2, 'arm64-v8a': 3, 'mips': 4, 'x86': 5, 'x86_64': 6]

android.applicationVariants.all { variant ->

    variant.outputs.each { output ->
        output.versionCodeOverride = android.defaultConfig.versionCode * 10000 + project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0)
    }
}



dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    implementation 'com.android.volley:volley:1.0.0'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    implementation 'com.github.clans:fab:1.6.4'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.paypal.sdk:paypal-android-sdk:2.14.2'
    implementation 'org.jsoup:jsoup:1.10.3'
    implementation 'io.github.sac:SocketclusterClientJava:1.7.5'
    implementation 'com.github.bumptech.glide:glide:3.8.0'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

apply plugin: 'com.google.gms.google-services'
ʍѳђ ઽ 9 单位

如果您将 Proguard 设置minifyEnabledtrue,那么我认为这会导致崩溃。因此,尝试将这些添加到/app/proguard-rules.pro

-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
-keep class com.google.** { *; }
-keep interface com.google.** { *; }

这应该会有所帮助,因为您说您已经在使用最新的支持库。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在 Playstore 上传应用程序,但我的应用程序未在某些设备中显示?

来自分类Dev

如何在1个Playstore项目中上传2个不同的风味应用程序

来自分类Dev

为什么我的Android应用程序仅在使用引号“ titleOfApp”时显示在playstore中?

来自分类Dev

应用程序已停止工作

来自分类Dev

当我按下 ButtonImage 时应用程序崩溃。不幸的是,该应用程序已停止工作

来自分类Dev

返回字符串时调用Http.PostAsync时,应用程序停止工作

来自分类Dev

从菜单中选择帮助(警告对话框)选项时,应用程序停止工作

来自分类Dev

单击按钮编码以保存、刷新和搜索时,应用程序停止工作

来自分类Dev

在 Actions on Google 上启动登录流程时,Dialogflow 应用程序停止工作

来自分类Dev

单击按钮后,应用程序停止工作

来自分类Dev

Xamarin Android应用程序不幸地停止工作

来自分类Dev

单击TextView后,Android应用程序停止工作

来自分类Dev

不幸的是,应用程序已停止工作?

来自分类Dev

android-地图应用程序停止工作

来自分类Dev

Cordova Windows应用程序停止工作

来自分类Dev

.NET 4.0应用程序停止工作

来自分类Dev

单击按钮后应用程序停止工作

来自分类Dev

为什么我的应用程序停止工作?

来自分类Dev

我的应用程序在 pos 设备上停止工作

来自分类Dev

单击按钮后应用程序停止工作

来自分类Dev

从Playstore安装应用程序时未显示Google地图

来自分类Dev

在启动PlayStore之前如何确定应用程序名称

来自分类Dev

如何将AngularJS应用程序部署到PlayStore等

来自分类Dev

更新google playstore中启动的应用程序

来自分类Dev

测试我的应用程序是否将在Playstore上被暂停

来自分类Dev

在playstore上检索我的应用程序列表

来自分类Dev

单击按钮时,Android Studio 中的应用程序崩溃。显示应用名称已停止工作

来自分类Dev

APK错误:Android应用程序可以在模拟器/设备上完美运行,但是当我从PlayStore下载时,应用程序总是在启动时崩溃

来自分类Dev

当我按下在片段中激活异步任务的按钮时,应用程序停止工作

Related 相关文章

  1. 1

    在 Playstore 上传应用程序,但我的应用程序未在某些设备中显示?

  2. 2

    如何在1个Playstore项目中上传2个不同的风味应用程序

  3. 3

    为什么我的Android应用程序仅在使用引号“ titleOfApp”时显示在playstore中?

  4. 4

    应用程序已停止工作

  5. 5

    当我按下 ButtonImage 时应用程序崩溃。不幸的是,该应用程序已停止工作

  6. 6

    返回字符串时调用Http.PostAsync时,应用程序停止工作

  7. 7

    从菜单中选择帮助(警告对话框)选项时,应用程序停止工作

  8. 8

    单击按钮编码以保存、刷新和搜索时,应用程序停止工作

  9. 9

    在 Actions on Google 上启动登录流程时,Dialogflow 应用程序停止工作

  10. 10

    单击按钮后,应用程序停止工作

  11. 11

    Xamarin Android应用程序不幸地停止工作

  12. 12

    单击TextView后,Android应用程序停止工作

  13. 13

    不幸的是,应用程序已停止工作?

  14. 14

    android-地图应用程序停止工作

  15. 15

    Cordova Windows应用程序停止工作

  16. 16

    .NET 4.0应用程序停止工作

  17. 17

    单击按钮后应用程序停止工作

  18. 18

    为什么我的应用程序停止工作?

  19. 19

    我的应用程序在 pos 设备上停止工作

  20. 20

    单击按钮后应用程序停止工作

  21. 21

    从Playstore安装应用程序时未显示Google地图

  22. 22

    在启动PlayStore之前如何确定应用程序名称

  23. 23

    如何将AngularJS应用程序部署到PlayStore等

  24. 24

    更新google playstore中启动的应用程序

  25. 25

    测试我的应用程序是否将在Playstore上被暂停

  26. 26

    在playstore上检索我的应用程序列表

  27. 27

    单击按钮时,Android Studio 中的应用程序崩溃。显示应用名称已停止工作

  28. 28

    APK错误:Android应用程序可以在模拟器/设备上完美运行,但是当我从PlayStore下载时,应用程序总是在启动时崩溃

  29. 29

    当我按下在片段中激活异步任务的按钮时,应用程序停止工作

热门标签

归档