Google Maps Crashing (play-services-maps:) - java

I don't know why my Google maps crashing , but when I put this dependency in my gradle it crashes :
compile 'com.google.android.gms:play-services-maps:10.2.0'
This is my Full Gradle Script :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
// generatedDensities = []
applicationId "company.override.huzykamz.policecopuganda"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile 'com.google.maps.android:android-maps-utils:0.5+'
compile 'com.google.android.gms:play-services-maps:10.2.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.android.gms:play-services:9.6.1'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.koushikdutta.ion:ion:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.1'
testCompile 'junit:junit:4.12'
}
This is the Error am getting :
Process: company.override.huzykamz.policecopuganda, PID: 11016
java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/Context;)V in class Lcom/google/android/gms/common/internal/zzaj; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaj' appears in /data/app/company.override.huzykamz.policecopuganda-2/split_lib_dependencies_apk.apk:classes49.dex)
at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1801)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1776)
at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
at android.app.ActivityThread.installProvider(ActivityThread.java:5427)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:5000)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4940)
at android.app.ActivityThread.access$1600(ActivityThread.java:175)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1549)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5728)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)

Related

Get java.lang.ClassNotFoundException error after change targetSdkVersion to 28

Recently, I change the Android project from targetSdkVersion 26 to 28. I got crash report from Google Play with "java.lang.ClassNotFoundException" error
java.lang.NoClassDefFoundError:
at com.google.android.vending.licensing.ServerManagedPolicy.decodeExtras (ServerManagedPolicy.java:266)
at com.google.android.vending.licensing.ServerManagedPolicy.processServerResponse (ServerManagedPolicy.java:113)
at com.google.android.vending.licensing.LicenseValidator.handleResponse (LicenseValidator.java:206)
at com.google.android.vending.licensing.LicenseValidator.verify (LicenseValidator.java:166)
at com.google.android.vending.licensing.LicenseChecker$ResultListener$2.run (LicenseChecker.java:242)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:214)
at android.os.HandlerThread.run (HandlerThread.java:65)
Caused by: java.lang.ClassNotFoundException:
at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:134)
at java.lang.ClassLoader.loadClass (ClassLoader.java:379)
at java.lang.ClassLoader.loadClass (ClassLoader.java:312)
at com.google.android.vending.licensing.ServerManagedPolicy.decodeExtras (ServerManagedPolicy.java:266)
at com.google.android.vending.licensing.ServerManagedPolicy.processServerResponse (ServerManagedPolicy.java:113)
at com.google.android.vending.licensing.LicenseValidator.handleResponse (LicenseValidator.java:206
at com.google.android.vending.licensing.LicenseValidator.verify (LicenseValidator.java:166)
at com.google.android.vending.licensing.LicenseChecker$ResultListener$2.run (LicenseChecker.java:242)
at android.os.Handler.handleCallback (Handler.java:873)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loop (Looper.java:214)
at android.os.HandlerThread.run (HandlerThread.java:65)
I don't know what is going on. Any help will be appreciated
In gradle.build, multiDexEnabled has been added
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapptool"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
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:28.0.0'
compile 'com.android.support:recyclerview-v7:28.0.0'
compile 'com.android.support:design:28.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/achartengine-1.2.0.jar')
compile project(':filemanager')
compile project(':moreapp')
compile files('libs/log4j-1.2.15.jar')
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.1'
}
This seems like multidex related problem. Please enable multidex in gradle.build
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
dependencies {
implementation 'com.android.support:multidex:1.0.0'
}

Failed to resolve: com.android.support: design-v7:25.3.1

This is for my school project. I've got 1 error from my code;
Failed to resolve: com.android.support:design-v7:25.3.1
I've been done these things:
a. Configure my project structure into 25.
b. Added compile 'com.android.support:support-core-utils:25.3.1' on my dependencies gradle.
C. update my another gradle with this code
d. Download Android API 25 on my SDK manager
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
And, I still got that error message.
This is my full code for build.gridle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.lenovo.home"
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(dir: 'libs', include: ['*.jar'])
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:cardview-v7:25.3.1'
compile 'com.android.support:design-v7:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
this is my error message:
Use:
compile 'com.android.support:design:25.3.1'
Instead of
compile 'com.android.support:design-v7:25.3.1'
AS
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.lenovo.home"
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(dir: 'libs', include: ['*.jar'])
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:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}

Error:No such property: defaultConfig for class: java.lang.String

Error:No such property: defaultConfig for class: java.lang.String
I am getting this error as soon as i sync my project but the same project is working fine in other people's computer.
i can not find the problem please help me fix this.
here is the build.gradle
apply plugin: 'com.android.application'
android {
android.defaultConfig.vectorDrawables.setUseSupportLibrary(true)
dexOptions {
javaMaxHeapSize "4g"
preDexLibraries false
}
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.Aven.andromedia"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0"
testInstrumentationRunner"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
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 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.1.0'
compile 'com.android.support:support-vector-drawable:26.1.0'
compile 'devlight.io:navigationtabbar:1.2.5'
compile 'com.android.support:support-v4:26.3.1'
compile 'com.leo.simplearcloader:simplearcloader:1.0.+'
compile 'com.github.jd-alexander:LikeButton:0.2.3'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.7.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2'
compile 'com.jakewharton.timber:timber:3.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.google.android.gms:play-services-auth:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-ads:11.8.0'
compile 'com.github.vivchar:ViewPagerIndicator:v1.0.1'
compile 'com.github.GrenderG:Toasty:1.2.5'
compile 'com.anjlab.android.iab.v3:library:1.0.44'
compile 'com.yayandroid:ParallaxRecyclerView:1.1'
compile 'com.facebook.android:facebook-android-sdk:4.29.0'
compile 'pl.bclogic:pulsator4droid:1.0.3'
compile 'com.jaredrummler:animated-svg-view:1.0.5'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
May I ask which gradle version you are running?
If the error occured after updating to gradle 3.0 you might wanna check out the Gradle 3.0 migration guide for help.
You should remove line android.defaultConfig.vectorDrawables.setUseSupportLibrary(true)

java.lang.NoSuchMethodError: No static method combineMeasuredStates(II)I in class

I have an issue, which I'm not sure about why, still a newbie, please help to assist.
ERROR: java.lang.NoSuchMethodError: No static method
combineMeasuredStates(II)I in class
Landroid/support/v7/widget/ViewUtils; or its super classes
(declaration of 'android.support.v7.widget.ViewUtils' appears in
/data/app/com.example.marvin.test-1/split_lib_dependencies_apk.apk:classes58.dex)
build gradle:
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.example.marvin.test"
minSdkVersion 16
targetSdkVersion 27
multiDexEnabled true
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.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services:11.4.0'
compile 'com.google.firebase:firebase-auth:11.4.0'
testCompile 'junit:junit:4.12'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:exifinterface:25.3.1'
}
apply plugin: 'com.google.gms.google-services'
Use same version of dependencies
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:design:27.0.1'
compile 'com.android.support:exifinterface:27.0.1'

How to compile module package in build gradle?

I'am trying to compile a package folder in build.gradle in android studio .and when I sync error show "Error:(29, 0) Supplied String module notation 'com.google.activities.components.runtime.ListPickerActivity' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.
build gradle :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "store.muha.com.freequranapp"
minSdkVersion 15
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(dir: 'libs', include: ['*.jar'])
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.constraint:constraint-layout:1.0.2'
compile 'com.google.activities.components.runtime.ListPickerActivity'
testCompile 'junit:junit:4.12'
}
any suggestions ?

Categories