Parse, ParseFacebookUtils ProGuard exceptions - facebook

I am trying to apply proguard on app based on parse. And tried all sort of permutation combination but here and there I am not able to achive. If someone to help me make my code standardized and help me remove any redundancy.
This is my app(gradle)
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 24
versionCode 27
versionName "1.2.27"
}
productFlavors {
// Define separate dev and prod product flavors.
dev {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
multiDexEnabled true
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion 19
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.properties'
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
/*
compile 'com.parse:parsefacebookutils-v4-android:1.10.4#aar'
compile 'com.parse:parsefacebookutils-v4-android:1.10.3#aar'
compile files('libs/ParseFacebookUtilsV4-1.10.1.jar')
*/
/*
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
*/
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
/*compile fileTree(include: 'Parse-*.jar', dir: 'libs')*/
/*compile files('libs/volley.jar')*/
compile files('libs/pgsdk.jar')
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
/* compile 'com.parse.bolts:bolts-android:1.2.1'*/
compile 'com.parse:parse-android:1.13.1'
compile('com.facebook.android:facebook-android-sdk:4.8.2') {
exclude module: 'bolts-android'
exclude module: 'support-v4'
}
compile ('com.parse:parsefacebookutils-v4-android:1.10.4#aar'){
transitive=true
}
compile 'com.parse:parsetwitterutils-android:1.10.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v13:24.0.0'
compile 'com.google.android.gms:play-services-location:9.8.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.google.android.gms:play-services-ads:9.8.0'
compile 'com.google.android.gms:play-services-identity:9.8.0'
compile 'com.google.android.gms:play-services-gcm:9.8.0'
compile 'com.google.android.gms:play-services-plus:9.8.0'
compile 'com.google.android.gms:play-services-auth:9.8.0'
compile 'com.google.android.gms:play-services-places:9.8.0'
compile 'com.google.code.gson:gson:2.6.2'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
}
compile 'com.mcxiaoke.volley:library:1.0.19'
}
apply plugin: 'com.google.gms.google-services'
}
Here is my progaurd-rules.pro
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/android/Android/Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#common
-dontobfuscate
#-dontoptimize
# attributes
-keepattributes InnerClasses, Signature, *Annotation*, Exceptions
#Current Project packages
-keep class com.example.**{*;}
-keep interface com.example.**{*;}
#Paytm
-keep class com.paytm.**{*;}
# java
-dontwarn javax.naming.**
-dontwarn java.lang.invoke**
-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
#retrofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
# gson
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
# otto
-keepclassmembers class ** {
#com.squareup.otto.Subscribe public *;
#com.squareup.otto.Produce public *;
}
# google play services
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
#appengine
-keep class com.google.appengine.api.urlfetch.**{*;}
-keep interface com.google.appengine.api.urlfetch.**{*;}
-dontwarn com.google.appengine.api.**
#DOM
-keep class org.w3c.dom.bootstrap.DOMImplementationRegistry{*;}
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
#joda
-keep class org.joda.convert.**{*;}
-keep interface org.joda.convert.**{*;}
-dontwarn org.joda.convert.**
# support
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
# Keep source file names, line numbers, and Parse class/method names for easier debugging
-keepattributes SourceFile,LineNumberTable
-keepnames class com.parse.** { *; }
-keep class com.parse.** { *; }
# Required for Parse
-dontwarn com.squareup.**
-dontwarn okio.**
-dontwarn com.parse.**
-keepnames class com.fasterxml.jackson.** { *; }
#-keep class com.shaded.fasterxml.jackson.** { *; }
-keep class com.fasterxml.jackson.databind.ObjectMapper {
public <methods>;
protected <methods>;
}
-keep class com.fasterxml.jackson.databind.ObjectWriter {
public ** writeValueAsString(**);
}
#piccaso
#-keep class com.squareup.picasso.**{*;}
#-keep interface com.squareup.picasso.**{*;}
-keep class org.apache.** { *; }
-dontwarn org.apache.**
-dontwarn android.net.SSLCertificateSocketFactory
-dontwarn android.app.Notification
-keepnames class javax.servlet.** { *; }
-keepnames class org.ietf.jgss.** { *; }
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
There are so many solutions scattered. I find most conflicts between bolt library.
I am not using Parse_abc.jar any more.

