Adding AdMob to my Android app drives me mad :o
Firebase is already running (auth, db, ...).
I added gradle dependency for ads too.
I followed Google instructions exactly.
I have two issues:
The AdView Container in my xml layout file cannot be rendered in the preview. It says:
The following classes could not be instantiated: com.google.android.gms.ads.AdView
Exception Details java.lang.NoClassDefFoundError: Could not initialize class com.google.android.gms.internal.zzeh at com.google.android.gms.internal.zzez. at com.google.android.gms.internal.zzez. at com.google.android.gms.internal.zzez. at com.google.android.gms.ads.BaseAdView. at com.google.android.gms.ads.AdView. at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
If I try to initialize ads in my code, it crashes in this code-line:
MobileAds.initialize(getApplicationContext(), "ca-app-pub-XXXXXXXXXXXXXXXXX");
E/UncaughtException: java.lang.InstantiationError: com.google.android.gms.internal.zznv
at com.google.android.gms.internal.zzeh.(Unknown Source)
at com.google.android.gms.internal.zzeh.(Unknown Source)
at com.google.android.gms.internal.zzfb.zza(Unknown Source)
at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
at com.google.android.gms.ads.MobileAds.initialize(Unknown Source)
at de.philweb.myweightlog.MainActivity.onCreate(MainActivity.java:233)
I tried everything I found on SO. Like MultiDex and adding AdsActivity to manifest, no success. Now I really need your help :(
Thanks guys,
phil
the manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.philweb.myweightlog">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/MyAppTheme">
<activity
android:name=".MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<!-- ATTENTION: This was auto-generated to add Google Play services to your project for App Indexing. See https://g.co/AppIndexing/AndroidStudio for more information.
-->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
this is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "de.philweb.myweightlog"
minSdkVersion 16
targetSdkVersion 22
// multiDexEnabled true
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
// compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.0.1' //22.2.0'
compile 'com.android.support:support-v4:25.0.1' //22.2.0'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
// compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:25.0.1'
compile 'com.firebaseui:firebase-ui:1.0.0'
compile "com.androidplot:androidplot-core:1.4.0"
compile 'com.darwinsys:hirondelle-date4j:1.5.1'
compile('com.mikepenz:materialdrawer:5.8.0#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
The size and number of included libraries requires Multidex. You say you tried to enable it. Note that three steps are required, including a change to the manifest.
Also, when using version 10.0.1 of the Firebase libs, you must use version 1.0.1 of Firebase UI:
compile 'com.firebaseui:firebase-ui:1.0.1'
The Firebase UI docs contains a table of compatible versions.
<uses-permission android:name="android.permission.INTERNET"/>
put this in menifest.
Related
i am new in android and have an app that when build my project have this Error ::
ERROR: Manifest merger failed : Attribute
application#appComponentFactory
value=(androidx.core.app.CoreComponentFactory) from
[androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 is also
present at [com.android.support:support-compat:28.0.0]
AndroidManifest.xml:22:18-91
value=(android.support.v4.app.CoreComponentFactory). Suggestion: add
'tools:replace="android:appComponentFactory"' to element
at AndroidManifest.xml:9:5-44:19 to override.
My Gradle build is ::
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "maa.tic_tac_to"
minSdkVersion 19
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.google.firebase:firebase-messaging:19.0.1'
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
// implementation 'com.android.support:support-v4:28.+'
// implementation ('com.theartofdev.edmodo:android-image-cropper:2.4.+'){
// exclude group: 'com.android.support'
//}
// implementation 'com.google.android.material:material:1.0.0-alpha08'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
// implementation 'com.androidx.constraintlayout.widget:ConstraintLayout:2.0.0-beta2'
testImplementation 'junit:junit:4.12'
}
and manifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="maa.tic_tac_to">
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />
<application
android:allowBackup="true"
android:icon="#drawable/tic_tac_toe"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity"></activity>
<receiver
android:name=".MySMSReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
<activity android:name=".FakeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".LogInActivity"></activity>
<service
android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
i test every solution in stackoverflow and google search but anyone help me.
can anyone help to solve this error ?!?!?!?
You are using
implementation 'com.google.firebase:firebase-messaging:19.0.1'
Firebase migrated to AndroidX in the latest release.
It means that you are using both, support libraries and androidx libraries.
You can:
migrate to androidx as described below
downgrade your firebase dependencies (but it is not a real solution because you have to migrate sooner or later)
You can check the official release notes:
Warning: This release is a MAJOR version update and breaking change.
The latest update to Google Play services and Firebase includes the following changes:
Migration from Android Support Libraries to Jetpack (AndroidX) Libraries. Libraries will not work unless you make the following changes in your app:
Upgrade com.android.tools.build:gradle to v3.2.1 or later.
Upgrade compileSdkVersion to 28 or later.
Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
I have an app that was uploaded to Google Play. The problem is: it does not want to install on some devices, for example a Samsung J7. The other thing is that, I have two same devices (Gionee S Plus), one has Android 7.0 rooted, on which the app is working fine, and the other one is on Android 6.0, but the app does not want to install. When I try to install the app on the second device directly with the apk, I get:
Parse error
There was a problem parsing the package
And when I try to install it from the Store, I get:
Can't install the app
With no other clear message.
After searching for this problem, I found that I needed to do somethings:
Clear Google Play & services data and cache: did not work
Restart phone: did not work
Uninstall Google Play updates: when trying to install with the old version, I get the same error message but this time I got the error message 504. When I searched for this error, I read that I should completely delete all my google accounts, which I did but still the same problem.
I doubted it was the manifest problem, and I decompiled the apk but it looks fine.
Manifest.xml on Android Studio:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<application
android:name="com.myapp.MainApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher"
android:supportsRtl="true"
android:theme="#style/PurpeTheme">
<meta-data
android:name="com.onesignal.NotificationOpened.DEFAULT"
android:value="DISABLE" />
<activity android:name="com.myapp.ActivitySplash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.myapp.ActivityHome" />
<activity android:name="com.myapp.ActivityTrack"/>
<activity android:name="com.myapp.ActivityEqualizer" />
<activity android:name="com.myapp.ActivityAboutUs" />
<activity android:name="com.myapp.ActivitySettings" />
<service android:name="com.myapp.services.ServicePlayer" />
<service android:name="com.myapp.services.DownloadService" />
<activity android:name="com.myapp.ActivityFavorites" />
<activity android:name="com.myapp.ActivityPrivacyPolicy" />
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="#string/admob_app_id" />
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="${crashlyticsEnabled}" />
</application>
</manifest>
build.gradle app level
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'io.objectbox'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.myapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "1.2"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
signingConfig signingConfigs.config
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
manifestPlaceholders = [crashlyticsEnabled: true]
}
debug {
manifestPlaceholders = [crashlyticsEnabled: false]
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha03'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.android.gms:play-services-ads:17.2.0'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'com.sothree.slidinguppanel:library:3.3.0'
implementation 'com.nabinbhandari.android:permissions:3.5'
implementation 'com.orhanobut:dialogplus:1.11#aar'
implementation 'com.diogobernardino:williamchart:2.5.0'
implementation 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:0.7.2'
implementation 'com.sdsmdg.harjot:croller:1.0.7'
implementation 'com.ToxicBakery.viewpager.transforms:view-pager-transforms:1.2.32#aar'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.wang.avi:library:2.1.3'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'jp.wasabeef:glide-transformations:3.3.0'
implementation 'com.codemybrainsout.rating:ratingdialog:1.0.8'
implementation 'com.github.varunest:sparkbutton:1.0.5'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
testImplementation 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
}
apply plugin: 'com.google.gms.google-services'
Update:
I get INSTALL_PARSE_FAILED_MANIFEST_MALFORMED when trying to install the app from Android Studio to some devices. I found the solution, and it detailed in my answer below.
Actually, the problem was in the package name, apparently some devices and some android versions (Android 6.0) does not accept a capital lettre as the beginning of a package name. And by package name I mean your project file structure, not the application id.
Here is what I did get when I tried the app with the emulator, and what did help me find the problem:
I just started to use the MapBox SDK but its not working I was following the steps on the documentation but Im not getting any classes from their SDK here is my code:
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.mapp.hello"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:4.2.0-beta.2#aar'){
transitive=true
}
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.mapp.hello"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/>
</application>
</manifest>
The com.mapbox.mapboxsdk.telemetry.TelemetryService is shown in red and I cannot import the MapboxAccountManager
I know it's an old question, but I just had the same error while trying to update from Mapbox 4.x to 5.x and it turns out you have to change:
<service android:name="com.mapbox.mapboxsdk.telemetry.TelemetryService"/>
to
<service android:name="com.mapbox.services.android.telemetry.service.TelemetryService" />
Update:
Turns out in the latest version (5.x) you don't have to declare it in the Manifest at all, as Mapbox now makes use of Manifest merge feature.
I dont know how but the app was getting run even though gradle build was stopped because of lint, I just stopped lint from stopping the build process now everything is working :)
Android Studio can't start debug my app. It's outputs message
My AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.xxx" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:debuggable="true"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:ignore="HardcodedDebugMode">
<activity android:name="com.xxx.MainContentActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.xxx.ViewerActivity" />
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
My Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxx"
minSdkVersion 14
targetSdkVersion 23
versionCode 2
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.google.android.gms:play-services:8.4.0'
}
I try clean/rebuild gradle project, Restart Android Studio, Invalidate cache, and rebbot ADB Integration (Tools -> Android -> Disable ADB Integration -> Enable ADB Integration)
Any ideas?
P.S. Before this I changed the name of the application package
P.S.{2} Android Studio can't debug other projects.
Do following steps:
Navigate to Tools --> android --> disable adb integration and again enable it
after that unpluged USB from device and again plugged.
Debug again.
checkout this link
hope this helps.
After two days, I found the only way out of my situation.Android Studio debugging only new projects. Therefore it was necessary to remove the old project with the modified package name (code stored), create a new project with the desired package name and restore code. Thank you all for your answers and help.
I am working with Parse SDK in android studio. Every thing was working fine untill i enabled multidex in my project because after adding the maps libraries my project exceeded 64K methods limit. I get following error when i run my app:
java.lang.NoSuchMethodError: com.squareup.okhttp.OkHttpClient.setFollowRedirects
at com.parse.ParseOkHttpClient.<init>(ParseOkHttpClient.java:58)
at com.parse.ParseHttpClient.createClient(ParseHttpClient.java:45)
at com.parse.ParsePlugins$Android.newHttpClient(ParsePlugins.java:175)
at com.parse.ParsePlugins.restClient(ParsePlugins.java:91)
at com.parse.Parse.getEventuallyQueue(Parse.java:615)
at com.parse.Parse.access$800(Parse.java:42)
at com.parse.Parse$1.call(Parse.java:410)
at com.parse.Parse$1.call(Parse.java:407)
at bolts.Task$4.run(Task.java:357)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573)
at java.lang.Thread.run(Thread.java:856)
This is how my gradle file looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.github.clans:fab:1.6.2'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.maps:google-maps-services:0.1.9'
compile 'com.google.maps.android:android-maps-utils:0.4'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:multidex:1.0.1'
compile('com.github.afollestad.material-dialogs:core:0.8.5.1#aar') {
transitive = true
}
compile 'com.parse.bolts:bolts-android:1.4.0'
compile 'com.parse:parse-android:1.13.0'
}
and this is my manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rowburst.traverous.traverous">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="23" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:name="com.example.MyApplication"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/MAPS_API_KEY" />
<activity
android:name="com.example.LaunchingActivity"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoDisplay">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.LoginActivity"
android:theme="#style/Theme.AppCompat.Light.NoActionBar.FullScreen" />
<activity android:name="com.example.MainActivity"></activity>
</application>
And this is my application class:
public class MyApplication extends Application {
#Override
public void onCreate() {
super.onCreate();
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId(Const.APP_ID)
.server(Const.SERVER_URL)
.build());
}
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
}
I think the problem is in Parse.initialize statement in MyApplication class. Because when i debug my app and set a breakpoint on that statement (every thing seems fine before that statement) when the initialize statement is executed my app crashes. I have searched alot and i didnt find any solution to this problem. Please help...
EDIT:
Ok after further research and playing around with gradle dependencies i found out that this error is not because of multiDexEnabled rather it is because of conflict between okhttp library used by Parse and google-maps-services. Google-maps-services use OkHttp:2.0.0 where as Parse, i guess, uses OkHttp:2.4.0. I think OkHttp:2.0.0 has no such method of name setFollowRedirects and it is overriding OkHttp:2.4.0 thats why my app crashes. If i remove the google-maps-services compile statement my app works fine.
Note: If i do compile com.squareup.okhttp:okhttp:2.4.0 the error no more comes up but my parse functions (i.e. Login and Signup callback) give this error com.parse.ParseException:java.lang.IllegalArgumentException: value == null , they no longer work.
When you Initialize Parse pass empty string to client key.
Parse.initialize(new Parse.Configuration.Builder(this)
.applicationId(Const.APP_ID)
.server(Const.SERVER_URL)
.clientKey("")
.build());
Try adding
compile 'com.squareup.okhttp:okhttp:2.4.0'
to your build.gradle file.