Closed alevittoria closed 6 years ago
I have the same issue
Hi @alevittoria, can you try using com.android.support:design:28.0.0-alpha1
for now? Will update the docs soon.
@dsn5ft only design library should be updated or other support libraries too?
Because when using all support libraries with 28.0.0-alpha1
there is a problem with missing attributes
error: resource android:attr/dialogCornerRadius not found.
Message{kind=ERROR, text=error: resource android:attr/dialogCornerRadius not found., sources=[/Users/vkuznetsov/.gradle/caches/transforms-1/files-1.1/appcompat-v7-28.0.0-alpha1.aar/ee90c8729d63b0f680c9d3df36df6f1b/res/values-v28/values-v28.xml:9:5-12:13], original message=, tool name=Optional.of(AAPT)}
Yep, your app's other Support Library dependencies should be updated as well. Here are release notes for 28.0.0-alpha1
- https://developer.android.com/topic/libraries/support-library/revisions#28-0-0-alpha1.
Regarding the missing attribute issue, I think this is because you need to update your compileSdkVersion to 'android-P'. You'll also have to download the Android P Preview using the SDK manager if you haven't already. Here is a similar post - https://stackoverflow.com/questions/49171300/no-resource-found-that-matches-the-given-name-at-dialogcornerradius-with-valu.
Will this issue be closed? It's already in Google's Maven repository: https://maven.google.com
I could import the lib but I couldn't compile. Android Studio(3,2 canary 14 newest) always shows the bug
Compilation failed to complete
I fixed my bug.
I set targetSDK and minSDK is "P"
, and use the new name of libs with androidx instead of appcompat:v7:28.0.0-alpha1.
and in the file gradle.properties set
android.useAndroidX = true
android.enableJetifier = false
Maven repository is very useful to reference https://dl.google.com/dl/android/maven2/index.html
@dsn5ft so it's not possible to use material components in production yet? Because of android-P target SDK?
This is my best attempt at the time:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "xl.domain.appname"
minSdkVersion 21
targetSdkVersion 'P'
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.google.android.material:material:1.0.0-alpha1'
implementation 'com.android.support:design:28.0.0-alpha1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Still getting an error:
Compilation failed to complete
Program type already present: android.support.v4.os.ResultReceiver$1
Message{kind=ERROR, text=Program type already present: android.support.v4.os.ResultReceiver$1, sources=[Unknown source file], tool name=Optional.of(D8)}
I was hoping the demo could help me but there is no library in that gradle
Can somebody provide with a working gradle
please?
@cutiko I have the similar your problem so you should change com.android.support:design -> androidx.appcompat:appcompat minSDK -> P to retry.
and in the file gradle.properties set
android.useAndroidX = true
android.enableJetifier = false
I have the same issue :
Program type already present: android.support.v4.os.ResultReceiver$1 Message{kind=ERROR, text=Program type already present: android.support.v4.os.ResultReceiver$1, sources=[Unknown source file], tool name=Optional.of(D8)}
Can anyone help ? Our team choose to use this lib, I have a deadline to use it on next Wednesday. Many thanks!
This is new test project with only this additional lib: my "build.gradle"
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android { compileSdkVersion 'android-P' defaultConfig { applicationId "com.uob.test3" minSdkVersion 24 targetSdkVersion 'P' versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
implementation 'com.google.android.material:material:1.0.0-alpha1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
@houdangui1985
change
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
to
implementation 'androidx.constraintlayout:constraintlayout:1.1.0'
implementation 'androidx.appcompat:appcompat:1.0.0-alpha1'
I suggest you to get Android Studio 3.2 and go to Refactor -> Refactor to AndroidX
@Dwite that is correct. The next preview of P is coming soon which will allow you to publish to the Play Store. This page has some useful information about that and the timeline for Android P - https://developer.android.com/preview/overview.
@houdangui1985 see the response above from @marcoscgdev about updating your dependencies to androidx. I would also suggest using the new Refactor to AndroidX
option in the latest version of Android Studio. Check out this page for more information on that - https://developer.android.com/studio/preview/features/#androidx_refactoring.
Here is a working example of a build.gradle file that uses the new androidx appcompat library and the new material components library:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId "com.android.example"
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api 'androidx.appcompat:appcompat:1.0.0-alpha1'
api 'com.google.android.material:material:1.0.0-alpha1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha1'
}
Thanks, everybody this has been very constructive. I can confirm the above information will make the project.
I think the only thing I can say to collaborate is there is an implicit confusion here. I was confused because latest Android Studio version with the Refactor X
is not on the stable channel. I came here due to the changes in the Material Design guidelines. The alpha
is indeed a strong indicator, but I assumed it was not gonna be an issue because I found it on the official guidelines, was expecting to be like when the constraints layout
library was on alpha but was usable on stable Android Studio.
Hi guys, @marcoscgdev @cutiko @dsn5ft , thank you! I can compile now. May I know why this lib has no releases yet, but only a 1.0.0 alpha version, while the ios version from same website has got lots of releases? our team are all surprised to see that. And what is the difference between this one and google's android.support.design lib which also contains many material components?
@houdangui1985 Maybe the 1.0.0-alpha1
version of the library is the same as 28.0.0-alpha1
version of the Android Support Design Repository?
@houdangui1985 @Chan4077 I don't want to extend this beyond the scope of a Github issue but neither to neglect helping you.
For what I understand this new set of libraries include tons of new options that will make developing more beautiful, usable and simpler. By example the TextInputLayout
that previously held the label when the user tapped on the EditText
no include a counter with automatic verification. Another thing that is noticeable is the transformations, you can check this [quick example] (https://github.com/cutiko/MaterialTesting). You can see more about the new attributes in the official site
For a full test-run of the feature in this, you should try the catalog. Clone the repo and then run the catalog module on Android Studio. Make sure you have an emulator with Android P. Warning: is slightly heavy so it could take a while to index, build, et.
git clone https://github.com/material-components/material-components-android.git
Maybe there are other ways to try the catalog, but this worked for me.
@houdangui1985 This library is a drop in replacement for the original Design Library, and the 28.0.0 releases are also from this repo. The only difference between the 1.0.0 and 28.0.0 releases is that for the 1.0.0 releases the library is packaged as com.google.android.material and depends on the new androidx jetpack libraries. The 28.0.0 releases will be the last of the android.support.* versions.
@dsn5ft thanks for your answer ! Before seeing this answer I noticed that the androidX refactor automatically refactor the material-components 1.0.0 alpha to support design 28.0.0 alpha . I guessed they are actually the somehow the same then
No problem! Technically the 28.0.0-alpha1
release happened a couple months before the 1.0.0-alpha1
, but they are roughly the same in terms of functionality, and like I mentioned they are both from this codebase. Going forward there will likely be "identical" 28.0.0
and 1.0.0
releases.
And just to clarify, the Android Studio Refactor to AndroidX
option updates your code/dependencies from com.android.support:design:28.0.0-alpha1
to com.google.android.material:material:1.0.0-alpha1
. The 28.0.0-alpha1
and 1.0.0-alpha1
versions should not be used at the same time.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { compileSdkVersion 28 defaultConfig { applicationId "dspl.com.myapplication" minSdkVersion 19 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } packagingOptions { exclude 'META-INF/atomicfu.kotlin_module' exclude 'META-INF/proguard/androidx-annotations.pro' } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
}
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.material:material:1.0.0-beta01' implementation 'com.google.android.gms:play-services-maps:16.1.0' // After Adding this Line implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$rootProject.archLifecycleVersion" kapt "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"
// Room components implementation "androidx.room:room-runtime:$rootProject.roomVersion" implementation "androidx.room:room-ktx:$rootProject.roomVersion" kapt "androidx.room:room-compiler:$rootProject.roomVersion"
implementation 'com.google.code.gson:gson:2.8.5' //https://github.com/square/okhttp implementation 'com.squareup.okhttp3:okhttp:3.10.0' implementation 'com.squareup.okhttp3:logging-interceptor:3.9.0' // https://github.com/square/retrofit implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' implementation 'com.squareup.retrofit2:converter-scalars:2.3.0' // https://github.com/ReactiveX/RxAndroid implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' implementation 'io.reactivex.rxjava2:rxjava:2.1.7' }
@Toqeer12 Appears that your issue is off-topic to this issue. Either:
please need solve
Duplicate class android.support.v4.app.INotificationSideChannel found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.IResultReceiver found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.ResultReceiver found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.ResultReceiver$1 found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1) Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules classes.jar (androidx.core:core:1.0.0-rc01) and classes.jar (com.android.support:support-compat:28.0.0-alpha1)
Migrate your project to Androidx
first go to 'Refactor' option -> then go to 'Migrate to Androidx' (click it)
I did migrate to Androidx, but issue is same no improvement. My build.gradle(app)
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation files('libs/mysql-connector-java-5.0.8-bin.jar') implementation files('libs/activation.jar') implementation files('libs/additionnal.jar') implementation files('libs/mail.jar')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.gms:google-services:4.3.3'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.42.0'
implementation 'com.paypal.sdk:paypal-android-sdk:2.14.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
sorry?
On Wed, 22 Apr 2020 at 04:49, Awadhesh Maurya notifications@github.com wrote:
I did migrate to Androidx, but issue is same no improvement. My build.gradle(app)
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation files('libs/mysql-connector-java-5.0.8-bin.jar') implementation files('libs/activation.jar') implementation files('libs/additionnal.jar') implementation files('libs/mail.jar')
implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.gms:google-services:4.3.3' implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android.gms:play-services-auth:18.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.42.0' implementation 'com.paypal.sdk:paypal-android-sdk:2.14.2'
testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/material-components/material-components-android/issues/93#issuecomment-617728891, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALFKXCIMRL3Y2Y3VD3BIHU3RN3KU5ANCNFSM4E6OGIEQ .
I followed the guide on page : https://github.com/material-components/material-components-android/blob/master/docs/getting-started.md but I can't import the library because gradle give me this error:
I'm doing something wrong or is there a problem with the repository?