Use the Fabric lib for use facebook functionality and also define it to your progaurd-rules.pro

Here is how solved it
There was duplicate entry for bolt-android nested inside various library. I just excluded them from app.gradle. Also updated all library versions and buildToolVersions to 25.0.0
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example"
minSdkVersion 15
targetSdkVersion 25
versionCode 27
versionName "1.2.27"
}
productFlavors {
// Define separate dev and prod product flavors.
dev {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
multiDexEnabled true
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion 19
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.properties'
exclude 'META-INF/maven/com.squareup.picasso/picasso/pom.xml'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
//compile fileTree(include: ['*.jar'], dir: 'libs')
/*compile fileTree(include: 'Parse-*.jar', dir: 'libs')*/
/*compile files('libs/volley.jar')*/
compile files('libs/pgsdk.jar')
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
//compile 'com.parse.bolts:bolts-android:1.2.1'
compile ('com.parse:parse-android:1.13.1'){
exclude module: 'bolts-android'
}
compile('com.facebook.android:facebook-android-sdk:4.8.2') {
exclude module: 'bolts-android'
exclude module: 'support-v4'
}
compile('com.parse:parsefacebookutils-v4-android:1.10.4#aar') {
transitive = true
exclude module: 'bolts-android'
}
compile 'com.parse:parsetwitterutils-android:1.10.5'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:support-v13:25.1.0'
compile 'com.google.android.gms:play-services-location:10.0.1'
//compile 'com.google.android.gms:play-services-appindexing:10.0.1'
compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.android.support:support-v4:25.1.0'
compile 'com.google.android.gms:play-services-ads:10.0.1'
compile 'com.google.android.gms:play-services-identity:10.0.1'
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-plus:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.code.gson:gson:2.6.2'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
exclude module: 'bolts-android'
exclude module: 'support-v4'
}
compile 'com.mcxiaoke.volley:library:1.0.19'
}
apply plugin: 'com.google.gms.google-services'
And this is my final proguard-rules.pro
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/android/Android/Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#common
-dontobfuscate
#-dontoptimize
# attributes
-keepattributes InnerClasses, *Annotation*
#Current Project packages
-keep class com.example.**{*;}
-keep interface com.example.**{*;}
#Paytm
-keep class com.paytm.**{*;}
# java
-dontwarn javax.naming.**
-dontwarn java.lang.invoke**
-dontwarn java.nio.file.Files
-dontwarn java.nio.file.Path
-dontwarn java.nio.file.OpenOption
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
#retrofit
# Platform calls Class.forName on types which do not exist on Android to determine platform.
-dontnote retrofit2.Platform
# Platform used when running on RoboVM on iOS. Will not be used at runtime.
-dontnote retrofit2.Platform$IOS$MainThreadExecutor
# Platform used when running on Java 8 VMs. Will not be used at runtime.
-dontwarn retrofit2.Platform$Java8
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
# gson
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
# otto
-keepclassmembers class ** {
#com.squareup.otto.Subscribe public *;
#com.squareup.otto.Produce public *;
}
# google play services
-keep public class com.google.android.gms.* { public *; }
-dontwarn com.google.android.gms.**
#appengine
-keep class com.google.appengine.api.urlfetch.**{*;}
-keep interface com.google.appengine.api.urlfetch.**{*;}
-dontwarn com.google.appengine.api.**
#DOM
-keep class org.w3c.dom.bootstrap.DOMImplementationRegistry{*;}
-dontwarn org.w3c.dom.bootstrap.DOMImplementationRegistry
#joda
-keep class org.joda.convert.**{*;}
-keep interface org.joda.convert.**{*;}
-dontwarn org.joda.convert.**
# support
-dontwarn android.support.v7.**
-keep class android.support.v7.** { *; }
-keep interface android.support.v7.** { *; }
# Keep source file names, line numbers, and Parse class/method names for easier debugging
-keepattributes SourceFile,LineNumberTable
-keepnames class com.parse.** { *; }
-keep class com.parse.** { *; }
-dontwarn com.parse.ParseOkHttpClient**
# Required for Parse
-keep class com.squareup.** { *; }
-dontwarn com.squareup.**
-dontwarn okio.**
-dontwarn android.net.SSLCertificateSocketFactory
-dontwarn android.app.Notification
-keep class org.apache.http.** { *; }
-keep interface org.apache.http.** { *; }
-dontwarn org.apache.http.**
-keep class javax.servlet.** { *; }
-keep class org.ietf.jgss.** { *; }
#crashlytics fabric
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
Though I have no complete understanding and wont be able to explain you in a consolidated way. But Google and my permutation combination have yield me this result. I am still testing app for any crash. In that case I will update this answer too.

