为什么会出现此错误' - 只读应用程序无法POST'

say*_*iam 6 twitter android twitter4j twitter-oauth

logcat的:

12-05 23:37:01.721:W/System.err(534):  401:Authentication credentials  (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid     conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): 401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect. Ensure that you have set valid conumer key/secret, access token/secret, and the system clock in in sync.
12-05 23:37:01.721: W/System.err(534): error - Read-only application cannot POST
12-05 23:37:01.721: W/System.err(534): request - /1/statuses/update.json
Run Code Online (Sandbox Code Playgroud)

虽然我可以通过(getScreenName()函数)读取屏幕名称并设置读取,写入我的twitter应用程序的权限,但它给出了上面的logcat.And我正在使用twitter4j jar文件.

tho*_*mas 24

2022 年更新

所有以前发布的解决方案都不再起作用。这是当前的解决方案:

  1. 选择您的应用程序
  2. 编辑身份验证设置
  3. 启用 OAuth1
  4. 选择所需的权限
  5. 输入回调 URL(可以是任何内容)
  6. 重新生成 API 令牌(注意:您必须执行此操作,否则此过程将不起作用)

仪表板(步骤 1+2)

在此输入图像描述

设置(步骤 3+4)

在此输入图像描述


Ben*_*ier 13

  • 登录您的应用程序:http://dev.twitter.com/apps
  • Settings选项卡中,将更Application type改为Read, Write and Access direct messages
  • Reset keys选项卡中,按下Reset按钮,相应地更新应用程序中的使用者密钥和密码.

看起来重置键会强制更改应用程序类型以使其生效.

  • 修改权限后,必须重新生成 access-token 和 access-token-secret。 (5认同)
  • 我不知道为什么,但重置我的消费者密钥和秘密并没有解决这个问题,因为我试图向人们发送直接消息,尽管重新启动我的应用程序,手动撤销,我仍然得到“只读应用程序无法发布”应用程序并再次对其进行授权,然后重新运行测试。最终,我重新创建了我的访问令牌(dev.twitter.com 上应用程序“详细信息”窗格上的“重新创建我的访问令牌”按钮)并且可以发送私信。我不能说这是否是必需的,或者消费者密钥/秘密重置是否有效,我只是没有等待足够长的时间让它生效。 (4认同)