简体   繁体   English

没有更多信息,我的Google Play开发者控制台中的Android Resource.getValue崩溃

[英]Android Resource.getValue crash in my Google Play Dev console without more info

So I have an Android app uploaded on Google Play, and since I updated it few days ago, I got 36 crashes but I cannot find the source of it. 因此,我在Google Play上上传了一个Android应用,自几天前更新以来,我发生了36次崩溃,但找不到它的来源。 When I test the app, it doesn't crash. 当我测试应用程序时,它不会崩溃。 This is the stack trace of the error that I get when I go in my developer console: 这是我进入开发人员控制台时收到的错误的堆栈跟踪:

   android.content.res.Resources$NotFoundException:
at android.content.res.Resources.getValue (Resources.java:2598)
  at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates (AppCompatDrawableManager.java:331)
  at android.support.v7.widget.AppCompatDrawableManager.getDrawable (AppCompatDrawableManager.java:198)
  at android.support.v7.widget.AppCompatDrawableManager.getDrawable (AppCompatDrawableManager.java:191)
  at android.support.v7.content.res.AppCompatResources.getDrawable (AppCompatResources.java:102)
  at android.support.v7.view.menu.MenuItemImpl.getIcon (MenuItemImpl.java:505)
  at android.support.v7.view.menu.ActionMenuItemView.initialize (ActionMenuItemView.java:126)
  at android.support.v7.widget.ActionMenuPresenter.bindItemView (ActionMenuPresenter.java:211)
  at android.support.v7.view.menu.BaseMenuPresenter.getItemView (BaseMenuPresenter.java:188)
  at android.support.v7.widget.ActionMenuPresenter.getItemView (ActionMenuPresenter.java:197)
  at android.support.v7.widget.ActionMenuPresenter.flagActionItems (ActionMenuPresenter.java:477)
  at android.support.v7.view.menu.MenuBuilder.flagActionItems (MenuBuilder.java:1182)
  at android.support.v7.view.menu.BaseMenuPresenter.updateMenuView (BaseMenuPresenter.java:96)
  at android.support.v7.widget.ActionMenuPresenter.updateMenuView (ActionMenuPresenter.java:230)
  at android.support.v7.view.menu.MenuBuilder.dispatchPresenterUpdate (MenuBuilder.java:298)
  at android.support.v7.view.menu.MenuBuilder.onItemsChanged (MenuBuilder.java:1069)
  at android.support.v7.view.menu.MenuBuilder.startDispatchingItemsChanged (MenuBuilder.java:1096)
  at android.support.v7.app.AppCompatDelegateImpl.preparePanel (AppCompatDelegateImpl.java:1631)
  at android.support.v7.app.AppCompatDelegateImpl.doInvalidatePanelMenu (AppCompatDelegateImpl.java:1869)
  at android.support.v7.app.AppCompatDelegateImpl$2.run (AppCompatDelegateImpl.java:230)
  at android.os.Handler.handleCallback (Handler.java:739)
  at android.os.Handler.dispatchMessage (Handler.java:95)
  at android.os.Looper.loop (Looper.java:148)
  at android.app.ActivityThread.main (ActivityThread.java:7325)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

In the last update, I added a new activity that opens a screen with more information about the app, so InfoActivity: 在上一次更新中,我添加了一个新活动,该活动打开了一个包含有关该应用程序的更多信息的屏幕,因此InfoActivity:

private TextView rateApp;
    private TextView contactUs;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_info);

        rateApp = findViewById(R.id.rateAppTv);
        contactUs = findViewById(R.id.sendEmailTv);
        rateApp.setMovementMethod(LinkMovementMethod.getInstance());
        rateApp.setPaintFlags(rateApp.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
        contactUs.setPaintFlags(contactUs.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

        contactUs.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
                emailIntent.setData(Uri.parse("mailto:natasa.andzic1@gmail.com"));
                emailIntent.putExtra(Intent.EXTRA_SUBJECT, "Rick and Morty soundboard app feedback");
                if (emailIntent.resolveActivity(getPackageManager()) != null)
                    startActivity(emailIntent);
            }
        });

        rateApp.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                openAppRating(InfoActivity.this);       }
        });
    }

    public static void openAppRating(Context context) {
        // you can also use BuildConfig.APPLICATION_ID
        String appId = context.getPackageName();
        Intent rateIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appId));
        boolean marketFound = false;

        // find all applications able to handle our rateIntent
        final List<ResolveInfo> otherApps = context.getPackageManager()
                .queryIntentActivities(rateIntent, 0);
        for (ResolveInfo otherApp: otherApps) {
            // look for Google Play application
            if (otherApp.activityInfo.applicationInfo.packageName.equals("com.android.vending")) {

                ActivityInfo otherAppActivity = otherApp.activityInfo;
                ComponentName componentName = new ComponentName(otherAppActivity.applicationInfo.packageName, otherAppActivity.name
                );
                // make sure it does NOT open in the stack of your activity
                rateIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                // task reparenting if needed
                rateIntent.addFlags(Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
                // if the Google Play was already open in a search result
                //  this make sure it still go to the app page you requested
                rateIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                // this make sure only the Google Play app is allowed to
                // intercept the intent
                rateIntent.setComponent(componentName);
                context.startActivity(rateIntent);
                marketFound = true;
                break;

            }
        }

        // if GP not present on device, open web browser
        if (!marketFound) {
            Intent webIntent = new Intent(Intent.ACTION_VIEW,
                    Uri.parse("https://play.google.com/store/apps/details?id="+appId));
            context.startActivity(webIntent);
        }
    }
}