Related

Gradle-Scala Project Error - Could not load Main Class

I have created a gradle/scala project in intellij.
This is my project structure
build
gradle
- wrapper
META-INF
out
src
- main
-resources
-scala
- test
-resources
-scala
build.gradle
gradlew
gradlew.bat
settings.gradle
These are the contents of my build.gradle file
plugins {
id 'scala'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenLocal()
maven {
url = uri('<artifactory location>')
}
}
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'org.example.Hello'
)
}
}
sourceCompatibility = '12'
dependencies {
implementation 'org.scala-lang:scala-library:2.12.14'
testImplementation 'org.scalatest:scalatest_2.12:3.0.5'
testRuntimeOnly 'org.scala-lang.modules:scala-xml_2.12:1.1.1'
}
test {
useJUnitPlatform()
}
Main Class Content
package org.example
object Hello extends App {
println("hello!")
}
When I try to build the jar and execute it , it gives an error
Could not find or load main class org.example.Hello . What might be the mistake here?
I was able to resolve the issue by adding the following in the settings.gradle
rootProject.name = 'gradle-scala'
include('gradle-scala')
Basically , the include tag is used to specify the directory where the code resides .
I see out directory, can you check the gradle settings
ensure below are ticked

How to sign an Android application for publishing on playstore

when I try to publish my unity games on google developer, I always have this error:
Failed to import. You have imported an APK or Android App Bundle that
can be debugged. For security reasons, you must disable debugging
before the applicable APK or Android App Bundle can be published on
Google Play. Learn more about APKs or Android Bundle Bundle packages
for which the Debug feature has been enabled.
You have imported an APK or an Android App Bundle with a signature in debug mode. You must sign it in output version mode. Learn more about the signature.
I think there are something in maintemplate.gradle to change:
this is my mainTemplate:
// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
flatDir {
dirs 'libs'
}
}
}
apply plugin: 'com.android.application'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
**DEPS**}
android {
compileSdkVersion **APIVERSION**
buildToolsVersion '**BUILDTOOLS**'
defaultConfig {
targetSdkVersion **TARGETSDKVERSION**
applicationId '**APPLICATIONID**'
}
lintOptions {
abortOnError false
}
aaptOptions {
noCompress '.unity3d', '.ress', '.resource', '.obb'
}
**SIGN**
buildTypes {
release {
// Set minifyEnabled to true if you want to run ProGuard on your project
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debbugable false
**SIGNCONFIG**
signingConfig signingConfigs.firstapp
}
}
}
Just make sure your settings are like this -

Shrinking Scala with ProGuard

