material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.37k stars 3.07k forks source link

Could not find com.google.android.material:material:1.0.0-alpha1. #93

Closed alevittoria closed 6 years ago

alevittoria commented 6 years ago

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:

Could not find com.google.android.material:material:1.0.0-alpha1.
Searched in the following locations:
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/google/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    file:/C:/Users/alevittoria/AppData/Local/Android/sdk/extras/android/m2repository/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://dl.google.com/dl/android/maven2/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://jcenter.bintray.com/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://jcenter.bintray.com/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://maven.fabric.io/public/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://maven.fabric.io/public/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://dl.bintray.com/drummer-aidan/maven/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://dl.bintray.com/drummer-aidan/maven/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://maven.google.com/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://maven.google.com/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
    https://jitpack.io/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.pom
    https://jitpack.io/com/google/android/material/material/1.0.0-alpha1/material-1.0.0-alpha1.jar
Required by:
    project :app

I'm doing something wrong or is there a problem with the repository?

KirillJJ commented 6 years ago

I have the same issue

dsn5ft commented 6 years ago

Hi @alevittoria, can you try using com.android.support:design:28.0.0-alpha1 for now? Will update the docs soon.

Dwite commented 6 years ago

@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)}
dsn5ft commented 6 years ago

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.

EdricChan03 commented 6 years ago

Will this issue be closed? It's already in Google's Maven repository: https://maven.google.com

ghost commented 6 years ago

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

Dwite commented 6 years ago

@dsn5ft so it's not possible to use material components in production yet? Because of android-P target SDK?

cutiko commented 6 years ago

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?

ghost commented 6 years ago

@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

https://dl.google.com/dl/android/maven2/index.html

https://developer.android.com/studio/preview/features/

houdangui1985 commented 6 years ago

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!

houdangui1985 commented 6 years ago

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'

}

marcoscgdev commented 6 years ago

@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

dsn5ft commented 6 years ago

@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'
}
cutiko commented 6 years ago

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.

houdangui1985 commented 6 years ago

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?

EdricChan03 commented 6 years ago

@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?

cutiko commented 6 years ago

@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.

  1. git clone https://github.com/material-components/material-components-android.git
  2. Open the full downloaded directory from Android Studio
  3. In the play button use to run the app make sure to select catalog and run it
  4. Select or create an appropriate emulator

Maybe there are other ways to try the catalog, but this worked for me.

dsn5ft commented 6 years ago

@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.

houdangui1985 commented 6 years ago

@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

dsn5ft commented 6 years ago

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.

Toqeer12 commented 5 years ago

Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy

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' }

EdricChan03 commented 5 years ago

@Toqeer12 Appears that your issue is off-topic to this issue. Either:

MasterSami1985 commented 5 years ago

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)

saptarshi-18-15-25 commented 5 years ago

Migrate your project to Androidx

first go to 'Refactor' option -> then go to 'Migrate to Androidx' (click it)

awadhesh39 commented 4 years ago

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'
saptarshi-18-15-25 commented 4 years ago

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 .