Open 117atlas opened 5 years ago
Thanks for reporting.. I will look into this after work.. Meanwhile can you send me the XML layout you are using?
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:theme="@style/AppTheme.TransparentStatusBar"
android:background="@drawable/background_pattern_white"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.login.KamixLoginMobileFragment">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="16dp"
android:text="@string/kamix_login_mobile_todo"
android:textAlignment="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="32dp"
android:gravity="center_vertical"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:layout_constraintVertical_bias="0.0">
<com.hbb20.CountryCodePicker
android:id="@+id/activity_verify_phone_number_ccp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="12dp"
app:ccp_textSize="12sp"
app:ccp_autoDetectCountry="true"
app:ccp_autoDetectLanguage="true"
app:ccp_autoFormatNumber="true"
app:ccp_contentColor="@color/colorBlackDisabledText"
app:ccp_countryPreference="us,ca,cm"
app:ccp_showNameCode="false" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/activity_verify_phone_number_phone_TextInputLayout"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/kamix_login_mobile_mobile_label"
android:textColorHint="@color/colorBlackPrimaryText"
app:errorEnabled="false"
app:errorTextAppearance="@style/error_appearance"
app:hintEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/activity_verify_phone_number_phone_EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="16dp"
android:hint="@string/kamix_login_mobile_mobile_label"
android:inputType="phone"
android:imeOptions="actionDone"
android:singleLine="true"
android:textColor="@color/colorBlackPrimaryText"
android:textColorHint="@color/colorWhiteDisabledText" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/activity_welcome_next_btn"
style="@style/Widget.AppCompat.Button.Colored"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:layout_marginBottom="32dp"
android:layout_weight="1"
android:text="@string/kamix_login_continue"
android:textColor="@color/white"
app:cornerRadius="20dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout"
app:layout_constraintVertical_bias="0.0" />
<ImageView
android:layout_width="match_parent"
android:layout_height="360dp"
android:src="@drawable/waves_background"
android:adjustViewBounds="true"
android:scaleType="fitXY"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="1.0"
tools:ignore="VectorDrawableCompat"
android:contentDescription="@string/app_name" />
</androidx.constraintlayout.widget.ConstraintLayout>
It seems that all widgets are null, i.e. the ids of the widgets in the library do not exist.
That's weird.. I created brand new testing app and used 2.3.1 version of CCP with the attributes you specified. Somehow it worked.
I am sure you must have tried by cleaning and rebuilding project. I wonder if this can be because of gradle version?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "io.kamix.kamix"
minSdkVersion 19
targetSdkVersion 28
versionCode 26
versionName "1.1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexKeepFile file('multidex-config.txt')
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//Lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
//implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
//Firebase
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-auth:19.0.0'
//Support libraries
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.multidex:multidex:2.0.0'
//Mentions
implementation 'org.apache.commons:commons-lang3:3.4'
implementation 'com.percolate:caffeine:0.3.3'
//Widgets libraries
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation 'com.ajts.androidmads.fontutils:fontutils:1.0.2'
implementation 'com.github.davidmigloz:number-keyboard:2.0.1'
implementation 'com.poovam:pin-edittext-field:1.1.2'
implementation 'com.github.joielechong:countrycodepicker:2.4.1'
implementation 'com.hbb20:ccp:2.3.1'
//debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-alpha-2'
//implementation project(':ccp')
implementation 'com.googlecode.libphonenumber:libphonenumber:7.2.2'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
implementation 'com.github.congfandi:simpleDatePicker:Dateicker'
implementation 'com.github.yesterselga:country-picker-android:1.0'
implementation 'com.aurelhubert:ahbottomnavigation:2.2.0'
implementation 'com.weiwangcn.betterspinner:library:1.1.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.google.android:flexbox:1.0.0'
implementation 'com.github.ganfra:material-spinner:2.0.0'
implementation 'com.jemshit:crystal-range-seekbar:1.2.0'
implementation 'xyz.danoz:recyclerviewfastscroller:0.1.3'
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
implementation 'com.anttek.boundedview:library:1.0@aar'
implementation 'com.github.chrisbanes:PhotoView:2.1.2'
implementation 'com.google.android.exoplayer:exoplayer:r2.3.0'
//Emojis
implementation 'com.vanniktech:emoji:0.5.1'
implementation 'com.vanniktech:emoji-ios:0.5.1'
//Orm
implementation 'com.github.satyan:sugar:1.5'
//Permissions
implementation 'com.karumi:dexter:5.0.0'
//Device infos
implementation 'com.jaredrummler:android-device-names:1.1.8'
//Image
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.bumptech.glide:glide:4.3.1'
//Network
implementation 'com.squareup.retrofit2:retrofit:2.0.2'
implementation 'com.google.code.gson:gson:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation files('libs/ion-1.3.7.jar')
implementation files('libs/androidasync-1.3.7.jar')
implementation 'com.mindorks.android:prdownloader:0.5.0'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
//QRCode
implementation 'me.dm7.barcodescanner:zbar:1.8.4'
implementation 'com.github.kenglxn.QRGen:android:2.5.0'
//Chat library
implementation 'com.sendbird.sdk:sendbird-android-sdk:3.0.88'
//implementation files('libs/sendbird-android-sdk-3.0.88.jar')
//Test libraries
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
//Audio Recorder
implementation 'com.github.piasy:rxandroidaudio:1.5.0'
implementation 'com.github.piasy:AudioProcessor:1.5.0'
implementation 'net.the4thdimension:audio-wife:1.0.3'
//Web page parser
implementation 'org.jsoup:jsoup:1.11.2'
}
configurations.all {
resolutionStrategy {
force 'com.android.support:design:28.0.0'
force 'com.android.support:support-v4:28.0.0'
force 'com.android.support:appcompat-v7:28.0.0'
force 'com.android.support:recyclerview-v7:28.0.0'
}
}
apply plugin: 'com.google.gms.google-services'
Maybe a dependency in my gradle file can cause the issue This is my gradle file
I also tried to download the library project and add this as a dependency, but i had the same error.
I found this lib now and when I try to use it I get the same error.
Version: com.hbb20:ccp:2.3.3
Also there are these lines in traceback:
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.hbb20.CountryCodePicker"
Caused by: java.lang.NoClassDefFoundError: com.futuremind.recyclerviewfastscroll.R$layout
Update:
Fixed by:
-keep class com.hbb20.CountryCodePicker {*;}
-keep class com.futuremind.recyclerviewfastscroll.* {*;}
I use android X in my app. So i take the latest version of CountryCodePicker to use. When i launch the fragment where is the widget, my app crash with this error : android.view.InflateException: Binary XML file line #44: Binary XML file line #44: Error inflating class com.hbb20.CountryCodePicker
Here is the stack