最新消息:20210917 已从crifan.com换到crifan.org

【未解决】rcsjta的core出错:FATAL EXCEPTION main android.os.FileUriExposedException file exposed beyond app through Intent.getData()

Android crifan 490浏览 0评论
折腾:
【未解决】rcsjta中调试core的apk即RCS Provisioning的app中功能和选项以寻找core的service启动逻辑
期间,RI在点击保存按钮时
崩溃退出
报错:
D/Surface: Surface::disconnect(this=0x799e0ed000,api=1)
D/View: [Warning] assignParent to null: this = android.widget.PopupWindow$PopupDecorView{9ac4fce V.E...... R.....ID 0,0-920,0}
D/AndroidRuntime: Shutting down VM

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.gsma.rcs.ri, PID: 14730
    android.os.FileUriExposedException: file:/// exposed beyond app through Intent.getData()
        at android.os.StrictMode.onFileUriExposed(StrictMode.java:1978)
        at android.net.Uri.checkFileUriExposed(Uri.java:2371)        at android.content.Intent.prepareToLeaveProcess(Intent.java:10263)
        at android.content.Intent.prepareToLeaveProcess(Intent.java:10215)
        at android.app.Instrumentation.execStartActivity(Instrumentation.java:1667)
        at android.app.Activity.startActivityForResult(Activity.java:4651)
        at android.app.Activity.startActivityForResult(Activity.java:4609)
        at android.app.Activity.startActivity(Activity.java:4970)
        at android.app.Activity.startActivity(Activity.java:4938)
        at com.gsma.rcs.ri.contacts.ContactVCard$2.onClick(ContactVCard.java:132)
        at android.view.View.performClick(View.java:6614)
        at android.view.View.performClickInternal(View.java:6587)
        at android.view.View.access$3100(View.java:787)
        at android.view.View$PerformClick.run(View.java:26122)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6831)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:927)
E/MQSEventManagerDelegate: failed to get MQSService.
找到核心这句:
at com.gsma.rcs.ri.contacts.ContactVCard$2.onClick(ContactVCard.java:132)
的代码:
src/com/gsma/rcs/ri/contacts/ContactVCard.java
    /**
     * Show button listener
     */
    private OnClickListener btnShowListener = new OnClickListener() {
        public void onClick(View v) {
            // Get filename
            TextView vcardView = (TextView) findViewById(R.id.vcard);
            String filename = vcardView.getText().toString();


            // Show the transferred vCard
            File file = new File(filename);
            Uri uri = Uri.fromFile(file);
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(uri, "text/plain");
            startActivity(intent);
        }
    };
}
startActivity(intent);
估计此处filename是空?
去调试看看
结果调试RI,但是没有触发这行代码。
看来要调试RCS的core
结果也不行
但是点击保存,报了另外错误:
【未解决】rcsjta的core出错:java.lang.NullPointerException Attempt to invoke virtual method java.lang.String com.gsma.rcs.utils.ContactUtil PhoneNumber.getNumber on a null object reference
再去找找相关代码和逻辑

此处突然想到:
或许是:
换个安卓手机 小米9看看是否会报同样错误?
以及 打开那个 java的Exception就停止的debug选项,看看能否运行到断点?

很高兴的是:换了小米9 能运行到一个断点,所以回去:
【未解决】rcsjta中研究RCS的core的Service本身相关代码以希望找到为何没启动的原因
继续研究逻辑。

转载请注明:在路上 » 【未解决】rcsjta的core出错:FATAL EXCEPTION main android.os.FileUriExposedException file exposed beyond app through Intent.getData()

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
93 queries in 0.237 seconds, using 23.34MB memory