I know GeoDataClient can be import by adding 'com.google.android.gms:play-services-places' in build.gradle.
But Google say "'com.google.android.gms:play-services-places'is deprecated".
So we have to use 'com.google.android.libraries.places:places:1.1.0'.
By the way 'com.google.android.libraries.places:places:1.1.0' doesn't contain GeoDataClient and PlaceDetectionClient.
How could I resolve those two objects?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.fuckingtest"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.libraries.places:places:1.1.0'
}
add to dependencies in build.gradle
implementation 'com.google.android.libraries.places:places-compat:1.1.0'
instead of
implementation 'com.google.android.libraries.places:places:1.1.0'
Related
My Android project has error while producing signed APK as below.
File 'root/res/drawable-mdpi/popup_bottom_medium.9.png' uses reserved file or directory name 'res'.ere
It didn't appear when I make APK without sining.
I found popup_bottom_medium is in android sdk (android-28) but I dont know why the error is happening on this specific file.
Please kindly help us
let me put build.gradle in our code. Actually in this project, we using two self-made library. so totally we have three build.gradle.
build.gradle for app itself
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "xxx.xxx.xxx"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "0.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
implementation project(path: ':mylibrary')
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.parse.bolts:bolts-tasks:1.4.0'
implementation 'com.parse.bolts:bolts-applinks:1.4.0'
implementation project(path: ':ERSDKLogin')
implementation 'com.github.bumptech.glide:glide:4.4.0'
//noinspection GradleCompatible
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// Measures against compile errors that occur when adding「'com.google.android.gms:play-services-maps:16.0.0' 」
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:animated-vector-drawable:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
//graphLibrary
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
build.gradle for library one
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// TODO Remove and fix lint issues
lintOptions {
abortOnError false
}
}
dependencies {
api project(':aws-android-sdk-core')
api project(':aws-android-sdk-cognitoidentityprovider')
api project(':facebook-common')
api project(':facebook-core')
api project(':facebook-login')
api 'com.google.android.gms:play-services-auth:16.0.1'
api 'com.squareup.retrofit2:retrofit:2.4.0'
api 'com.squareup.retrofit2:converter-jackson:2.4.0'
api 'com.fasterxml.jackson.core:jackson-databind:2.9.5'
api 'com.squareup.okhttp3:logging-interceptor:3.10.0'
compileOnly 'org.projectlombok:lombok:1.16.22'
annotationProcessor 'org.projectlombok:lombok:1.16.22'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.android.support:appcompat-v7:${project.ext.supportLibraryVersion}"
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
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'
}
repositories {
flatDir{
dirs 'libs'
}
}
build.gradle for library two
apply plugin: 'com.android.library'
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation project(':ERSDKLogin')
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'no.nordicsemi.android.support.v18:scanner:1.0.0'
implementation 'no.nordicsemi.android:dfu:1.6.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.parse.bolts:bolts-tasks:1.4.0'
implementation 'com.parse.bolts:bolts-applinks:1.4.0'
implementation 'com.google.android.gms:play-services-fitness:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
}
I put my 9-patch files in the drawable folder, not the drawable-mdpi etc... folders. Try that and see if it helps.
file name change. eg popup_bottom_medium_9.png
I'm working on an App in Android Studio, past 10 minutes I ran it and it works, but now I got this. I got and error at
implementation 'com.android.support:appcompact-v7:28.0.0'
Can you please tell me what should I modify?
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.quizonwheels.quizonwheels"
minSdkVersion 21
targetSdkVersion 28
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'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.volley:volley:1.1.0'
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'
implementation 'com.github.ViksaaSkool:AwesomeSplash:v1.0.0'
}
The AwesomeSplash library is using v23 of the support library.
Change the implementation to:
implementation ('com.github.ViksaaSkool:AwesomeSplash:v1.0.0') {
exclude group: "com.android.support"
}
I'm trying to set up my SettingsFragment but
import PreferenceFragmentCompat hasn't been working.
Is there a way of doing this with AndroidX?
Dependency
implementation 'androidx.preference:preference:1.0.0-rc02'
Gradle flie
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.idealorb.payrollapp"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
android.defaultConfig.vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0-rc02'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.0.0-rc02'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-rc02'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0-rc01'
implementation 'android.arch.navigation:navigation-fragment:1.0.0-alpha05'
implementation 'android.arch.navigation:navigation-ui:1.0.0-alpha05'
implementation 'androidx.preference:preference:1.0.0-rc02'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
}
compileSdkVersion 28
You have to set compileSdkVersion to 29 in order to use androidx-namespaced libraries
when i debug my app, i found some module in lib core android (such as Activity.java,ActivityThread.java, Handler.java, Looper.java) cannot resolved. I had update sdk, but it still error. Please guide me how to fix it. Thanks very much.
Some module in lib file android cannot resolve
My sdk update
My build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.example.huyma.testmap"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:mediarouter-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:multidex:1.0.3'
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'
}
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.mansi.mymini"
minSdkVersion 18
targetSdkVersion 26
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'])
compile 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-firestore:11.8.0'
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'
implementation 'de.hdodenhof:circleimageview:2.2.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
}
facing problem at compile 'com.android.support:appcompat-v7:27.1.1'
Change compileSdkVersion to 27.
Always "com.android.support" dependency must have the same version as compileSdkVersion.. that is implementation 'com.android.support:appcompat-v7:27.1.1' & compileSdkVersion 27 in your case