FAILURE: Build failed with an exception.
What went wrong:
Project 'app' not found in root project 'MobileBuy'.
getting above error when I build project. but in my android project no app folder then why this Project 'app' not found in root project 'MobileBuy' getting this error.
settings.gradle
include ':sample', ':buy3', ':buy3-pay-support', ':graphql-java-support'
project(':graphql-java-support').projectDir = new File('./libs/graphql_java_gen/support')
build.gradle
buildscript {
dependencies {
classpath dep.androidPlugin
classpath dep.retrolambda
classpath dep.butterknifePlugin
classpath dep.apolloPlugin
}
}
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.jakewharton.butterknife'
apply plugin: 'com.apollographql.android'
android {
compileSdkVersion androidConfig.compileSdkVersion
buildToolsVersion androidConfig.buildToolsVersion
defaultConfig {
applicationId "com.shopify.sample"
minSdkVersion androidConfig.minSdkVersion
targetSdkVersion androidConfig.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
all {
buildConfigField 'okhttp3.logging.HttpLoggingInterceptor.Level', 'OKHTTP_LOG_LEVEL', 'okhttp3.logging.HttpLoggingInterceptor.Level.BODY'
// We pull the shop settings either from the Environment or a file called shop.properties at the root of the project.
// Environment variables will take precedence, we will attempt to read those first.
def shopDomain
def apiKey
def androidPayPublicKey
def androidPayEnvironment
// get the shop setting from the environment if there any
shopDomain = System.getenv("SHOP_DOMAIN")
apiKey = System.getenv("API_KEY")
androidPayPublicKey = System.getenv("ANDROID_PAY_PUBLIC_KEY")
androidPayEnvironment = System.getenv("ANDROID_PAY_ENVIRONMENT")
// pull the store properties from the local file if it exists. Environment variables take precedence
def shopProperties = new Properties();
File shopPropertiesFile = project.file('shop.properties')
if (shopPropertiesFile.exists()) {
shopProperties.load(new FileInputStream(shopPropertiesFile))
shopDomain = shopDomain ?: shopProperties["SHOP_DOMAIN"]
apiKey = apiKey ?: shopProperties["API_KEY"]
androidPayPublicKey = androidPayPublicKey ?: shopProperties["ANDROID_PAY_PUBLIC_KEY"]
androidPayEnvironment = androidPayEnvironment ?: shopProperties["ANDROID_PAY_ENVIRONMENT"]
}
if (!shopDomain) {
shopDomain = ""
}
if (!apiKey) {
apiKey = ""
}
if (!androidPayPublicKey) {
androidPayPublicKey = ""
}
if (!androidPayEnvironment) {
androidPayEnvironment = "com.google.android.gms.wallet.WalletConstants.ENVIRONMENT_SANDBOX"
}
buildConfigField "String", "SHOP_DOMAIN", "\"" + shopDomain.toString() + "\""
buildConfigField "String", "API_KEY", "\"" + apiKey.toString() + "\""
buildConfigField "String", "ANDROID_PAY_PUBLIC_KEY", "\"" + androidPayPublicKey.toString() + "\""
buildConfigField "int", "ANDROID_PAY_ENVIRONMENT", androidPayEnvironment
debuggable = true
minifyEnabled = false
}
}
productFlavors {
shopify {
}
xApollo {
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile dep.androidSupportDesign
compile dep.androidSupportV4
compile dep.androidSupportV7
compile dep.androidSupportAnnotations
compile dep.rxAndroid
compile dep.rxJava
compile dep.timber
compile dep.butterKnife
compile 'com.ss.bannerslider:bannerslider:1.8.0'
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'org.apmem.tools:layouts:1.10#aar'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
annotationProcessor dep.butterKnifeCompiler
compile(dep.fresco) {
exclude group: 'com.android.support'
}
compile dep.constraintLayout
compile dep.rxrelay
compile dep.archRuntime
compile dep.archExt
annotationProcessor dep.arcCompiler
compile project(':buy3-pay-support')
shopifyCompile project(':buy3')
xApolloCompile dep.apolloRuntime
xApolloCompile dep.okhttpLogging
xApolloCompile dep.apolloHttpCache
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.xiaofeng.android:flowlayoutmanager:1.2.3.2'
compile 'com.beloo.widget:ChipsLayoutManager:0.3.7#aar'
}
task downloadApolloSchema(type: DefaultTask, group: "GraphQL", description: "Download GraphQL store front API schema") {
doLast {
println("Downloading GraphQL schema...")
def schemaFile = new File(project.projectDir.absolutePath + '/src/xApollo/graphql/com/shopify/sample/domain/schema.json')
if (schemaFile.exists()) {
schemaFile.delete()
}
new URL('https://app.shopify.com/services/ping/storefront_graphql_schema').withInputStream { i ->
schemaFile.withOutputStream {
it << i
}
}
println("GraphQL schema has been downloaded!")
}
}
apollo {
customTypeMapping['URL'] = "String"
customTypeMapping['HTML'] = "String"
customTypeMapping['Money'] = "java.math.BigDecimal"
nullableValueType = "apolloOptional"
generateAccessors = false
useSemanticNaming = false
}
Related
In my android studio build gradle is failed i dont know how so then i check the log and i saw this error
Error:Could not find method compile() for arguments
[com.android.support:recyclerview-v7:25.3.1] on object of type
org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Please install the Android Support Repository from the Android SDK
Manager. Open Android SDK Manager
then i check it but android support respository is already installed version 47.0.0 i restart android studio but it shows same error how i solve this error from android studio please help me to solve this problem?
I think something is wrong on my build gradle but i cant get it where is wrong or what happens
here is my build gradle sample-------
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven {
url "https://github.com/Blox/blox-android-sdk-releases/raw/master/"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:2.3.0'
ext {
compileSdkVersion = 23
buildToolsVersion = "23.0.2"
minSdkVersion = 14
targetSdkVersion = 23
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
lintAbortOnError = false
// Blox SDK version
ext.qbSdkVersion = '3.3.1'
ext.versionName = '3.3.0'
ext.testRunnerVersion = "0.4.1"
// Dependency versions
playServicesVersion = '10.2.1'
supportV4Version = '23.1.1'
appcompatV7Version = '23.1.1'
recyclerviewV7Version = '23.2.1'
supportAnnotationsVersion = '23.1.1'
designVersion = '23.1.1'
uilVersion = '1.9.0'
glideVersion = '3.6.1'
pullToRefreshVersion = '3.2.3'
stickyListHeaders = '2.7.0'
robotoTextViewVersion = '2.4.3'
stickersVersion = '0.7.3'
crashlyticsVersion = '2.2.2'
}
compile "com.android.support:recyclerview-v7:25.3.1"
compile "com.android.support:recyclerview-v7:27.1.1"
compile "com.android.support:cardview-v7:23.+"
compile "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}"
compile "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}#aar"
compile("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}#aar") {
transitive = true;
}
compile 'com.github.bumptech.glide:glide:3.6.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
// Blox SDK version
qbSdkVersion = '3.3.1'
versionName = '3.4.1'
testRunnerVersion = "0.4.1"
allprojects {
repositories {
maven { url 'http://maven.pipe.com/artifactory/factory' }
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
}`
Android \ build gradle
`apply plugin: 'com.android.application'
android {
// signingConfigs {
// config {
// keyAlias 'abc'
// keyPassword 'abc'
// storeFile file(D:\Users\Lake\Desktop\myap_keystore\myap.jks)
// storePassword 'abc'
// }
// defaultConfig {
// applicationId "abcd.com.myap"
// minSdkVersion 19
// targetSdkVersion 23
// versionCode 1
// versionName "1.0"
// }
// }
compileSdkVersion 25
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "abc.com.myap"
minSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable true
// signingConfig signingConfigs.config
resValue "string", "versionName", "Blox WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
}
// debug {
resValue "string", "versionName", "Blox WebRTC\nBuild version " + defaultConfig.getVersionName()
signingConfig signingConfigs.debug
}
// signingConfig signingConfigs.config
// debuggable true
// }
}
}
def pipeSdkVersion = '0.15.1'
dependencies {
compile "com.blox-android-sdk-videochat-webrtc:$rootProject.qbSdkVersion"
compile(project(":sample-core"))
// online dependencies, from remote repository, aar files
compile fileTree(include: ['*.jar'], dir: 'libs')
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.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-core:9.2.0'
compile 'com.android.support:design:25.3.1'
compile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.android.support:gridlayout-v7:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.android.gms:play-services:11.0.4'
compile 'com.github.apl-devs:intro:v4.2.2'
compile("vc908.stickers:sfactory:$pipeSdkVersion") {
transitive = true;
}
compile("vc908.stickers:gcmintegration:$pipeSdkVersion") {
transitive = true;
}
compile("vc908.stickers:jpushintegration:$pipeSdkVersion") {
transitive = true;
}
compile files('libs/StartAppInApp-3.6.3.jar')
compile 'com.blox:blox-android-sdk-core:2.5.1'
compile('com.blox:blox-android-sdk-chat:2.5.1#aar') {
transitive = true
}
compile "com.blox:blox-android-sdk-chat:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-content:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-customobjects:$rootProject.qbSdkVersion"
compile "com.blox:quickblox-android-sdk-location:$rootProject.qbSdkVersion"
compile ("com.blox:blox-android-sdk-messages:$rootProject.qbSdkVersion" )
compile "com.github.johnkil.android-robototextview:robototextview:${rootProject.robotoTextViewVersion}"
apply plugin: 'com.google.gms.google-services'
}
`
[NOTE:I am using javascript snippets here for showing code properly]
Replace compile with implementation and you should be good.
(compile was recently deprecated and replaced by implementation or api)
You are adding these dependencies to build.gradle(Project)
compile "com.android.support:recyclerview-v7:25.3.1"
compile "com.android.support:recyclerview-v7:27.1.1"
compile "com.android.support:cardview-v7:23.+"
compile "com.android.support:support-annotations:${rootProject.supportAnnotationsVersion}"
compile "com.navercorp.pulltorefresh:library:${rootProject.pullToRefreshVersion}#aar"
compile("com.crashlytics.sdk.android:crashlytics:${rootProject.crashlyticsVersion}#aar") {
transitive = true;
}
compile 'com.github.bumptech.glide:glide:3.6.1'
Instead put dependencies in build.gradle(Module:app) and replace compile with implementation as 'compile' is obsolete and has been replaced with 'implementation'
i changed dependencies with the code:
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Worked for me
After upgrading the Gradle plugin version to 3.0.0 (classpath "com.android.tools.build:gradle:3.0.0") and if I then try to clean or build the project I get this error:
A problem occurred configuring project ':app'.
> Manifest Tasks does not support the manifestOutputFile property any
more, please use the manifestOutputDirectory instead.
For more information, please check
https://developer.android.com/studio/build/gradle-plugin-3-0-0-
migration.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
* Get more help at https://help.gradle.org
I am not using manifestOutputFile anywhere in any of my gradle files. using the --debug and --stacktrace flags did nothing for me. I'm guessing this issue is coming up in one of my dependencies but I have no idea. Also, I am using Kotlin in a lot of classes; I'm not sure if that matters or not. Does anyone know if there is a way to see which library is throwing this error? Or does anyone have any suggestions or insight around this issue when the build.gradle file does not even reference manifestOutputFile?
Here's most of the build.gradle file:
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://plugins.gradle.org/m2/' }
maven { url 'https://maven.google.com'}
}
dependencies {
classpath 'io.fabric.tools:gradle:1.24.4'
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath 'gradle.plugin.com.nobleworks_software.icon-overlay:icon-overlay-plugin:1.2.3'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'io.fabric'
apply plugin: 'checkstyle'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'jacoco-android'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'com.nobleworks_software.icon-overlay'
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
}
ext {
libsSrcDir = new File('${projectDir}/libs')
}
String gpsPropertyName = 'gps'
String gpsPropertyValueAlpha = 'alpha'
String gpsPropertyValueBeta = 'beta'
boolean tangoBuild = false
String tangoPropertyName = 'tango'
String alphaBuildEnding = '20'
String betaBuildEnding = '10'
String productionBuildEnding = '00'
def isBuildForGPS = { ->
return project.hasProperty(gpsPropertyName)
}
def isTangoBuild = { ->
return project.hasProperty(tangoPropertyName)
}
def getBranchName = { ->
try {
def branchOut = new ByteArrayOutputStream()
exec {
commandLine 'git', 'symbolic-ref', '--short', 'HEAD'
standardOutput = branchOut
}
return branchOut.toString().trim()
}
catch (ignored) {
return 'master'
}
}
def getVersionCode = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', '--count', 'HEAD'
standardOutput = stdout
}
// Make the Tango version use '50' as the least sig offset
int tangoOffset = 0
if (tangoBuild) {
tangoOffset = 50
}
if (isBuildForGPS()) {
String channel = project.findProperty(gpsPropertyName)
if (gpsPropertyValueAlpha == channel) {
return Integer.parseInt(stdout.toString().trim() + alphaBuildEnding) + tangoOffset
} else if (gpsPropertyValueBeta == channel) {
return Integer.parseInt(stdout.toString().trim() + betaBuildEnding) + tangoOffset
}
}
return Integer.parseInt(stdout.toString().trim() + productionBuildEnding) + tangoOffset
}
catch (ignored) {
return -1
}
}
def getVersionName = { ->
try {
if (isBuildForGPS()) {
def tag = getLastTaggedVersion()
String channel = project.findProperty(gpsPropertyName)
if (gpsPropertyValueAlpha == channel) {
tag = tag + '-a'
} else if (gpsPropertyValueBeta == channel) {
tag = tag + '-b'
}
return tag
} else {
return getBranchName()
}
}
catch (ignored) {
return 'X.X.X'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "4g"
}
dataBinding {
enabled = true
}
defaultConfig {
versionCode getVersionCode()
versionName getVersionName()
applicationId getApplicationId()
minSdkVersion 16
targetSdkVersion 26
multiDexEnabled = true
multiDexKeepFile file('multidex_keep_file.txt')
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "com.demoapp.demoapp.WayTestRunner"
renderscriptTargetApi 16
renderscriptSupportModeEnabled true
String branchName = getBranchName().toUpperCase()
String iconOverlayText = branchName.toLowerCase()
buildConfigField "String", "LAST_TAGGED_VERSION", "\"${getLastTaggedVersion()}\""
if (branchName == 'DEV') {
iconOverlayText = 'ALPHA'
} else if (branchName.startsWith('RELEASE')) {
iconOverlayText = 'BETA'
}
if (!isBuildForGPS()) {
iconOverlay {
enabled = true
fontSize = 8
textColor = [255, 255, 255, 255]
verticalLinePadding = 2
backgroundOverlayColor = [0, 0, 0, 180]
text = { "$iconOverlayText" }
}
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
flavorDimensions("store", "3d_enabled")
productFlavors {
demoapp {
dimension = "store"
applicationId getApplicationId()
// Dupe required because SearchRecentSuggestionsProvider has no available context in its constructor
buildConfigField "String", "SEARCH_RECENT_AUTHORITY", "\"${applicationId}.WFSearchRecentSuggestionsProvider\""
// And one for the manifest
resValue "string", "SEARCH_RECENT_AUTHORITY", "${applicationId}.WFSearchRecentSuggestionsProvider"
// These need to be defined as string resources so they can be registered in the manifest.
// However in order to access them in tests it's convenient to have them also defined in BuildConfig
String deepLinkScheme = "demoappapp"
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME1", deepLinkScheme
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME2", deepLinkScheme
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME1", "\"${deepLinkScheme}\""
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME2", "\"${deepLinkScheme}\""
if (getBranchName().toUpperCase() == 'MASTER') {
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher",
appRoundIcon: "#mipmap/ic_launcher_round"
]
} else {
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher_dev",
appRoundIcon: "#mipmap/ic_launcher_dev_round"
]
}
}
demoappflavor {
dimension = "store"
applicationId getDemoappflavorApplicationId()
// Dupe required because SearchRecentSuggestionsProvider has no available context in its constructor
buildConfigField "String", "SEARCH_RECENT_AUTHORITY", "\"${applicationId}.WFSearchRecentSuggestionsProvider\""
// And one for the manifest
resValue "string", "SEARCH_RECENT_AUTHORITY", "${applicationId}.WFSearchRecentSuggestionsProvider"
// These need to be defined as string resources so they can be registered in the manifest.
// However in order to access them in tests it's convenient to have them also defined in BuildConfig
String deepLinkScheme1 = "theapp"
String deepLinkScheme2 = "demoappflavorapp"
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME1", deepLinkScheme1
resValue "string", "EXPLICIT_DEEP_LINK_SCHEME2", deepLinkScheme2
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME1", "\"${deepLinkScheme1}\""
buildConfigField "String", "EXPLICIT_DEEP_LINK_SCHEME2", "\"${deepLinkScheme2}\""
manifestPlaceholders = [
appIcon : "#mipmap/ic_launcher",
appRoundIcon: "#mipmap/ic_launcher_round"
]
}
}
android.variantFilter { variant ->
def store = variant.getFlavors().get(0).name
def tango_enabled = variant.getFlavors().get(1).name
// Disable building the tango dimension
if ((store == 'demoappflavor' || !isTangoBuild()) && tango_enabled == "tangoEnabled") {
variant.setIgnore(true)
}
}
buildTypes {
release {
// Commented out to stop a production build crash with OKIO
//minifyEnabled true
// Commented out due to Gradle 2.2.0 issue
//shrinkResources true
ext.enableCrashlytics = true
apply plugin: 'signing'
signingConfig signingConfigs.release
ext.betaDistributionReleaseNotesFilePath = './release-notes.txt'
ext.betaDistributionGroupAliases = 'android-nightly'
buildConfigField 'boolean', 'OVERRIDE_MIN_VERSION', isBuildForGPS() ? 'false' : 'true'
buildConfigField 'boolean', 'ENABLE_APPSEE', isBuildForGPS() ? 'true' : 'false'
}
debug {
// TODO: Uncomment this out to enable code coverage
// testCoverageEnabled true
buildConfigField 'boolean', 'OVERRIDE_MIN_VERSION', isBuildForGPS() ? 'false' : 'true'
buildConfigField 'boolean', 'ENABLE_APPSEE', isBuildForGPS() ? 'true' : 'false'
}
configurations.all {
resolutionStrategy {
force 'com.google.code.findbugs:jsr305:1.3.9'
force 'com.google.guava:guava:21.0'
force "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
force 'com.google.code.gson:gson:2.8.2'
}
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'bin/AndroidManifest.xml'
exclude 'bin/jarlist.cache'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
return 0
}
testOptions {
// Disable animations for UI testing
animationsDisabled = true
unitTests.returnDefaultValues = true
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
}
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
}
configurations {
demoappTangoEnabledCompile
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
maven { url "https://clojars.org/repo/" }
}
}
ext.daggerVersion = '2.11'
ext.playServicesVersion = '11.6.2'
ext.supportLibsVersion = '27.0.1'
ext.robolectricVersion = '3.3.2'
ext.frescoVersion = '1.5.0'
ext.leakCanaryVersion = '1.5.4'
ext.roomVersion ='1.0.0'
ext.butterKnifeVersion ='8.7.0'
ext.espressoVersion ='3.0.1'
ext.gsonVersion ='2.8.2'
ext.mockitoVersion ='2.9.0'
ext.dexmakerVersion ='1.2'
ext.icepickVersion ='3.2.0'
ext.multidexVersion ='1.0.2'
dependencies {
// Compile Project
compile(project(':models'))
// Compile
compile('com.crashlytics.sdk.android:crashlytics:2.7.1#aar') {
transitive = true
}
// GOOGLE LIBS
compile "com.android.support:design:${supportLibsVersion}"
compile "com.android.support:recyclerview-v7:${supportLibsVersion}"
compile "com.android.support:cardview-v7:${supportLibsVersion}"
compile "com.android.support:support-v4:${supportLibsVersion}"
compile "com.android.support:support-v13:${supportLibsVersion}"
compile "com.android.support:percent:${supportLibsVersion}"
compile "com.android.support:support-annotations:${supportLibsVersion}"
compile "com.android.support:appcompat-v7:${supportLibsVersion}"
compile "com.android.support:multidex:${multidexVersion}"
compile "com.google.code.gson:gson:${gsonVersion}"
// FIREBASE AND PLAY SERVICES
compile "com.google.firebase:firebase-messaging:${playServicesVersion}"
compile "com.google.firebase:firebase-appindexing:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-analytics:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-auth:${playServicesVersion}"
//noinspection GradleDependency
compile "com.google.android.gms:play-services-wallet:${playServicesVersion}"
// FLOW LAYOUT FOR CHIPS
compile 'org.apmem.tools:layouts:1.10#aar'
// RxJava and related
compile 'io.reactivex.rxjava2:rxjava:2.1.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile project(':FloatingSearchView')
// RxJava support for Room
compile 'android.arch.persistence.room:rxjava2:1.0.0'
// Testing support
androidTestCompile 'android.arch.core:core-testing:1.1.0'
// Dagger
compile "com.google.dagger:dagger:${daggerVersion}"
compile "com.google.dagger:dagger-android-support:${daggerVersion}"
kapt "com.google.dagger:dagger-compiler:${daggerVersion}"
kapt "com.google.dagger:dagger-android-processor:${daggerVersion}"
compile ("com.facebook.fresco:imagepipeline-okhttp3:${frescoVersion}") {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
compile "com.jakewharton:butterknife:${butterKnifeVersion}"
kapt "com.jakewharton:butterknife-compiler:${butterKnifeVersion}"
compile 'com.android.support.constraint:constraint-layout:1.1.0-beta4'
compile 'com.appsee:appsee-android:2.3.4'
compile 'commons-io:commons-io:2.5'
compile "com.android.support.test:runner:1.0.1"
// ESPRESSO
androidTestCompile "com.android.support:support-v4:${supportLibsVersion}"
androidTestCompile "com.android.support:support-annotations:${supportLibsVersion}"
androidTestCompile "com.android.support:recyclerview-v7:${supportLibsVersion}"
androidTestCompile "com.android.support:design:${supportLibsVersion}"
androidTestCompile "com.android.support:recyclerview-v7:${supportLibsVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-core:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-intents:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-contrib:${espressoVersion}"
androidTestCompile "com.android.support.test.espresso:espresso-web:${espressoVersion}"
androidTestCompile "org.mockito:mockito-core:${mockitoVersion}"
androidTestCompile "com.google.dexmaker:dexmaker:${dexmakerVersion}"
androidTestCompile "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}"
androidTestCompile "com.android.support:multidex:${multidexVersion}"
androidTestCompile "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
androidTestCompile "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
androidTestCompile "com.google.code.gson:gson:${gsonVersion}"
androidTestCompile('com.jakewharton.espresso:okhttp3-idling-resource:1.0.0') {
//Using App Version Instead
exclude group: 'com.squareup.okio', module: 'okio'
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
//WireMock
androidTestCompile( project(":wiremock")) {
//Using Android Version Instead
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
exclude group: 'org.ow2.asm', module: 'asm'
//Using Android Version Instead
exclude group: 'org.json', module: 'json'
exclude group: 'com.google.guava', module: 'guava'
}
androidTestCompile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:${mockitoVersion}"
testCompile 'org.hamcrest:hamcrest-library:1.3'
testCompile "org.robolectric:robolectric:${robolectricVersion}"
testCompile "org.robolectric:shadows-multidex:${robolectricVersion}"
testCompile "org.robolectric:shadows-support-v4:${robolectricVersion}"
testCompile "com.google.code.gson:gson:${gsonVersion}"
testCompile "com.google.dagger:dagger:${daggerVersion}"
testCompile "com.android.support:multidex:${multidexVersion}"
kaptTest "com.google.dagger:dagger-compiler:${daggerVersion}"
// Kotlin mockito
testCompile ("com.nhaarman:mockito-kotlin-kt1.1:1.5.0"){
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-reflect'
}
compile "frankiesardo:icepick:${icepickVersion}"
provided "frankiesardo:icepick-processor:${icepickVersion}"
compile "com.facebook.fresco:fresco:${frescoVersion}"
compile "com.facebook.fresco:animated-gif:${frescoVersion}"
// Canary
debugCompile "com.squareup.leakcanary:leakcanary-android:${leakCanaryVersion}"
releaseCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
androidTestCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
testCompile "com.squareup.leakcanary:leakcanary-android-no-op:${leakCanaryVersion}"
compile 'com.prolificinteractive:material-calendarview:1.4.3'
//Card IO
compile 'io.card:android-sdk:5.5.1'
compile 'com.facebook.rebound:rebound:0.3.8'
//Chrome Web-View
compile "com.android.support:customtabs:${supportLibsVersion}"
def folder = new File('./brickkit-android/BrickKit/bricks/build.gradle')
if (folder.exists()) {
compile project(':bricks')
} else {
compile 'com.demoapp:brickkit-android:0.9.27'
}
// intellij annotations are included in kotlin, so this creates
// a "java.util.zip.ZipException: duplicate entry" on its modules
//compile 'com.intellij:annotations:12.0#jar'
testCompile "com.google.dagger:dagger:${daggerVersion}"
demoappTangoEnabledCompile project(':demoappView')
compile ('com.perimeterx.sdk:msdk:1.1.0') {
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
// Kotlin support
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
//Data binding
kapt "com.android.databinding:compiler:$gradleVersion"
compile 'nl.littlerobots.rxlint:rxlint:1.4'
// Room
compile "android.arch.persistence.room:runtime:${roomVersion}"
kapt "android.arch.persistence.room:compiler:${roomVersion}"
androidTestCompile "android.arch.persistence.room:testing:${roomVersion}"
// Stetho
compile 'com.facebook.stetho:stetho:1.5.0'
compile 'com.facebook.stetho:stetho-js-rhino:1.4.2'
compile 'com.siftscience:sift-android:0.9.10'
}
import groovy.json.JsonBuilder
task uploadapithingFiles << {
// Get all the apithing files
String apithingDir = "${project.rootDir}/models/src/main/java/com/demoapp/models/requests/apithing-files"
FileTree files = fileTree(dir: apithingDir)
// TreeMap of File names and File Data
TreeMap<String, String> fileMap = new TreeMap<>()
files.each { file ->
Scanner input = new Scanner(file)
String output = ""
while (input.hasNext()) {
output = output + input.nextLine()
}
input.close()
fileMap.put(file.name.take(file.name.lastIndexOf('.')), output)
}
// Build request JSON
def json = new JsonBuilder()
json{
payload {
build_id getVersionCode()
client_id 2
version lastTaggedVersion
is_production isBuildForGPS() ? 1 : 0
queries fileMap.collect {
[
"name": it.key,
"query": it.value
]
}
}
}
// Create POST Request
def url = 'http://services.demoapp.com:8280/purest/performance/app_apithing'
def post = new URL(url).openConnection()
def message = json.toString()
projects.logger.debug(message)
post.setRequestMethod("POST")
post.setRequestProperty("Content-Type", "application/json; charset=utf-8")
post.setDoOutput(true)
post.getOutputStream().write(message.getBytes("UTF-8"))
def responseCode = post.getResponseCode()
if(responseCode >= 200 && responseCode <= 299) {
projects.logger.lifecycle("apithing upload successful.")
} else {
projects.logger.lifecycle("apithing Upload Failed with response: ${post.getResponseMessage()}")
throw new GradleException("ERROR: Unable to upload apithing files. Server returned a response code: ${responseCode}")
}
}
project.gradle.taskGraph.whenReady {
->
project.tasks.findAll { it.name =~ /connected.+AndroidTest/ }.each {
it.ignoreFailures = true
}
}
def errorOutput(dir) {
println "\n\n================OUTPUT REPORT=================\n\n"
println "The file $dir does not exist\n "
println "Check the current APK Path and Version "
println "\n\n==============================================\n\n"
}
def executeUpload(dir, isUpload, key) {
if (isUpload) {
exec {
commandLine 'curl', 'https://tok_gh6e7yrydkhgqyaz2fvx702y8m#api.appetize.io/v1/apps', '-F', "file=#$dir", '-F', 'platform=android'
}
} else {
exec {
commandLine 'curl', "https://tok_gh6e7yrydkhgqyaz2fvx702y8m#api.appetize.io/v1/apps/$key", '-F', "file=#$dir", '-F', 'platform=android'
}
}
}
apply plugin: 'com.google.gms.google-services'
jacocoAndroidUnitTestReport {
excludes += ['**/R.class','**/R$*.class','**/*$ViewInjector*.*','**/*$ViewBinder*.*','**/BuildConfig.*','**/Manifest*.*','**/*$Lambda$*.*','**/*Module.*','**/*Dagger*.*','**/*MembersInjector*.*','**/*_Provide*Factory*.*','**/*_Factory*.*','**/*$*$*.*','**/test*/**','**/androidTest/**','**/databinding/**']
}
tasks.whenTaskAdded { task ->
if (task.name == 'connecteddemoappDebugAndroidTest' || task.name == 'connecteddemoappflavorDebugAndroidTest') {
task.doFirst() {
exec {
commandLine 'sh', 'get_android_wiremock.sh'
}
}
task.doLast() {
exec {
commandLine 'sh', 'get_device_recordings.sh', 'wiremock_blacklist.txt'
}
}
}
}
android.applicationVariants.all { variant ->
task("checkstyle${variant.name.capitalize()}", type: Checkstyle) {
configFile file("${project.rootDir}/config/quality/checkstyle/checkstyle.xml")
configProperties.checkstyleSuppressionsPath = file("${project.rootDir}/config/quality/checkstyle/suppressions.xml").absolutePath
source 'src'
include '**/*.java'
exclude '**/gen/**'
exclude '**/models/generated/**'
classpath = files() as FileCollection
group = "verification"
}
check.dependsOn("checkstyle${variant.name.capitalize()}")
}
android.applicationVariants.all { variant ->
task("findbugs${variant.name.capitalize()}", type: FindBugs) {
ignoreFailures = false
effort = "default"
reportLevel = "medium"
excludeFilter = new File("${project.rootDir}/config/quality/findbugs/findbugs-filter.xml")
classes = files("${project.rootDir}/app/build/intermediates/classes")
source = fileTree('src/main/java/')
classpath = files()
group = "verification"
reports {
xml.enabled = false
html.enabled = true
xml {
destination "$project.buildDir/findbugs/findbugs-output.xml"
}
html {
destination "$project.buildDir/findbugs/findbugs-output.html"
}
}
dependsOn "compile${variant.name.capitalize()}JavaWithJavac"
}
check.dependsOn("findbugs${variant.name.capitalize()}")
}
android.applicationVariants.all { variant ->
task("buildCheckTest${variant.name.capitalize()}", type: GradleBuild) {
dependsOn "checkstyle${variant.name.capitalize()}"
dependsOn "assemble${variant.name.capitalize()}"
dependsOn "lint${variant.name.capitalize()}"
dependsOn "findbugs${variant.name.capitalize()}"
dependsOn "test${variant.name.capitalize()}UnitTest"
dependsOn "jacocoTest${variant.name.capitalize()}UnitTestReport"
mustRunAfter "clean"
}
}
task buildReleaseTest(type: GradleBuild)
android.applicationVariants.all { variant ->
if (variant.name.endsWith("Release")) {
buildReleaseTest.dependsOn("buildCheckTest${variant.name.capitalize()}")
}
}
android.applicationVariants.all { v ->
if (v.buildType.name == "release"){
v.assemble.dependsOn("uploadapithingFiles")
}
}
buildReleaseTest.mustRunAfter('clean')
task cleanBuildReleaseTest(type: GradleBuild)
cleanBuildReleaseTest.dependsOn('clean')
cleanBuildReleaseTest.dependsOn('buildReleaseTest')
Whoa, that's a lot of plugins. The error message comes because one of them depends on an API that was changed in 3.x (hence migration link). You'll need to update the corresponding plugin.
Based on gradle dependencies run at step 3 below, my guess is gradle.plugin.com.nobleworks_software.icon-overlay:icon-overlay-plugin. It shows com.android.tools.build:gradle:2.2.3 -> 3.0.1 nested under.
(gradlew buildEnvironment on your project may also give you a similar result if you add 3.0.1 Android Gradle Plugin to your build.gradle)
--stacktrace should have also given you the exact location where com.android.build.gradle.tasks.ManifestProcessorTask#getManifestOutputFile was called from. If it doesn't you can still do below:
This is a way I would answer this question if I had an mvce. You have too many plugins to set up everything manually from scratch. This method is also applicable to any Gradle buildscript weirdness in plugins.
Close your project in AS/IDEA
Note: if you have a buildSrc in your project that could also work, so there's no need to close and create another.
Create another project (let's call it debugger) with build.gradle file as follows:
buildscript {}'s contents from your project (but no buildscript block!)
repositories {
jcenter()
...
}
dependencies {
implementation ... // for each classpath ...
}
add plugins { id 'java' } on root level
add implementation 'com.android.tools.build:gradle:3.0.1' inside dependencies
Open this project in IDEA/Android Studio
(this will download all the sources for those plugins)
Run gradlew --no-daemon -Dorg.gradle.debug=true --debug --stacktrace from terminal
(this will stop executing and wait,
note: Listening for transport dt_socket at address: 5005)
Go to "Run/Debug configurations" dialog in debugger project
Create a "Remote" configuration (green +) with parameters from Gradle's log:
Close dialog with OK / Apply
Jump to class/file com.android.build.gradle.tasks.ManifestProcessorTask inside gradle-core-3.0.1-sources.jar
Put a breakpoint at line 128 in ManifestProcessorTask.getManifestOutputFile
To be safe repeat above two steps for gradle-core-3.0.1.jar's decompiled code as well. (line number may differ)
Run menu > Debug "Remote"
Wait and celebrate when breakpoint hits and you see who calls the method in the Debug view's Stack frame listing.
It looks overwhelming, but it's quite simple and fast after you did this once.
i can't sync android project i add gradle code below. When i sync it's failed and add message: Error:Cannot invoke method add() on null object
apply plugin: 'com.android.application'. I tryed everything, but can't fix it
android {
def ci_pf = new File('ci.properties')
if (ci_pf.canRead()) {
def Properties ci_p = new Properties()
ci_p.load(new FileInputStream(ci_pf))
def bld = ci_p['ci_versionCode'].toInteger()
def bvn = ci_p['ci_versionName']
def csv = ci_p['ci_compileSdkVersion'].toInteger()
def btv = ci_p['ci_buildToolsVersion']
def msv = ci_p['ci_minSdkVersion'].toInteger()
def tsv = ci_p['ci_targetSdkVersion'].toInteger()
def cxf = ci_p['ci_cppFlags']
compileSdkVersion csv
buildToolsVersion btv
defaultConfig {
applicationId "com.nordcurrent.AdSystemTest"
minSdkVersion msv
targetSdkVersion tsv
versionCode bld
versionName bvn
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions -Wno-nonportable-include-path -DDEBUG -D_DEBUG " + cxf
cFlags "-D\"lua_getlocaledecpoint()='.'\" -DLUA_ANSI -DUSE_ANDROID"
arguments "-DANDROID_STL=c++_static", "-DANDROID_ARM_MODE=arm", "-DANDROID_ARM_NEON=TRUE"
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'armeabi-v7a', 'x86'
jobs 32
}
}
compileSdkVersion = csv
buildToolsVersion = btv
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled = false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt')
}
}
}
android.productFlavors {
create("fat") {
ndk.abiFilters.add("armeabi-v7a")
ndk.abiFilters.add("x86")
}
}
android.sources {
main {
jni {
source {
srcDirs 'src/main/jni'
}
}
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'Millennial', ext: 'aar')
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:support-annotations:25.2.0'
/** Tune dependency */
compile 'com.android.support:support-v4:23.1.1'
compile 'de.greenrobot:eventbus:2.4.0'
androidTestCompile 'com.android.support:support-annotations:25.2.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
testCompile 'junit:junit:4.12'
compile 'junit:junit:4.12'
}
I'm facing an issue while assembling a library project. I had built an application project & later on converted it to library. I'm not able to generate .aar package. I found few answers here that tells to change the apt neenbedankt plugin, attaching databinding:compiler, but that didn't worked for me at all. Some might say that dagger is the issue but i'm not sure of it. Please help.
Here is my error log while assembling a build
Information:Gradle tasks [assemble]
/home/***/***/**/**/productlisting/viewmodel/ProductListFragmentViewModel.java
Error:(9, 52) error: cannot find symbol class BR
/home/***/***/**/**/home/viewmodel/NavSubItemViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/productlisting/viewmodel/NavSubItemViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/home/topbrands/BrandActivityViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/productlisting/viewmodel/ProductListActivityViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/home/viewmodel/NewArrivalViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/home/viewmodel/NavParentItemViewModel.java
Error:(3, 52) error: cannot find symbol class BR
/home/***/***/**/**/productlisting/viewmodel/NavParentItemViewModel.java
Error:(3, 52) error: cannot find symbol class BR
Error:Execution failed for task :app:compileLiveDebugJavaWithJavac.
Compilation failed; see the compiler error output for details.
Information:BUILD FAILED
Information:Total time: 6.519 secs
Information:9 errors
Information:0 warnings
Information:See complete output in console
Here is my module level build.gradle
``
apply plugin: 'com.android.library'
apply plugin: 'io.fabric' def gitSha = 'git rev-parse --short HEAD'.execute([], project.rootDir).text.trim()
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName getCurrentVersion()
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [hostNameDeepLink: "http://***.**.in:203/api/"]
buildConfigField "String", "CodeRevision", "\"{$gitSha}\""
multiDexEnabled true
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
pickFirst 'META-INF/rxjava.properties'
}
signingConfigs {
planet {
storeFile file('../****.jks')
storePassword '***#123'
keyAlias '***'
keyPassword '***#123'
}
}
dataBinding {
enabled = true
}
lintOptions {
disable 'InvalidPackage'
abortOnError false
}
dexOptions {
jumboMode true
}
productFlavors {
local {
String WebServiceUrl = getWebServiceUrl()
String WebSitePath = getWebSitePath()
String ImageUrl = getImageUrl()
String ServerName = getServerName()
String TestCustomerId = getWebSitePath()
buildConfigField "String", "WebServiceUrl", "\"$WebServiceUrl\""
buildConfigField "String", "WebSitePath", "\"$WebSitePath\""
buildConfigField "String", "ImageUrl", "\"$ImageUrl\""
buildConfigField "String", "ServerName", "\"$ServerName\""
buildConfigField "String", "TestCustomerId", "\"$TestCustomerId\""
manifestPlaceholders = [hostNameDeepLink: "http://10.160.0.18"]
}
live {
String WebServiceUrl = getWebServiceUrl()
String WebSitePath = getWebSitePath()
String ImageUrl = getImageUrl()
String ServerName = getServerName()
String TestCustomerId = getWebSitePath()
buildConfigField "String", "WebServiceUrl", "\"$WebServiceUrl\""
buildConfigField "String", "WebSitePath", "\"$WebSitePath\""
buildConfigField "String", "ImageUrl", "\"$ImageUrl\""
buildConfigField "String", "ServerName", "\"$ServerName\""
buildConfigField "String", "TestCustomerId", "\"$TestCustomerId\""
/*buildConfigField "String", "WebServiceUrl", "\"http://perfectmother.zoomi.in:203/api/\""
buildConfigField "String", "WebSitePath", "\"http://perfectmother.zoomi.in:203/\""
buildConfigField "String", "ImageUrl", "\"http://perfectmother.zoomi.in:203\""
buildConfigField "String", "ServerName", "\"-Live\""
buildConfigField "String", "TestCustomerId", "\"10086\""*/
manifestPlaceholders = [hostNameDeepLink: "http://perfectmother.zoomi.in"]
}
}
buildTypes {
release {
signingConfig signingConfigs.planet
shrinkResources true
minifyEnabled true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
}
debug {
signingConfig signingConfigs.planet
debuggable true
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'proguard-rules-debug.pro'
}
}
}
def static getCurrentVersion() {
def buildEnv = System.getenv("BUILD_NUMBER")
def buildNumber = buildEnv != null ? ".${buildEnv}" : ""
return "1.0" + buildNumber
}
def getWebServiceUrl() {
return hasProperty('WebServiceUrl') ? WebServiceUrl : ''
}
def getWebSitePath() {
return hasProperty('WebSitePath') ? WebSitePath : ''
}
def getImageUrl() {
return hasProperty('ImageUrl') ? ImageUrl : ''
}
def getServerName() {
return hasProperty('ServerName') ? ServerName : ''
}
def getTestCustomerId() {
return hasProperty('TestCustomerId') ? TestCustomerId : ''
}
ext {
playServiceVersion = '10.2.1'
supportLibVersion = '25.3.1'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile "com.android.support:appcompat-v7:$supportLibVersion"
// Unit testing
testCompile 'org.robolectric:robolectric-resources:3.0'
testCompile 'org.robolectric:shadows-core:3.2.2'
testCompile 'org.robolectric:robolectric:3.2.2'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.6.3'
//Hamcrest
testCompile 'org.hamcrest:hamcrest-all:1.3'
//Retrofit
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
//Zoomi library
compile 'com.zoomi.android:utils:1.0'
compile 'com.zoomi.android:rxutils:1.5.1'
//CardView:
compile "com.android.support:cardview-v7:$supportLibVersion"
//RecyclerView:
compile "com.android.support:recyclerview-v7:$supportLibVersion"
//Design
compile "com.android.support:design:$supportLibVersion"
//Glide
compile 'com.github.bumptech.glide:glide:3.7.0'
//Dagger
compile 'com.google.dagger:dagger:2.9'
annotationProcessor 'com.google.dagger:dagger-compiler:2.9'
//Auto Value
annotationProcessor 'com.google.auto.value:auto-value:1.3'
provided 'com.google.auto.value:auto-value:1.3'
//Auto Value GSON
annotationProcessor 'com.ryanharter.auto.value:auto-value-gson:0.4.6'
provided 'com.ryanharter.auto.value:auto-value-gson:0.4.6'
//Auto Value Parcelable
annotationProcessor 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'
provided 'com.ryanharter.auto.value:auto-value-parcel:0.2.5'
//Rx
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
//Timber
compile 'com.jakewharton.timber:timber:4.3.1'
//FOR CI
compile "com.google.firebase:firebase-core:$playServiceVersion"
//Fire base crash reporting
compile "com.google.firebase:firebase-crash:$playServiceVersion"
//Fire base authentication
compile "com.google.firebase:firebase-auth:$playServiceVersion"
compile "com.google.android.gms:play-services-auth:$playServiceVersion"
//bottom bar
compile 'com.aurelhubert:ahbottomnavigation:2.0.4'
//Groupie
compile 'com.genius:groupie:0.8.0'
//PageIndicator
compile 'com.romandanylyk:pageindicatorview:0.1.1'
//FiftyShadesOf
compile 'com.github.florent37:fiftyshadesof:1.0.0'
//Proguard Snippets
compile 'com.github.PrashamTrivedi:ProguardSnips:0.1-snapshot'
//ProGuard rules for RxJava!
compile 'com.artemzin.rxjava:proguard-rules:1.2.4.0'
//Facebook
compile 'com.facebook.android:facebook-android-sdk:4.19.0'
//Twitter
compile('com.twitter.sdk.android:twitter:2.3.1#aar') {
transitive = true
}
// Crop image
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.1'
//Show case
compile 'com.github.deano2390:MaterialShowcaseView:1.1.0'
//GSON
compile 'com.google.code.gson:gson:2.8.0'
//Constraint layout
compile 'com.android.support.constraint:constraint-layout:1.0.2'
//Firebase cloud messaging
compile 'com.google.firebase:firebase-messaging:10.2.0'
}
buildscript {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.fabric.tools:gradle:1.22.1'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven { url 'http://**.***.**.**:81/release/' }
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
}
apply plugin: 'com.google.gms.google-services'
I have a problem in which I open an old project and I get the errors below. I searched on internet how to solve it. The project already has dependencies with Facebook but I don't know why it doesn't appear in modules (automatic gradle) and when i try to import a new facebook sdk, it tells me that i already have a Facebook module... Anyone with the same problem?
Error:(26, 20) error: cannot find symbol class Request
Error:(27, 20) error: cannot find symbol class Session
Error:(28, 20) error: cannot find symbol class SessionState
Error:(29, 20) error: cannot find symbol class UiLifecycleHelper
Error:(30, 26) error: package com.facebook.model does not exist
Error:(31, 27) error: package com.facebook.widget does not exist
Error:(110, 13) error: cannot find symbol class UiLifecycleHelper
Error:(111, 20) error: package Session does not exist
Error:(540, 45) error: cannot find symbol class Session
Gradle:
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.2'
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/repo' }
}
android {
compileOptions { sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7 }
compileSdkVersion 22
buildToolsVersion '22'
defaultConfig {
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName '0.85.1.0'
applicationId 'com.xxxxx'
multiDexEnabled = true
}
buildTypes {
release {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
signingConfigs {
debug {
storeFile file('keys/debug.keystore')
}
release {
storeFile file('keys/xxx.jks')
storePassword 'xxx'
keyAlias 'xxx'
keyPassword 'xxx'
}
// debug {
// storeFile file("keys/debug.keystore")
// }
}
productFlavors {
local {
resValue "string", "URL", 'xxx'
resValue "string" , "Debug", '1'
versionName = android.defaultConfig.versionName + "_local"
}
remote {
resValue "string", "URL", 'xxx'
resValue "string" , "Debug", '0'
versionName = android.defaultConfig.versionName + "_remote"
}
}
defaultConfig {
testApplicationId "com.xxx.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
packagingOptions {
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
}
productFlavors {
}
lintOptions {
abortOnError false
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def apk = outputFile;
def newName;
newName = apk.name.replace(".apk", variant.name +"-v" + defaultConfig.versionName + "_" + variant.name + ".apk")
.replace(project.name, "xxx");
// newName = newName
// .replace("-" + variant.buildType.name, "")
// .replace(project.name, "xxx");
//output.outputFile = new File(apk.parentFile, newName);
if (output.zipAlign) {
//variant.outputFile = new File(apk.parentFile, newName.replace("-unaligned", ""));
newName = newName.replace("-unaligned", "");
}
//def fileName = outputFile.name.replace('.apk', "-${versionName}.apk")
output.outputFile = new File(outputFile.parent, newName)
logger.info('INFO: Set outputFile to ' + output.outputFile + " for [" + output.name + "]");
}
}
}
}
dependencies {
// compile project(':facebook')
compile 'com.android.support:support-v13:21.0.0'
// compile 'com.google.android.gms:play-services:7.0.0'
compile 'com.google.android.gms:play-services-base:7.3.0'
compile 'com.google.android.gms:play-services-maps:7.3.0'
compile 'com.google.android.gms:play-services-gcm:7.3.0'
compile 'com.google.android.gms:play-services-identity:7.3.0'
compile 'com.google.android.gms:play-services-plus:7.3.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile project(':PuntechSensorsLib')
compile ("com.doomonafireball.betterpickers:library:1.5.3") {
exclude group: 'com.android.support', module: 'support-v4'
}
compile('com.crashlytics.sdk.android:crashlytics:2.0.1#aar') {
transitive = true;
}
}
ext.betaDistributionGroupAliases="internal"
It's because of conflicts in your XML files.
As the errors tell you, several xml files (in your res folders, maybe "attr" ones but I cannot be sure) has the same name in different projects.
Maybe they belong to your definitions or third's, but the ID for your resources must be unique.
Try checking if they can be yours and rename them.
EDIT:
Now I can see your errors,
Add jcenter() to your repos. Facebook artifacts seem to be there. You don't need to remove your previous one.
In your repositories zone:
repositories {
jcenter() // IntelliJ main repo.
}
In case you already have a "facebook" module, remove it from your project structure (file -> project structure) and you can also delete your module files in case you want to clean your project. (attention: all of this only if you didn't customize anything from "facebook" module").
With gradle, you only need import it from your build.gradle, and not having your own "facebook" module.
When I was using compile 'com.facebook.android:facebook-android-sdk:4.0.0' I had the same problem. I used compile 'com.facebook.android:facebook-android-sdk:3.23.1' instead and my project was built successfully. I do not know if it has something to do with upgrading from 3.x to 4.0.