And activity_info.xml: 和activity_info.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="@color/colorAccent"
    tools:context=".InfoActivity">

    <View
        style="@style/info_separator_style"
        android:background="@color/colorPrimaryLight" />

    <TextView
        android:id="@+id/rateTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:textStyle="bold"
        android:layout_marginTop="20dp"
        android:text="Rate this app"
        android:textColor="#000000"
        android:textSize="36sp" />


    <TextView
        android:autoLink="web"
        android:textStyle="italic"
        android:id="@+id/rateAppTv"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:text="Click here"
        android:textColor="#000000"
        android:textSize="24sp" />
    <View
        android:layout_marginTop="20dp"
        style="@style/info_separator_style"
        android:background="@color/colorPrimaryLight" />

    <TextView
        android:layout_marginTop="20dp"
        android:layout_gravity="center"
        android:text="Contact us!"
        android:textStyle="bold"
        android:textSize="36sp"
        android:layout_width="wrap_content"
        android:textColor="#000000"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_gravity="center"
        android:textSize="24sp"
        android:textColor="#000000"
        android:textStyle="italic"
        android:id="@+id/sendEmailTv"
        android:text="Click here to send us an email!"
        style="@style/RtlUnderlay.Widget.AppCompat.ActionButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <View
        android:layout_marginTop="20dp"
        style="@style/info_separator_style"
        android:background="@color/colorPrimaryLight" />

    <TextView
        android:layout_marginTop="20dp"
        android:layout_gravity="center"
        android:text="About"
        android:textStyle="bold"
        android:textSize="36sp"
        android:layout_width="wrap_content"
        android:textColor="#000000"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_gravity="center"
        android:textSize="24sp"
        android:textColor="#000000"
        android:textStyle="italic"
        android:id="@+id/jaTv"
        android:text="Made by Nataša Andžić"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

    <View
        android:layout_marginTop="20dp"
        style="@style/info_separator_style"
        android:background="@color/colorPrimaryLight" />

    <TextView
        android:layout_marginTop="20dp"
        android:layout_gravity="center"
        android:text="Thanks"
        android:textStyle="bold"
        android:textSize="36sp"
        android:layout_width="wrap_content"
        android:textColor="#000000"
        android:layout_height="wrap_content" />

    <TextView
        android:layout_gravity="center"
        android:textSize="24sp"
        android:textColor="#000000"
        android:textStyle="italic"
        android:id="@+id/thanksTv"
        android:text="Icons - Material Design"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

problem is related drawable file. 问题是相关的可绘制文件。 if you placed any of your drawable files in drawable-v24 then it will give an error in below API versions. 如果您将任何可绘制文件放置在drawable-v24中,则它将在以下API版本中给出错误。

see this answer maybe it will help you 看到这个答案也许会对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 实施 com.google.android.gms:play-services-ads:20.1.0 后我的应用程序崩溃 - my app crash after implement com.google.android.gms:play-services-ads:20.1.0 活动响应方法中首选项管理器的 Google Play 控制台崩溃报告 - Google Play Console Crash Report on preference manager in on response method of Activity Google Play控制台中的java.lang.IllegalStateException崩溃报告 - java.lang.IllegalStateException crash reports from Google Play Console Google Play控制台中的java.lang.RuntimeException应用程序崩溃 - java.lang.RuntimeException App Crash from Google Play Console 删除 Android Auto - Google Play 控制台无法识别 - Removing Android Auto - is not recognized by Google Play console 从 Android 应用程序使用 Android Google Play Dev API - Using Android Google Play Dev API from Android app 没有特定原因的Android / Google ANR崩溃 - Android / google ANR crash without a specific cause 无论如何测试谷歌应用内计费的订阅项目而不使他们的 state 在谷歌游戏控制台中处于活动状态? - Is there anyway to test subscription items of google in-app billing without making their state active in google play console? Google Play控制台堆栈跟踪 - Google Play Console Stack Trace 在没有 Google Play 访问权限的情况下远程更新我的应用 - Updating my app remotely without Google Play access
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM