小编Gri*_*orr的帖子

在路径上找不到类"android.view.View $ OnUnhandledKeyEventListener":DexPathList

我尝试使用Android 3.4 Canary 4和targetSdkVersion 28创建基本示例项目,但是在获取跟踪错误setContentView(R.layout.activity_main)并且没有获得任何视图交互.

Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at void android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, android.support.v4.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at android.view.ViewGroup android.support.v7.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at void android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at void android.support.v7.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at void android.support.v7.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2018-11-09 14:01:46.696 22177-22177/com.example.unittest I/zygote:     at void com.example.unittest.MainActivity.onCreate(android.os.Bundle) (MainActivity.kt:14)
2018-11-09 14:01:46.697 22177-22177/com.example.unittest I/zygote:     at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7032)
2018-11-09 14:01:46.697 22177-22177/com.example.unittest I/zygote: …
Run Code Online (Sandbox Code Playgroud)

android kotlin

7
推荐指数
0
解决办法
1275
查看次数

Android Studio 2.3无法使用即时运行:使用ClassNotFoundException调试apk崩溃

在Android Studio 2.3更新(和gradle更新)之后,如果我已经激活了即时运行,并且我通过运行或生成签名的apk从Android Studio安装应用程序,它可以正常工作.

如果我手动安装调试apk,它会在打开时立即崩溃ClassNotFoundException.

注意:如果删除对文件提供程序的引用,则找不到的类将成为主要活动.这个问题是在Build - > Output - > apk文件夹中生成的调试apk .如果你直接运行应用程序,它总是运行良好.

没有即时运行就没有崩溃.使用以前版本的Android Studio也没有崩溃.

java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.vfirst.ifbagro-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.vfirst.ifbagro-1, /vendor/lib, /system/lib]]
at android.app.ActivityThread.installProvider(ActivityThread.java:4993)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4596)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4536)
at android.app.ActivityThread.access$1300(ActivityThread.java:149)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1353)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5214)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:739)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.vfirst.ifbagro-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.vfirst.ifbagro-1, …
Run Code Online (Sandbox Code Playgroud)

android firebase android-studio

6
推荐指数
1
解决办法
1610
查看次数

Google PubSub python客户端返回StatusCode.UNAVAILABLE

我正在尝试建立一个长期运行的Pull订阅Google Cloud PubSub主题.我使用的代码非常类似于此处文档中给出的示例,即:

def receive_messages(project, subscription_name):
    """Receives messages from a pull subscription."""
    subscriber = pubsub_v1.SubscriberClient()
    subscription_path = subscriber.subscription_path(
        project, subscription_name)

    def callback(message):
        print('Received message: {}'.format(message))
        message.ack()

    subscriber.subscribe(subscription_path, callback=callback)

    # The subscriber is non-blocking, so we must keep the main thread from
    # exiting to allow it to process messages in the background.
    print('Listening for messages on {}'.format(subscription_path))
    while True:
        time.sleep(60)
Run Code Online (Sandbox Code Playgroud)

问题是我有时收到以下追溯:

Exception in thread Consumer helper: consume bidirectional stream:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, …
Run Code Online (Sandbox Code Playgroud)

python google-cloud-pubsub

6
推荐指数
1
解决办法
588
查看次数

DocumentReference.set(Object o) 更改布尔字段名称

使用时DocumentReference.set(object),布尔字段会发生变化。带有“is”前缀的字段更改为普通字段值

class Invitation {
    private boolean isRequested;
    private boolean isValid;
    private boolean isAccepted;
    private String lastName,firstName;
    private long sentOn;
}
Run Code Online (Sandbox Code Playgroud)

当我使用set()方法将此对象推送到数据库时,布尔值以这种方式更改:

Firestore 截图

android firebase google-cloud-firestore

6
推荐指数
1
解决办法
1053
查看次数

克隆一个列表(类)

我已经做了一些阅读,似乎无法解决在我的VB2010项目中克隆List(类)的最佳方法.我有三个相关的课程

Public Class City
    'here are many fields of type string and integer
    Public Roads As New List(Of Road)
End Class
Public Class Road
    'here are many fields of type string and integer
    Public Hazards As New List(Of Hazard)
End Class
Public Class Hazard
    Implements ICloneable

    'here are many fields of type string and integer and double
    Public Function Clone() As Object Implements System.ICloneable.Clone
        Return Me.MemberwiseClone
    End Function
