小编Mar*_*res的帖子

用户没有定义任何参数构造函数

我不断收到此错误"用户没有定义无参数构造函数.如果您使用的是ProGuard,请确保这些构造函数不会被剥离." 尝试了一切,不知道为什么会发生.

public void retrievingUserInfo(){

    databaseUserID.addValueEventListener(new ValueEventListener() {
        @Override
        public void onDataChange(DataSnapshot dataSnapshot) {

            //clearing the previous userinfo list
            Users_Info.clear();

            //iterating through all the nodes
            for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {
                //getting userinfo
                users userinfo = postSnapshot.getValue(users.class);
                //adding userinfo to the list
                Users_Info.add(userinfo);
            }
        }

        @Override
        public void onCancelled(DatabaseError databaseError) {

        }
    });
}
Run Code Online (Sandbox Code Playgroud)

users.class

@Keep
public class users {

    public String user_id, address, contact, name;

    public users(String user_id, String address, String contact,String name) 
    {}


}
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-realtime-database

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

java.lang.NoSuchMethodError:没有静态方法combineMeasuredStates(II)我在课堂上

我有一个问题,我不确定为什么,还是一个新手,请帮忙.

错误:java.lang.NoSuchMethodError:没有静态方法combineMeasuredStates(II)我在类Landroid/support/v7/widget/ViewUtils中; 或其超级类('android.support.v7.widget.ViewUtils'的声明出现在/data/app/com.example.marvin.test-1/split_lib_dependencies_apk.apk:classes58.dex)

建立gradle:

     apply plugin: 'com.android.application'

android {
useLibrary 'org.apache.http.legacy'

compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
    applicationId "com.example.marvin.test"
    minSdkVersion 16
    targetSdkVersion 27
    multiDexEnabled true
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})

compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:exifinterface:25.3.1'
} …
Run Code Online (Sandbox Code Playgroud)

java android

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