I developed a project in android studio, but after a moment it does not execute the application, it opens and closes immediately.
I had a problem with the google play services library, can not access zzbfm play services maps
I have reviewed the gradle, the manifest but I can not find the error.
new :I have noticed that the application is running, I must press android studio
stop.
This is my gradle app
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
//buildToolsVersion '25.0.2'
buildToolsVersion '26.0.2'
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.cspm.ventas6.cspm"
minSdkVersion 22
targetSdkVersion 26
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'
}
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com" }
google()
}
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:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:support-v4:26.1.0'
compile 'com.google.android.gms:play-services:11.0.1'
compile 'com.github.safetysystemtechnology:location-tracker-background:v1.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
testCompile 'junit:junit:4.12'
}
Related
I am trying to import some libraries like Picasso, etc. but Android Studio shows up with this message.
here is the build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.mypc.urumcafe"
minSdkVersion 17
targetSdkVersion 25
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:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.volley:volley:1.0.0'
compile 'com.amitshekhar.android:android-networking:1.0.1'
compile 'com.android.support:design:25.3.1'
testCompile 'junit:junit:4.12'
}
I just want to import 'com.amitshekhar.android:android-networking:1.0.1'but as you can see in the uploaded image there is "failed to resolve" error.
so how can I fix this? the same story is for Picasso lib.
Thank you.
Update your build tools version to 27.0.3 and corresponding dependencies to sdk version 27.
here is the updated build.gradle and it is working perfectly.
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.example.mypc.urumcafe"
minSdkVersion 17
targetSdkVersion 27
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.1.1'
compile 'com.android.support.constraint:constraint-layout:2.+'
compile 'com.android.volley:volley:1.0.0'
compile 'com.amitshekhar.android:android-networking:1.0.1'
compile 'com.android.support:design:27.1.1'
testCompile 'junit:junit:4.12'
}
The newest version of the library is 1.0.2.
Use this and try again:
com.amitshekhar.android:android-networking:1.0.2
you might be lacking the Maven Central (or the jitpack.io for v1.0.2) repository:
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
Just installed Android Studio for the first time on this new machine and was trying to import a project that used to work without any errors a year ago on another machine.
Had to fix plenty of errors by just downloading and installing updates (recommendations).
The one error that's left is in the title.
This is my build.gradle source:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
repositories {
mavenCentral()
}
defaultConfig {
applicationId "com.test.testaa"
vectorDrawables.useSupportLibrary = true
minSdkVersion 19
targetSdkVersion 24
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.facebook.android:facebook-android-sdk:4.+'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.2.0'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
testCompile 'junit:junit:4.12'
}
Phone verification in my android application is not working. when i am adding AuthUI.PHONE_VERIFICATION_PROVIDER, the editor showing that cannot resolve symbol. Other verification method like Google or email are working fine.
Here is the screen-shot for this:
Here is Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.nishant.kitchenbook"
minSdkVersion 21
targetSdkVersion 23
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:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.firebaseui:firebase-ui-auth:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Upgrade your firebaseui version to the latest. Change compile 'com.firebaseui:firebase-ui-auth:1.0.1' to compile 'com.firebaseui:firebase-ui-auth:2.1.1'
This occurred after I upgraded my android studio. I've attempted all similar answers on stack overflow, and a few other obscure forums, but I'm not getting anywhere with this error and I've been at it for 6 hours. I've monkeyed around with the sdk tools manager as well, but I'm not getting anywhere. Oh, and that maven thing is new, tried it from a similar answer.
Here is my gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.loredylore.lorebuilder"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0-alpha1'
compile 'com.android.support:support-vector-drawable:26.0.0-alpha1'
compile 'com.android.support:recyclerview-v7:26.0.0-alpha1'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-crash:11.0.2'
compile 'com.google.firebase:firebase-storage:11.0.2'
compile 'com.android.support:support-annotations:26.0.0-alpha1'
//new
testCompile 'junit:junit:4.12'
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
use version 25.0.3, you may have to recast some views to text views when if you have to migrate backward from version 26 android to 25.
I take a reference on official website https://developer.chrome.com/multidevice/android/customtabs
They gradle like this :compile 'com.android.support:customtabs:23.3.0'
My project had used a lots of compile gradle that the sdk is 25 , i don't want to change it.
Is anyone to compile gragdle Custom Tabs when sdk is 25 ? Thanks in advance.
Here is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.my.myapp"
minSdkVersion 15
targetSdkVersion 25
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.crashlytics.sdk.android:crashlytics:2.6.6#aar') {
transitive = true;
}
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile 'com.android.support:appcompat-v7:25.1.1'//i don't want to change it.
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.github.PhilJay:MPAndroidChart:v3.0.1'
compile 'com.android.support:cardview-v7:25.1.1'
compile 'com.android.support:customtabs:23.3.0'//is this with verson 25 ?
testCompile 'junit:junit:4.12'
}
apply plugin: 'io.fabric'
You should use
dependencies {
...
compile 'com.android.support:customtabs:25.1.0' //25.2.0 has been published
}
Advantages
Customizing the UI and interaction with the custom tabs.
Making the page load faster, and keeping the application alive.
Read Chrome Custom Tabs