to make it short: I am unable to shrink my more complex scala programs with Proguard. I think I am overlooking something, but currently I have no Idea what it could be.
My Current setup relys upon a build.gradle-file to shrink my compiled fat-jar.
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:5.2.1'
}
}
plugins {
id 'application'
id 'java'
id 'scala'
}
mainClassName = 'app.Main'
sourceCompatibility = 1.8
repositories {
...
}
dependencies {
...
}
jar {
manifest {
attributes(
'Class-Path': configurations.compileClasspath.files.collect {"$it.name"}.join(' '),
'Main-Class': 'app.Main'
)
}
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task proguarding(type: ProGuardTask, dependsOn: jar) {
configuration 'proguard-rules.pro'
libraryjars files(configurations.compileClasspath.collect { it })
injars "$buildDir/libs/Main.jar"
outjars "$buildDir/libs/Shrunk.jar"
}
These are my proguard rules inside the proguard-rules.pro file
-keep class testing.** { *; }
-dontoptimize
-dontobfuscate
#-dontpreverify
#-dontnote
-ignorewarnings
-forceprocessing
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-dontwarn scala.**
-keep class !scala*.** { *; }
-dontwarn **$$anonfun$*
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-keep class ... # imagine like 5-thousend different keep-rules I tried
-keepclassmembers class * {
** MODULE$;
}
All the Programs/ Libs I tried to shrink so far didn't work after the shrinking.
Except for the most basic scala program:
package main
import java.io._
object Main extends App {
val pw = new PrintWriter(new File("hello.txt" ))
pw.write("Hello, world")
pw.close()
}
This one I could shrink from 5.5mb to 432kb, but everything else won't work and instead throws me run time errors like NullPointerExceptions or something about the stackmap.
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 14
Exception Details:
Location:
generator/Main$.parameters()Lscalafx/application/JFXApp$Parameters; #4: ifne
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 2ab4 0010 9a00 0a2a b700 1ca7 0007 2ab4
0x0000010: 0011 b0
at generator.Main.main(Main.scala)
I found out, that these problems arose through the dontpreverify-option, but If I don't use "-dontpreverify", it won't even compile.
Without that option ProGuard is not able to find superclasses (just like this guy)
So I tried every keep-option I could find.
None of the solutions I found helped in any way. If anybody knows what's wrong, please help I am at the end of my nerves.
If somebody knows another shrinker for jar files that is actually easy to use, please tell me.
Btw, The GUI was even more confusing than the gradle plugin so, I ditched that approach
The mistake I made, was not to include the java runtime jar from the jdk
Here is the gradle with the proguarding task
import proguard.gradle.ProGuardTask
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'net.sf.proguard:proguard-gradle:6.0.3'
}
}
plugins { ... }
version '1.0'
mainClassName = 'app.Main'
sourceCompatibility = 1.8
repositories { ... }
dependencies { ... }
jar {
manifest {
attributes(
'Class-Path': configurations.compileClasspath.files.collect {"$it.name"}.join(' '),
'Main-Class': 'app.Main'
)
}
from {
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
task proguarding(type: ProGuardTask, dependsOn: jar) {
configuration 'proguard-rules.pro'
libraryjars files(configurations.compileClasspath.collect { it })
injars "$buildDir\\libs\\" + project.name + "-" + version + ".jar"
outjars "$buildDir\\libs\\" + project.name + "-" + version + "_shrunk" + ".jar"
}
And here are the pro-guard rules inside proguard-rules.pro
-keep class app.** { *; }
#-dontoptimize
-dontobfuscate
#-dontnote
#-dontusemixedcaseclassnames
-ignorewarnings
-forceprocessing
-libraryjars C:/Program Files/Java/jdk1.8.0_181/jre/lib/rt.jar
-libraryjars C:/Program Files/Java/jdk1.8.0_181/jre/lib/ext/jfxrt.jar
Now I don't get any warnings and everything compiles just fine.

Android studio Failed to resolve Facebook SDK

I have an issue in Android studio related to Facebook SDK and it's as below :
The build.gradle file (Project) looks like this :
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
url 'https://maven.google.com'
}
}
}
The build.gradle file (Module:app) looks like this :
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 27
versionCode 5
versionName "1.4"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
debug {
//minifyEnabled true
//proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile 'com.facebook.android:account-kit-sdk:4.+'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.google.android.gms:play-services-gcm:11.0.1'
}
Repositories are well added but i can't figure out the issue.
Many thanks.

Android Log in with Twitter

I'm trying to integrate twitter login in my application, however not able to succeed yet.
https://dev.twitter.com/twitter-kit/android/twitter-login
In the above link it asks us to install Twitter Core library
dependencies {
compile('com.twitter.sdk.android:twitter-core:1.3.1#aar') {
transitive = true;
}
}
However, this library isn't being downloaded. I always throws an error
Failed to resolve: com.twitter.sdk.android:twitter-core:1.3.1
What should i do?
I have just solved your problem using the next instructions:
Inside your build.gradle (general):
your build script must be like this:
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
2.Your build.gradle (app) must be like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.yourappname"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile('com.twitter.sdk.android:twitter:1.5.1#aar') {
transitive = true
}
}
If you have any question, try to take a look this link:
https://github.com/twitter/twitter-kit-android
It works for me! Hope it helps!