End Class
Run Code Online (Sandbox Code Playgroud)

所以,假设我有一个我正在研究的城市,有些情况我想要创建,作为基础的一条道路及其危险,然后添加另一条道路,但使用先前的道路危险作为起点然后调整字段.

Dim rd As New Road
'add road fields

dim …
Run Code Online (Sandbox Code Playgroud)

vb.net clone class list icloneable

5
推荐指数
1
解决办法
2万
查看次数

限制返回数据的深度

是否可以限制从 Firebase 数据库返回的数据深度?

例如,如果我想从父对象获取一些数据而不等待其所有子对象和子对象,我可以指定我只需要 x 级对象吗?

firebase firebase-realtime-database

5
推荐指数
1
解决办法
1027
查看次数

注销后权限被拒绝

我用firebase数据库构建了一个AngularJs(1.6)应用程序.问题是:当用户退出时,我会收到大量错误permission_denied.

如果这可以有任何帮助:

firebase.auth().signOut().then(function() {
    $state.go('login');
}, function(error) {});
Run Code Online (Sandbox Code Playgroud)

有没有办法避免这种情况?

angularjs firebase angularfire firebase-authentication angularfire2

5
推荐指数
0
解决办法
637
查看次数

Firebase消息传递的云功能中的有效负载错误

我使用Cloud Functions for Firebase编写了一个云功能,可以向Firebase Messaging的某些主题发送通知.函数的最后部分定义要发送的有效负载,然后发送它:

// javascript code in cloud functions
const payload = {
      'notification': {
        'title': `${toTitleCase(name)} just logged an event`,
        'body': `${events[eventType]} for ${toTitleCase(petName)}`,
        'data': {
            'personSent': userSent 
        }
      }
    };
console.log(payload);
admin.messaging().sendToTopic(pet_Id, payload);
Run Code Online (Sandbox Code Playgroud)

但是,我在Firebase控制台中收到了错误日志:

错误:消息传递有效内容包含"notification.data"属性的无效值.值必须是字符串.

当我注销有效负载时,我确认它是所有字符串:

{ notification: 
   { title: 'Turtle Dude just logged an event',
     body: 'Walk for Beer',
     data: { personSent: 'mfsP8U0qDdQL4rrrbXp6K0YsF423' } } }
Run Code Online (Sandbox Code Playgroud)

但是,当我从我的iPhone应用程序(我试图避免,因为这意味着我必须在客户端存储消息传递私钥)发送相同的有效负载时,我能够附加我想发送的额外数据就好了:

// Swift code in iPhone app
let body: [String: Any] = ["to": "/topics/\(currentPet)",
                            "priority" : "high",
                            "notification" : …
Run Code Online (Sandbox Code Playgroud)

javascript firebase google-cloud-functions firebase-cloud-messaging

5
推荐指数
1
解决办法
4089
查看次数

保存对其他集合的引用

如何在Firebase Firestore中保存对其他集合的引用?添加数据文档没有提及有关保存引用的任何内容.

firebase firebase-realtime-database google-cloud-firestore

5
推荐指数
1
解决办法
2976
查看次数

非调试模式下的 Django Whitenoise 500 服务器错误

我在本地机器上使用 django。为了提供静态文件,我将 WhiteNoise 与它一起使用。当DEBUG = True所有静态文件都正确提供时。但是当我更改DEBUG = False并设置时,ALLOWED_HOSTS = ['*']我收到了 500 服务器错误。但是管理站点加载没有任何错误。此外,当我注释掉时,STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'我没有收到 500 错误。

我按照http://whitenoise.evans.io/en/stable/django.html 中给出的文档来连接 whitenoise。我没有对wsgi.py文件进行任何更改。我跑了python manage.py collecststatic,它没有任何错误地运行。

下面settings.py给出:

import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

SECRET_KEY = 'fdft&b(xb*!qq3ghjkjhg6789ih8ik!w10$0uscxcpqpmz'
DEBUG = False

ALLOWED_HOSTS = ['*']

INSTALLED_APPS = [
'whitenoise.runserver_nostatic', #Disable Djangos static file server during DEVELOPMENT
'gep_app.apps.GepAppConfig',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', …
Run Code Online (Sandbox Code Playgroud)

django django-settings django-staticfiles collectstatic whitenoise

5
推荐指数
1
解决办法
1873
查看次数