我使用android studio 1.2.1.1并没有给我任何新项目的错误.但是对于导入的项目,它会给我一个关于不匹配的编码(这个问题)的警告.我将项目和IDE编码更改为UTF-8,此警告不再出现.
但是,在那之后,它给了我这个错误.
F:\Work\workspace\NITask\app\build\intermediates\res\debug\drawable-hdpi-v4\ic_launcher.png: error: Duplicate file.
F:\Work\workspace\NITask\app\build\intermediates\res\debug\drawable-hdpi\ic_launcher.png: Original is here. The version qualifier may be implied.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\sdk\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)
在这些项目中,我的主模块中没有R类.
我读了许多问题,比如非零退出值但没有用
更新:
在清理项目之后,它给了我很多关于我的资源的错误,如下所示:
AAPT err(1779619686): F:\Work\workspace\NITask\app\src\main\res\drawable-xhdpi\shadow.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
Run Code Online (Sandbox Code Playgroud) 当我的消费者的任何部分出现异常时,Django-Channels 无法在控制台中显示异常错误。
发生异常时,它只是在控制台中显示“WebSocket DISCONNECT /ws/test/ [127.0.0.1:7907]”。
我使用以下命令运行带有 debug=True 设置的项目:
python3 manage.py runserver
Run Code Online (Sandbox Code Playgroud)
我使用 django-channles 的基本设置:
# CHANNELS
# ------------------------------------------------------------------------------
ASGI_APPLICATION = "config.routing.application"
CHANNEL_LAYERS = {
    'default': {
        'BACKEND': 'channels_redis.core.RedisChannelLayer',
        'CONFIG': {
            "hosts": [('127.0.0.1', 6379)],
        },
    },
}
Run Code Online (Sandbox Code Playgroud)
并有一个非常简单的消费者进行测试:
class Test(WebsocketConsumer):
  def connect(self):
    print(self.scope['headers'])  # show headers in console.
    raise Exception('test exception')  # this line doesn't show any thing in console. just show disconnect message.
    self.accept()
  def receive(self, text_data=None, bytes_data=None):
    print(text_data)
Run Code Online (Sandbox Code Playgroud)
和路由:
application = ProtocolTypeRouter({
    'websocket': AuthMiddlewareStack(
        URLRouter(
            orders.routing.websocket_urlpatterns
        )
    ), …Run Code Online (Sandbox Code Playgroud) 我有使用电子邮件作为身份验证的唯一标识符而不是用户名的自定义用户模型。我想通过电子邮件或手机号码注册用户。如果用户输入电子邮件地址,则通过激活链接注册用户;如果用户输入电话号码,则通过SMS OTP注册。
像instagram注册这样的东西:
https://www.instagram.com/accounts/emailsignup/
我找到了这个主题,但是答案却解释得不好。