不幸的是应用程序停止 [英] App unfortunately stops

查看:148
本文介绍了不幸的是应用程序停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了应用程序已停止不幸的错误。我使用的解析,所以我假设问题介于内。

这是我引起,当我尝试加载它的错误的Ja​​va文件

 公共类NewTipActivity延伸活动{私人窍门;@覆盖
保护无效的onCreate(捆绑savedInstanceState){
   尖=新的提示();
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    。getWindow()addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);    //新的提示片段
    的setContentView(R.layout.activity_new_tip);
    FragmentManager经理= getFragmentManager();
    片段片段= manager.findFragmentById(R.id.fragmentContainer);    如果(片段== NULL){
        片段=新NewTipFragment();
        manager.beginTransaction()。添加(R.id.fragmentContainer,片段)
                。承诺();
    }}公众提示getCurrentTip(){
    返回尖;
}
}

这是logcat的
产生的原因:


  

java.lang.IllegalArgumentException异常:不能setReadAccess为用户
  与com.parse.ParseACL.setReadAccess(ParseACL.java:308)在空ID
  com.parse.ParseACL.getDefaultACL(ParseACL.java:61)在
  com.parse.ParseObject.setDefaultValues​​(ParseObject.java:3385)在


提示类(这就是getAuthor()需要声明),但我有一个严重的街区,不明白这一点。

包com.holyapp.danshinn.wingman_etiquette;

 进口com.parse.ParseClassName;
进口com.parse.ParseObject;
进口com.parse.ParseUser;
进口com.parse.ParseFile;    @ParseClassName(提示)
    公共类末梢延伸的parseObject {
        公众提示(){
           //需要一个默认的构造函数
        }        公共字符串的getTitle(){返回的getString(称号); }        公共无效的setTitle(字符串名称){把(题,题); }        公共ParseUser getAuthor(){返回getParseUser(作者);}        公共无效setAuthor(ParseUser用户){把(作者,用户);}        公共字符串getRating(){返回的getString(等级);}        公共无效setRating(字符串等级){把(等级,评级);}}


解决方案

  

产生的原因:java.lang.IllegalArgumentException异常:不能setReadAccess在com.parse.ParseACL.setReadAccess(ParseACL.java:308)与空ID的用户


用户的id为null。


  

在com.holyapp.danshinn.wingman_etiquette.NewTipActivity.onCreate(NewTipActivity.java:20)com.holyapp.danshinn.wingman_etiquette.Tip。(Tip.java:17)


这些都是你在哪里有您的问题的线条。请避免张贴这样广泛的问题。对于是什么让上所以好的和坏的问题的详细信息,请查看官方SO准则。具体来说,


  

pretend你跟一个繁忙的同事,要总结整个问题一句话:你可以包括哪些细节,这将帮助别人发现和解决问题了吗?包括任何错误消息,关键的API,或不寻常情况使从网站上已有类似的问题你的问题不同。


和,相关职称:


  

如果您遇到问题,总结问题,写标题最后
   - 有时写作问题的先休息可以更容易说明问题


  
  

例如:


  
  

错误:C#数学混乱


  
  

好:为什么使用浮动,而不是不给予INT
  我的时候我所有的输入都是整数不同的结果?


  
  

错误:[PHP]
  会议疑问


  
  

好:我怎样才能重定向用户根据不同的页
  在PHP会话数据?


  
  

错误:机器人,如果其他问题


  
  

好:为什么
  当海峡设置为值海峡==价值计算为假的?


I am receiving "App has unfortunately stopped" error. I am using parse so I am assuming the issue lies somewhere within that.

This is the java file that I causes the error when i try loading it

public class NewTipActivity extends Activity {

private Tip tip;

@Override
protected void onCreate(Bundle savedInstanceState) {
   tip = new Tip();
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
    super.onCreate(savedInstanceState);

    //New Tip Fragment
    setContentView(R.layout.activity_new_tip);
    FragmentManager manager = getFragmentManager();
    Fragment fragment = manager.findFragmentById(R.id.fragmentContainer);

    if (fragment == null) {
        fragment = new NewTipFragment();
        manager.beginTransaction().add(R.id.fragmentContainer, fragment)
                .commit();
    }

}

public Tip getCurrentTip() {
    return tip;
}
}

This is the logCat Caused by:

java.lang.IllegalArgumentException: cannot setReadAccess for a user with null id at com.parse.ParseACL.setReadAccess(ParseACL.java:308) at com.parse.ParseACL.getDefaultACL(ParseACL.java:61) at com.parse.ParseObject.setDefaultValues(ParseObject.java:3385) at

Tip class (This is where the getAuthor() needs to be declared) but I am having a serious block and can't figure this out.

package com.holyapp.danshinn.wingman_etiquette;

import com.parse.ParseClassName;
import com.parse.ParseObject;
import com.parse.ParseUser;
import com.parse.ParseFile;



    @ParseClassName ("Tip")
    public class Tip extends ParseObject {


        public Tip(){
           // a default constructor is required
        }

        public String getTitle() { return getString("title"); }

        public void setTitle(String title) { put("title", title); }

        public ParseUser getAuthor() { return getParseUser("Author");}

        public void setAuthor(ParseUser user) { put("Author", user);}

        public String getRating(){return getString("rating");}

        public void setRating(String rating) { put("rating" , rating);}

}

解决方案

Caused by: java.lang.IllegalArgumentException: cannot setReadAccess for a user with null id at com.parse.ParseACL.setReadAccess(ParseACL.java:308)

User has a null id.

com.holyapp.danshinn.wingman_etiquette.Tip.(Tip.java:17) at com.holyapp.danshinn.wingman_etiquette.NewTipActivity.onCreate(NewTipActivity.java:20)

Those are the lines where you're having your issue. Please avoid posting broad questions like this. For details on what makes a good and bad question on SO, check out the official SO guidelines. Specifically,

Pretend you're talking to a busy colleague and have to sum up your entire question in one sentence: what details can you include that will help someone identify and solve your problem? Include any error messages, key APIs, or unusual circumstances that make your question different from similar questions already on the site.

and, relating to titles:

If you're having trouble summarizing the problem, write the title last - sometimes writing the rest of the question first can make it easier to describe the problem.

Examples:

Bad: C# Math Confusion

Good: Why does using float instead of int give me different results when all of my inputs are integers?

Bad: [php] session doubt

Good: How can I redirect users to different pages based on session data in PHP?

Bad: android if else problems

Good: Why does str == "value" evaluate to false when str is set to "value"?

这篇关于不幸的是应用程序停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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