美文网首页
Warning:Exception while processi

Warning:Exception while processi

作者: T9的第三个三角 | 来源:发表于2017-10-23 17:23 被阅读449次

    打包问题,打包时报错Warning:Exception while processing task java.io.IOException,初步判断为重复引用问题,发现引用了两个flurry统计,一个为jar包引用,一个为compile,所以删除一个,clean-build,依然警告
    解决:

    -ignorewarnings
    

    再次编译,重新报错

    Error-Expected resource of type styleable [ResourceType]
    

    因为项目是老项目,使用了反射来修改状态栏,使用了SystemBarTintManager工具类,解决:

      @TargetApi(19)
        @SuppressWarnings("ResourceType")    //添加忽略该警告
        public SystemBarTintManager(Activity activity) {
    
            Window win = activity.getWindow();
            ViewGroup decorViewGroup = (ViewGroup) win.getDecorView();
    
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                // check theme attrs
                int[] attrs = {android.R.attr.windowTranslucentStatus,
                        android.R.attr.windowTranslucentNavigation};
                TypedArray a = activity.obtainStyledAttributes(attrs);
                try {
                    mStatusBarAvailable = a.getBoolean(0, false);
                    mNavBarAvailable = a.getBoolean(1, false);
                } finally {
                    a.recycle();
                }
    
                // check window flags
                WindowManager.LayoutParams winParams = win.getAttributes();
                int bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
                if ((winParams.flags & bits) != 0) {
                    mStatusBarAvailable = true;
                }
                bits = WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION;
                if ((winParams.flags & bits) != 0) {
                    mNavBarAvailable = true;
                }
            }
    
            mConfig = new SystemBarConfig(activity, mStatusBarAvailable, mNavBarAvailable);
            // device might not have virtual navigation keys
            if (!mConfig.hasNavigtionBar()) {
                mNavBarAvailable = false;
            }
    
            if (mStatusBarAvailable) {
                setupStatusBarView(activity, decorViewGroup);
            }
            if (mNavBarAvailable) {
                setupNavBarView(activity, decorViewGroup);
            }
    
        }
    

    顺利通过编译,打包成功

    相关文章

      网友评论

          本文标题:Warning:Exception while processi

          本文链接:https://www.haomeiwen.com/subject/hrbauxtx.html