Gradle ArchivesBaseName ignored when using GoogleServices plugin - android

I've regularly used the archivesbasename to rename my output apk's but since using the google-services plugin it is being ignored. Is there anything I can do to get this working again.
Attached my full build.gradle below, be grateful for any pointers.
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
project.archivesBaseName = "MyApp";
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.codechimp.myapp"
versionCode 205
versionName "2.4"
minSdkVersion 14
targetSdkVersion 22
}
productFlavors {
prod {
}
dev {
versionName = android.defaultConfig.versionName + " dev"
}
}
signingConfigs {
debug {
storeFile file("debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
release }
buildTypes {
debug {
debuggable true
signingConfig signingConfigs.debug
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.google.android.gms:play-services-drive:7.5.0'
compile 'com.google.android.gms:play-services-plus:7.5.0'
compile 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.google.android.gms:play-services-ads:7.5.0'
compile 'com.google.android.gms:play-services-identity:7.5.0'
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.afollestad:material-dialogs:0.6.2.4'
compile 'com.google.code.gson:gson:2.3'
compile 'com.github.andrew-codechimp:androidutils:1.19'
}
def Properties props = new Properties()
props.load(new FileInputStream(file('signing.properties')))
if (props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
android.buildTypes.release.signingConfig = null
}
Project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.google.gms:google-services:1.3.0-beta1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}

This stopped working for me with android gradle plugin version 1.3.0 using 1.3.1 resolves it.
classpath 'com.android.tools.build:gradle:1.3.1'
Inside your build.gradle for the app you might have this.
android {
//...
defaultConfig {
//...
archivesBaseName = "myprojectname_v${versionName}_${versionCode}"
}
//...
}
If you want to change the APK name based on build type.
android {
//...
buildTypes {
special {
//...
archivesBaseName = "myprojectname_special_v${versionName}_${versionCode}"
}
}
//...
}

Related

Gradle - classes of a library is not includded inside the aar

I have library that is called sensorcore and I have another library (org.eclipse.paho.android.service-1.1.1.aar) that I would like to include it's classes inside the sensorcore aar that is built.(in sensorcore/build/output/arr/).
The library structure
-libraryFolder
--sensorcore
---build.gradle
--app
---build.gradle
--libs
---build.gradle
---paho.android.service.aar
-build.gradle
-settings.gradle
sensorcore/build.gradle
apply plugin: 'com.android.library'
def LIBRARY_VERSION = "1.2.8"
android {
compileSdkVersion 31
defaultConfig {
minSdkVersion 14
targetSdkVersion 31
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = "***"
artifactId = "***"
version = "${LIBRARY_VERSION}"
from components.release
}
}
repositories {
maven {
url "mavlink"
name "Git"
credentials(HttpHeaderCredentials) {
name = 'Job-Token'
value = System.getenv("CI_JOB_TOKEN")
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation project(":libs")
}
app/build.gradle
apply plugin: 'com.android.application'
android {
signingConfigs {
releasekeystore {
keyAlias '***'
keyPassword '***'
storeFile rootProject.file('secrets/key.jks')
storePassword '***'
}
}
compileSdkVersion 31
defaultConfig {
applicationId "******"
minSdkVersion 14
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.releasekeystore
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation project(":sensorcore")
}
libs/build.gradle
configurations.maybeCreate("default")
artifacts.add("default", file('org.eclipse.paho.android.service-1.1.1.aar'))
libraryFolder build.gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'maven-publish'
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
libraryFolder settings.gradle
include ':app', ':sensorcore', ':libs'
rootProject.name='Sensor'
when I'm trying just to build it using the gradle command "gradle clean build" it gives me an error
What went wrong:
Execution failed for task ':app:validateSigningRelease'.
> Keystore file 'libraryFolder\secrets\key.jks' not found for signing config 'releasekeystore'.
Is it possbile to "build" without the releasekey? maybe there is any command that can do it.
I didn't find any infomation in the gradle documentation, maybe I have missed it.
Anybody has any idea how to resolve it? thank you.

Failed to resolve: com.android.support:palette-v7:26.0.1

I am having this error on Android Studio:
Error:Failed to resolve: com.android.support:palette-v7:26.0.1
Install Repository and sync project
Open File
Show in Project Structure dialog
When I click 'Install Repository and sync project' nothing happens.
I already checked and tried similar questions's answers. But still problem exists.
Here is my project level build.gradle code:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is my app level build.gradle code:
apply plugin: 'com.android.application'
apply from: "$rootDir/utils.gradle"
apply plugin: 'io.fabric'
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
//repositories {
// maven { url 'https://maven.fabric.io/public' }
//}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
maven { url 'https://maven.fabric.io/public' }
}
}
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
def applicationName = "xyz"
defaultConfig {
applicationId "xyz"
minSdkVersion 15
targetSdkVersion 26
versionCode 16
versionName "1.7"
manifestPlaceholders = [onesignal_app_id : "xyz",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
buildConfigField 'String', 'END_POINT', toJavaCodeString(END_POINT)
}
signingConfigs {
debug {
keyAlias 'androiddebugkey'
keyPassword 'android'
storePassword 'android'
storeFile file('../keystore/debug.jks')
}
release {
keyAlias 'xyz'
keyPassword 'xyz'
storePassword 'xyz'
storeFile file('../../../Keystore/xyz.keystore')
}
}
productFlavors {
dev {
signingConfig signingConfigs.debug
versionCode defaultConfig.versionCode
versionName defaultConfig.versionName
applicationId "xyz"
}
prod {
signingConfig signingConfigs.release
versionCode defaultConfig.versionCode
versionName defaultConfig.versionName
applicationId "xyz"
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig getSigningConfig()
applicationVariants.all { variant ->
variant.outputs.each { output ->
def date = new Date();
def formattedDate = date.format('dd-MM - HH:mm:ss')
output.outputFile = new File(output.outputFile.parent,
output.outputFile.name.replace("app-prod-release", applicationName + " v" + defaultConfig.versionName + " - " + formattedDate)
)
}
}
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), "rules-proguard-debug.pro"
signingConfig signingConfigs.debug
}
}
lintOptions {
abortOnError false
}
}
ext {
supportLibraryVersion = "26.0.1"
}
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven {
url "https://maven.google.com"
}
}
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:${supportLibraryVersion}"
compile "com.android.support:design:${supportLibraryVersion}"
compile "com.android.support:palette-v7:${supportLibraryVersion}"
compile "com.android.support:recyclerview-v7:${supportLibraryVersion}"
compile "com.android.support:cardview-v7:${supportLibraryVersion}"
compile "com.android.support:customtabs:${supportLibraryVersion}"
// compile "com.android.support:support-dynamic-animation:${supportLibraryVersion}"
compile 'com.tsengvn:typekit:1.0.1'
compile 'com.jakewharton.timber:timber:4.5.0'
compile 'com.mikepenz:iconics-core:2.8.2#aar'
compile 'com.mikepenz:fontawesome-typeface:4.7.0.0#aar'
compile 'com.mikepenz:community-material-typeface:1.7.22.1#aar'
compile 'com.android.volley:volley:1.0.0'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'pub.devrel:easypermissions:0.2.1'
compile('com.github.ozodrukh:CircularReveal:2.0.1#aar') {
transitive = true;
}
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.balysv:material-ripple:1.0.2'
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile 'me.zhanghai.android.materialprogressbar:library:1.3.0'
compile 'com.inthecheesefactory.thecheeselibrary:adjustable-imageview:1.0.0'
compile 'com.github.florent37:viewanimator:1.0.5'
compile 'com.github.ybq:Android-SpinKit:1.1.0'
// compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'com.afollestad.material-dialogs:core:0.9.4.7'
compile 'com.afollestad.material-dialogs:commons:0.9.4.7'
// compile 'com.onesignal:OneSignal:3.+#aar'
// compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
def gmsVersion = '11.2.+'
compile("com.google.android.gms:play-services-gcm:${gmsVersion}") {
force = true
}
compile("com.google.android.gms:play-services-location:${gmsVersion}") {
force = true
}
compile("com.android.support:support-v4:${supportLibraryVersion}") {
force = true
}
compile("com.android.support:support-v13:${supportLibraryVersion}") {
force = true
}
compile("com.android.support:customtabs:${supportLibraryVersion}") {
force = true
}
compile 'com.google.android.gms:play-services-ads:' + gmsVersion
compile 'com.anjlab.android.iab.v3:library:1.0.+'
// compile 'org.solovyev.android:checkout:1.0.0'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.1'
// releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
// testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
}
Project and app level build.gradle code added.
Any idea? Thanks!
This is the best way to do it.
In your root level gradle.build use below
buildscript {
repositories {
mavenCentral()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and in your gradle-wrapper.properties file change the wrapper version as below
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-all.zip
also in your app level build.gradle make sure you are using 26 vesion as below
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxx"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

GooglePlay services build error

I updated build tools, and can not compile my app.
I always got an error -
Error:Execution failed for task ':app:processProdDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is
available at
https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 9.0.0.
my build.gradle-
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.google.gms:google-services:3.0.0'
//method count
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.3.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven {
url "https://dl.bintray.com/supersonic/android-sdk" }
maven {
url "https://clojars.org/repo" }
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
}
project.ext {
versionCode = 14
versionName = "1.1.0.3"
minSdkVersion = 15
compileSdkVersion = 22
sdkTools = '22.0.1'
appcompatVer = "com.android.support:appcompat-v7:22.2.1"
}
my app/build.gradle
def final UNIVERSAL_IMAGE_LOADER = '1.9.5'
def final MULTIVIEW_PAGER_VER = '1.0'
def final ACTIVE_ANDROID_VER = '3.1.0-SNAPSHOT'
def final CIRCLE_IMAGE_VER = '1.3.0';
def final OKHTTP_VER = '2.4.0';
def final EMOJI_VERSION = '1.0'
def final FACEBOOK_SDK_VER = '4.1.0'
def final ROUNDED_IMAGEVIEW_VER = '2.2.1'
def final GSM_VER = '9.0.0'
def final RECYCLER_VIEW_VER = '23.1.1'
def final FLURRY_VER = '6.2.0'
apply plugin: 'com.android.application'
//uncomment this and in top-gradle file to count num of refs
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'com.google.gms.google-services'
dexcount {
includeClasses = true
includeFieldCount = true
printAsTree = true
orderByMethodCount = true
verbose = true
}
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.sdkTools
packagingOptions {
//this resolves SignalR and Protobuf conflict
//start region
exclude 'package-list'
exclude 'index.html'
exclude 'help-doc.html'
exclude 'constant-values.html'
exclude 'allclasses-noframe.html'
exclude 'allclasses-frame.html'
exclude 'resources/tab.gif'
exclude 'resources/background.gif'
exclude 'resources/titlebar.gif'
exclude 'resources/titlebar_end.gif'
exclude 'stylesheet.css'
exclude 'overview-tree.html'
//end region
}
defaultConfig {
applicationId "dating.social.viche"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.compileSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
}
signingConfigs {
release {
storeFile file("../my-release-key.keystore")
storePassword "qwertysocialapp123"
keyAlias "egoistapp"
keyPassword "qwertysocialapp123"
}
qainvalid{
storeFile file("../debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
}
buildTypes {
debug{
applicationIdSuffix ".debug"
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-debug-rules.pro', 'proguard-rules.pro'
}
release {
lintOptions{
//to fix google error - google_id is not translated to other lang
checkReleaseBuilds false
}
minifyEnabled true
// debuggable false
// jniDebuggable false
// renderscriptDebuggable false
// zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
qa {
signingConfig signingConfigs.qainvalid
String versionName1 = rootProject.ext.versionName + '_QA'
versionName versionName1
}
prod {
signingConfig signingConfigs.release
versionName rootProject.ext.versionName
}
}
}
dependencies {
compile project(':signalr-client-sdk-android')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile "com.android.support:recyclerview-v7:${RECYCLER_VIEW_VER}"
compile "com.nostra13.universalimageloader:universal-image-loader:${UNIVERSAL_IMAGE_LOADER}"
compile "de.hdodenhof:circleimageview:${CIRCLE_IMAGE_VER}"
compile "com.pixplicity.multiviewpager:library:${MULTIVIEW_PAGER_VER}"
compile "com.michaelpardo:activeandroid:${ACTIVE_ANDROID_VER}"
compile "com.squareup.okhttp:okhttp:${OKHTTP_VER}"
compile "com.rockerhieu.emojicon:library:${EMOJI_VERSION}"
compile "com.facebook.android:facebook-android-sdk:${FACEBOOK_SDK_VER}"
compile "com.makeramen:roundedimageview:${ROUNDED_IMAGEVIEW_VER}"
compile 'com.github.orangegangsters:swipy:1.2.2#aar'
compile "com.flurry.android:analytics:${FLURRY_VER}"
compile 'com.supersonic.sdk:mediationsdk:6.4.6#jar'
compile project(':apng_lib')
compile project(':flingCards')
//SignalR libraries
// To get updated libs, make project and grab resourses : https://github.com/SignalR/java-client
// compile files('libs/gson-2.2.2.jar')
// compile 'com.google.code.gson:gson:2.3'
// compile files ('libs/signalr-client-sdk.jar')
// compile files ('libs/signalr-client-sdk-android.jar')
// compile "org.java-websocket:java-websocket:1.3.1"
// To generate new version of proto Java classes refer to tools/readme
compile files('libs/protobuf-java-2.6.1.jar')
compile ('com.google.android.gms:play-services-basement:${GSM_VER}'){
exclude module: 'support-v4';
}
compile "com.google.android.gms:play-services-analytics:${GSM_VER}"
compile "com.google.android.gms:play-services-gcm:${GSM_VER}"
}
I need compile sdk 22, because I did not implemented features from 6 android.
Please help

2 app icons after installing the release apk,using gradle build

I am using ./gradlew assembleRelease command to generate release apk for the app.On installing the app I am getting 2 icons of app.No clue what am I missing.No luch on google.
On clicking the second icon it just shows Simple Indeterminate.
Here is my build.gradle file:
buildscript {
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
dependencies {
classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.0.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'crashlytics'
repositories {
maven { url 'http://download.crashlytics.com/maven' }
}
android {
compileSdkVersion 21
buildToolsVersion '20.0.0'
defaultConfig {
versionCode 23
versionName "1.1.8.5"
applicationId "com.squad.run"
minSdkVersion 10
targetSdkVersion 20
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
signingConfigs {
//Set debug.keystore file here
release {
def propsFile = rootProject.file('keystore.properties')
def Properties props = new Properties()
props.load(new FileInputStream(propsFile))
storeFile = file(props['storeFile'])
storePassword = props['storePassword']
keyAlias = props['keyAlias']
keyPassword = props['keyPassword']
}
}
buildTypes {
debug {
applicationIdSuffix ".debug"
ext.enableCrashlytics = false
}
release {
zipAlign true
signingConfig signingConfigs.release
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
// compile 'com.android.support:support-v4:20.0.0'
compile project(':Libraries:viewPagerIndicator_Squadrun')
compile project(':Libraries:facebookSDK')
compile project(':Libraries:library')
compile project(':Libraries:progressHUD_Squadrun')
compile project(':Libraries:slidingMenuLibrary_SquadRun')
compile project(':Libraries:MobihelpSDK')
compile 'com.squareup.retrofit:retrofit:1.5.1'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'org.apache.httpcomponents:httpmime:4.2.3'
compile 'com.squareup.okhttp:okhttp:1.6.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:1.6.0'
compile 'oauth.signpost:signpost-commonshttp4:1.2.1.2'
compile 'org.twitter4j:twitter4j-core:4.0.1'
compile files('libs/FlurryAnalytics-4.1.0.jar')
compile 'com.crashlytics.android:crashlytics:1.0.0'
}
My top guess is that there is more than one LAUNCHER activity, and that one of them is declared in a library project. Eclipse didn't merge the manifests, but Gradle does.
So, I would suggest you search for android.intent.action.MAIN in all AndroidManifest.xml files.

Could not find any version that matches org.robolectric:robolectric:2.3.+

When syncing my Gradle project in Android Studio, I get the following error:
Error:Could not find any version that matches org.robolectric:robolectric:2.3.+.
Required by:
gradle:android:unspecified
I assume I am missing a repository in my build.gradle file. I'm new to Gradle and Maven, so I'm not sure what I should put. Any suggestions?
Here are my build.gradle files:
Project:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
classpath 'com.github.jcandksolutions.gradle:android-unit-test:1.2.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
}
}
Module:
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "bbct.android.common"
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
lite {
applicationId "bbct.android"
versionCode 15
versionName "0.6.2"
}
premium {
applicationId "bbct.android.premium"
versionCode 14
versionName "0.6.2"
}
}
def Properties props = new Properties()
def propFile = new File('signing.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props!=null && props.containsKey('STORE_FILE') && props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') && props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
}
apply plugin: 'android-unit-test'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.android.gms:play-services:4.2.42'
liteCompile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
androidTestCompile ('com.squareup:fest-android:1.0.8') {
exclude group: 'com.android.support'
}
testCompile 'junit:junit:4.10'
testCompile 'org.robolectric:robolectric:2.3.+'
}
As I said in the comments, try dropping the plus sign. Technically, it shouldn't make a difference (hence why I was hesitant to post it as an answer), but as I stated, I'm pretty sure this has happened to me in the past.
I'm glad it solved your problem. :)

Categories

Resources