I got error "java.lang.NullPointerException (no error message)" when build gradle. Here the error detail https://scans.gradle.com/s/elqrorxbkywzy/failure?expanded-stacktrace=WyIwLTEiXQ&focused-exception-line=0-1-0#1. Please help me i got stuck after try this,
I'm already delete .gradle from root project
Already upgrade Grade 6.5.1 to 6.6.1
Already doing gradle clean before gradle build again
capture of error when gradle build
build.gradle
buildscript {
ext.kotlin_plugin_version = '1.4.31'
ext.kotlin_version = '1.7.0'
ext.nav_version = '2.3.3'
repositories {
google()
mavenCentral()
maven {
url "http://developer.huawei.com/repo/"
allowInsecureProtocol = true
}
}
dependencies {
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
// Add the dependency for the Performance Monitoring plugin
classpath 'com.google.firebase:perf-plugin:1.4.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_plugin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
}
}
plugins { id "org.sonarqube" version "3.0" }
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://jitpack.io" }
maven {
url "http://mobilesdk.useinsider.com/android"
allowInsecureProtocol = true
}
maven {
url "http://developer.huawei.com/repo/"
allowInsecureProtocol = true
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
compileSdkVersion = 31
minSdkVersion = 24
targetSdkVersion = 31
}
app/build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
apply plugin: 'org.sonarqube'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs"
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'kotlin-kapt'
sonarqube {
properties {
property "sonar.projectName", "Android Project"
property "sonar.projectKey", "Android-Project"
property "sonar.host.url", "http://localhost:9003"
property "sonar.language", "java"
property "sonar.login", "admin"
property "sonar.password", "12345"
}
}
tasks.withType(Test) {
testLogging {
events "started", "passed", "skipped", "failed"
showStandardStreams = false
}
}
def getProps(path) {
Properties props = new Properties()
props.load(new FileInputStream(file(path)))
return props
}
def version = "6.15.0"
def buildVersion = version
android {
ndkVersion '23.1.7779620'
lintOptions {
checkReleaseBuilds false
abortOnError false
}
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1000000000
versionName buildVersion
multiDexEnabled true
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [auth0Domain:
"#string/com_auth0_domain", auth0Scheme:
"#string/com_auth0_scheme", partner:
"#string/insider_partnerName"]
ndk {
abiFilters 'arm64-v8a', 'armeabi-v7a', 'x86_64'
}
resConfigs "en", "in"
println("generating configuration from config allvariant properties")
getProps('./config/allvariant.props').each { p ->
if (p.key.startsWith("buildConfig")) {
buildConfigField 'String', p.key.replace("buildConfig.", ""), p.value
} else if (p.key.startsWith("resValue")) {
resValue 'string', p.key.replace("resValue.", ""), p.value
}
}
buildConfigField("String", "CONSUMER_KEY", "\"DNAIMMSP\"")
}
flavorDimensions "pack"
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
buildTypes {
debug {
buildConfigField "String", "HEADER_ORIGIN_VALUE", '"file://"'
buildConfigField "String", "HEADER_CHANNELID_VALUE", '"UX"'
buildConfigField 'boolean', 'ENABLE_CRASHLYTICS', 'true'
buildConfigField "String", "HEADER_X_REQUESTED_VALUE", '"com.android.native"'
buildConfigField 'String', "APP_VERSION", '"' + version + '"'
resValue 'string', 'appVersion', buildVersion + '-DEBUG'
}
release {
ndk.debugSymbolLevel = 'FULL'
firebaseCrashlytics {
nativeSymbolUploadEnabled true
}
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
buildConfigField "String", "HEADER_ORIGIN_VALUE", '"file://"'
buildConfigField "String", "HEADER_CHANNELID_VALUE", '"UX"'
buildConfigField 'boolean', 'ENABLE_CRASHLYTICS', 'true'
buildConfigField "String", "HEADER_X_REQUESTED_VALUE", '"com.android.native"'
buildConfigField 'String', "APP_VERSION", '"' + version + '"'
resValue 'string', 'appVersion', buildVersion
}
}
externalNativeBuild {
cmake.path = "src/main/c/CMakeLists.txt"
cmake.version = "3.10.2.4988404"
}
testOptions {
unitTests.returnDefaultValues = true
}
buildFeatures {
viewBinding true
dataBinding true
}
bundle.language.enableSplit = false
}
repositories {
maven {
url "https://delivery.v3d.fr/nexus/content/repositories/v3d_releases/"
credentials {
username 'telkomsel'
password 'AGUXSdN43GOxwJbWJ2t9'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
productionReleaseImplementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation "androidx.annotation:annotation:1.2.0"
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'org.mockito:mockito-android:3.5.10'
androidTestImplementation "androidx.arch.core:coretesting:2.1.0"
}
gradle.properties
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xms2048m -Xmx4096m -XX:+UseParallelGC
authToken=jp_8b181o9eakb3ejb6h07eg1isgr
# gradle.properties
systemProp.sonar.host.url=http://localhost:9003
systemProp.sonar.projectKey=android-native
# Token generated from an account with 'publish analysis' permission
systemProp.sonar.login=wefwefwe32425sdgedrgrdgredw342qqdeeq
# Native libs for aab
android.bundle.enableUncompressedNativeLibs=false
#android.useDeprecatedNdk=true
Related
When I download a new android project from git, I met this problem:
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://maven.aliyun.com/nexus/content/repositories/jcenter)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.3.3/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
In addition, I've viewed this blog without an answer. Because I have found no 'aliyun' maven usage in the project by 'Search Everywhere' and 'Find In Path' .You can see my problem in the follow picture.
details
search res
project root path
settings.gradle:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://jcenter.bintray.com" }
maven { url "https://jitpack.io" }
}
}
rootProject.name = "viewer"
include ':app', ':daogenerator'
project root path
build.gradle
plugins {
id 'com.android.application' version '7.2.1' apply false
id 'com.android.library' version '7.2.1' apply false
id 'com.google.gms.google-services' version '4.3.10' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
module app
build.gradle
apply plugin: 'com.android.application'
if (file('google-services.json').exists()) {
apply plugin: 'com.google.gms.google-services'
// apply plugin: 'io.fabric'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
ndkVersion '23.1.7779620'
flavorDimensions "distribute"
productFlavors {
appCenter {
dimension "distribute"
}
googlePlay {
dimension "distribute"
}
}
defaultConfig {
applicationId "com.xjs.viewer"
minSdkVersion 23
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 29
versionCode 111
versionName "1.9.4.2"
vectorDrawables.useSupportLibrary = true
resConfigs "zh", "zh-rCN", "zh-rHK", "zh-rTW",
"es", "ja", "ko", "fr", "de", "th"
testOptions.unitTests.includeAndroidResources = true
ndk {
moduleName "native-lib"
abiFilters "armeabi-v7a" , "arm64-v8a", "x86", "x86_64"
}
externalNativeBuild {
cmake {
cppFlags ''
}
}
}
lint {
disable 'MissingTranslation'
abortOnError true
checkReleaseBuilds true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', '"com.hippo.viewer.fileprovider"'
}
debug {
applicationIdSuffix ".debug"
buildConfigField 'String', 'FILE_PROVIDER_AUTHORITY', '"com.hippo.viewer.debug.fileprovider"'
}
}
externalNativeBuild {
cmake {
path file('src/main/cpp/CMakeLists.txt')
}
}
sourceSets {
main {
java.srcDirs += 'src/main/java-gen'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
buildFeatures {
viewBinding true
}
}
task copyNotice(type: Copy) {
from '../NOTICE.html'
into './src/main/assets'
finalizedBy ":daogenerator:executeDaoGenerator"
}
tasks.withType(JavaCompile) {
task -> task.dependsOn copyNotice
}
clean {
delete file('src/main/assets/NOTICE.html').absolutePath
}
dependencies {
......
}
configurations.all {
resolutionStrategy {
.......
}
}
Please help me./(ćoć)/~~
updated my gradle version to 7.3.3.
I finally solved it by updata Android Studio to newest version....
I don't know what happend definitely.
I was trying to publish a snapshot of a branch as a jitpack library, but during the build (initiated by jitpack) this error comes up in the logs when I click on get in the jitpack website.
What went wrong:
Execution failed for task ':openmrs-client:validateSigningRelease'.
Keystore file '/home/jitpack/build/release.keystore' not found for signing config 'release'.
I saw the build.gradle file as far as I can understand the release build depends upon the environment variables in travis. then how do I upload this snapshot to jitpack library?
I have seen most of the tutorials but none of them covers up this case :(
settings.gradle
include ':openmrs-android-sdk'
include ':openmrs-client'
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
ext.safeargs_version = '2.3.0'
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$safeargs_version"
classpath "com.hiya:jacoco-android:0.2"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
app level build.gradle
buildscript {
repositories {
jcenter()
maven {url 'https://oss.sonatype.org/content/repositories/snapshots'}
}
dependencies {
classpath 'com.github.triplet.gradle:play-publisher:2.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}
}
plugins {
id 'com.android.application'
id 'com.github.triplet.play' version '2.2.1'
id 'kotlin-android'
id 'kotlin-android-extensions'
// TODO AC-861
//id 'jacoco-android'
id 'com.hiya.jacoco-android'
}
apply from: './versions.gradle'
apply plugin: "androidx.navigation.safeargs"
def version = versions.appVersion
def GOOGLE_PLACE_API_KEY = System.getenv('GOOGLE_PLACE_API_KEY') ?: "YOUR_API_KEY"
android {
compileSdkVersion versions.compileSdk
def travisBuildNumber = System.getenv("TRAVIS_BUILD_NUMBER")
def buildNumber = (travisBuildNumber) ? (travisBuildNumber as int) : 1
def applicationVersion = version
def travisTag = System.getenv("TRAVIS_TAG")
def buildVersionName = (travisTag) ? travisTag : applicationVersion + "-debug." + buildNumber
defaultConfig {
applicationId "org.openmrs.mobile"
versionName buildVersionName
versionCode buildNumber
multiDexEnabled true
minSdkVersion versions.minSdk
targetSdkVersion versions.targetSdk
testApplicationId "org.openmrs.mobile.test"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
vectorDrawables.useSupportLibrary = true
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
manifestPlaceholders = [
GOOGLE_PLACE_API_KEY: GOOGLE_PLACE_API_KEY
]
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}
signingConfigs {
release {
storeFile rootProject.file('release.keystore')
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias System.getenv("KEYSTORE_ALIAS_NAME")
keyPassword System.getenv("KEYSTORE_ALIAS_PASS")
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
debug {
testCoverageEnabled true
}
}
lintOptions {
warning 'InvalidPackage'
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/rxjava.properties'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
testOptions {
unitTests {
returnDefaultValues = true
includeAndroidResources = true
}
}
buildFeatures {
viewBinding = true
}
}
repositories {
maven { url 'http://yanzm.github.io/MaterialTabHost/repository' }
mavenCentral()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
}
dependencies {
// Android sdk library dependency
implementation project(path: ':openmrs-android-sdk')
//more dependencies....
}
library module build.gradle
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
}
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
minSdkVersion 17
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
dependencies {
//.. some dependencies..
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
from components.release
groupId = 'com.openmrs.AndroidSDK'
artifactId = 'final'
version = '1.0.0'
}
debug(MavenPublication) {
from components.debug
groupId = 'com.openmrs.AndroidSDK'
artifactId = 'final-debug'
version = '1.0.0'
}
}
}
}
}
I am updating the dependencies in my android project. It is a multi-module project with clean architecture.
I have updated all the firebase library versions but whenever I change the com.google.gms:google-services the version from 4.1.0 to 4.2.0 Gradle sync fails with error code 1.
Here is the log of the IDE errors --
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at com.google.android.gms.dependencies.DependencyInspector.registerDependencies(DependencyInspector.java:118)
at com.google.android.gms.dependencies.DependencyInspector.afterResolve(DependencyInspector.java:173)
at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:370)
at org.gradle.internal.event.DefaultListenerManager$ListenerDetails.dispatch(DefaultListenerManager.java:352)
at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
2019-03-30 21:54:24,345 [ thread 70] INFO - System.util.ExternalSystemUtil - External project [/Users/d/C/A] resolution task executed in 4840 ms.
2019-03-30 21:54:24,345 [ thread 70] WARN - ect.sync.idea.ProjectSetUpTask - 1
2019-03-30 21:54:24,345 [ thread 70] INFO - e.project.sync.GradleSyncState - Gradle sync failed: 1
Project level Gradle file --
apply from: 'buildsystem/dependencies.gradle'
apply plugin: 'kotlin'
buildscript {\
ext.kotlin_version = '1.3.21'
repositories {
google()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
//maven { url 'https://dl.bintray.com/android/android-tools' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.+'
classpath "io.realm:realm-gradle-plugin:5.9.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6"
}
}
allprojects {
ext {
androidProductionApplicationId = '****'
androidStagingApplicationId = '****'
androidVersionCode = 264
androidVersionName = "3.0.0-beta"
}
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
apply plugin: "org.sonarqube"
sonarqube {
properties {
property "sonar.host.url", "http://sonar.****.com/"
property "sonar.login", "*****"
property "sonar.projectKey", "android_test"
property "sonar.language", "java"
property "sonar.sources", "src/main"
}
}
App level Gradle file ---
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-kapt'
repositories {
google() //google's maven repo to use firebase and other google services
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
flatDir {
dirs 'libs'
}
jcenter()
}
android {
def globalConfiguration = rootProject.extensions.getByName("ext")
signingConfigs {
config {
keyAlias 'MyReleaseKey'
keyPassword '****'
storeFile file('../buildsystem/keystore.release.jks')
storePassword '****'
}
debugconfig {
keyAlias 'MyDebugKey'
keyPassword '****'
storeFile file('../buildsystem/keystore.debug.jks')
storePassword '****'
}
}
compileSdkVersion globalConfiguration.getAt("androidCompileSdkVersion")
buildToolsVersion = globalConfiguration.getAt("androidBuildToolsVersion")
defaultConfig {
applicationId globalConfiguration.getAt("androidProductionApplicationId")
versionCode globalConfiguration.getAt("androidVersionCode")
versionName globalConfiguration.getAt("androidVersionName")
minSdkVersion globalConfiguration.getAt("androidMinSdkVersion")
targetSdkVersion globalConfiguration.getAt("androidTargetSdkVersion")
multiDexEnabled true
defaultConfig {
ndk {
abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
}
}
vectorDrawables.useSupportLibrary = true
resConfigs "en"
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
'proguard-rules-presentation.txt'
signingConfig signingConfigs.config
resValue 'bool', 'GHOST_ENABLE', "false"
}
debug {
debuggable true
signingConfig signingConfigs.debugconfig
resValue 'bool', 'GHOST_ENABLE', "true"
}
}
flavorDimensions "default"
productFlavors {
staging {
applicationId globalConfiguration.getAt("androidStagingApplicationId")
resValue 'bool', 'CAN_CHANGE_HOST', "true"
}
production {
applicationId globalConfiguration.getAt("androidProductionApplicationId")
resValue 'bool', 'CAN_CHANGE_HOST', "false"
}
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
useLibrary 'org.apache.http.legacy'
bundle {
language {
enableSplit = false
}
}
androidExtensions {
experimental = true
}
}
sonarqube {
properties {
property "sonar.java.binaries", "build/intermediates/classes/staging/debug"
}
}
dependencies {
def presentationDependencies = rootProject.ext.presentationDependencies
implementation files('libs/YouTubeAndroidPlayerApi.jar')
implementation project(':data')
implementation project(':domain')
implementation(presentationDependencies.crashlytics) {
transitive = true;
}
implementation(presentationDependencies.multidex)
api(presentationDependencies.gson)
implementation(presentationDependencies.gcm)
implementation(presentationDependencies.fcm)
implementation(presentationDependencies.jsoup)
implementation(presentationDependencies.mixpanel)
implementation(presentationDependencies.facebook)
implementation(presentationDependencies.branch)
implementation(presentationDependencies.cardview)
implementation(presentationDependencies.recyclerview)
implementation(presentationDependencies.fab2)
implementation(presentationDependencies.design)
// implementation(presentationDependencies.appindexing)
implementation(presentationDependencies.eventbus)
implementation(presentationDependencies.exo)
implementation(presentationDependencies.firebaseauth)
implementation(presentationDependencies.firebasedatabase)
implementation(presentationDependencies.firebaseconfig)
implementation(presentationDependencies.firbaseinvites)
kapt(presentationDependencies.daggerCompiler)
implementation(presentationDependencies.rxAndroid)
implementation(presentationDependencies.rxJava2)
implementation(presentationDependencies.rxAndroid2)
implementation(presentationDependencies.butterKnife)
kapt(presentationDependencies.butterKnifeCompiler)
implementation(presentationDependencies.adapterDelegates)
implementation(presentationDependencies.firebaseCore)
implementation(presentationDependencies.fresco)
implementation(presentationDependencies.frescoAnimatedGif)
implementation(presentationDependencies.volley)
implementation(presentationDependencies.dagger)
implementation(presentationDependencies.isoparser)
implementation(presentationDependencies.kotlin)
implementation(presentationDependencies.lifecycle)
implementation(presentationDependencies.appCompat)
implementation(presentationDependencies.facebookShare)
implementation(presentationDependencies.placeAutoComplete)
implementation(presentationDependencies.googlePlayServiceAuth)
implementation(presentationDependencies.realmAdapters)
implementation(presentationDependencies.socketIo) {
exclude group: 'org.json', module: 'json'
}
implementation(presentationDependencies.lifecycleExtensions)
kapt (presentationDependencies.lifecycleCompiler)
implementation(presentationDependencies.constraintLayout)
}
apply plugin: 'com.google.gms.google-services'
This is the full error:
Error:Execution failed for task ':app:transformClassesWithMultidexlistForPrpDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.multidex.ClassReferenceListBuilder with arguments {/Users/user/Documents/Repositories/secret/secret/app/build/intermediates/multi-dex/prp/debug/componentClasses.jar /Users/user/Documents/Repositories/secret/secret/app/build/intermediates/transforms/jarMerging/prp/debug/jars/1/1f/combined.jar}
I have added a library to my gradle build (https://github.com/signalr4j/signalr4j). Since that the project compiles and builds but once I press run I receive that error. Please note that the library is implemented and recognized well.
This is the full gradle code:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.0'
}
}
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'newrelic'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://maven.google.com' }
maven { url 'https://jitpack.io' }
}
greendao {
schemaVersion 1
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
//
// Setting the heap size the largest size possible.
dexOptions {
javaMaxHeapSize "4g"
jumboMode true
}
defaultConfig {
applicationId "secret.app.com"
minSdkVersion 19
targetSdkVersion 25
versionCode 665
versionName "1.7.0.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
productFlavors {
prp {
buildConfigField 'String', 'ORGANIC_GATEWAY', '""'
}
production {
buildConfigField 'String', 'ORGANIC_GATEWAY', '""'
}
myapp {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"X"'
}
mumayi {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"Y"'
}
zhushou_360 {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"J"'
}
zhushou_sogou {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"Z"'
}
directlink {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"A"'
}
letv {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"B"'
}
xiaomi {
buildConfigField 'String', 'ORGANIC_GATEWAY', '"C"'
}
}
applicationVariants.all { variant ->
//
// Application variable instantiation code
if (variant.productFlavors[0].name == "prp") {
buildConfigField 'boolean', 'isInDebugMode', 'true'
buildConfigField 'boolean', 'shouldShowLoginShortcut', 'true'
} else {
buildConfigField 'boolean', 'isInDebugMode', 'false'
buildConfigField 'boolean', 'shouldShowLoginShortcut', 'false'
}
//
// Application naming code
variant.outputs.each { output ->
def project = "Secret"
def separator = "_"
def flavor = variant.productFlavors[0].name
def version = variant.versionName
def versionBuildNumber = variant.versionCode
def buildName = variant.getBuildType().name
if (flavor == "production" && buildName == "release") {
flavor = "PlayStore"
}
def newApkName =
project +
separator +
version + "(" + versionBuildNumber + ")" +
separator +
flavor + "(" + buildName + ")" +
".apk"
output.outputFile = new File(output.outputFile.parent, newApkName)
}
}
}
ext.googleLibraryVersion = '25.4.0'
ext.firebaseAndPlayServicesLibraryVersion = '11.8.0'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true
}
compile 'com.android.support:multidex:1.0.1'
compile "com.android.support:appcompat-v7:$googleLibraryVersion"
compile "com.android.support:recyclerview-v7:$googleLibraryVersion"
compile "com.android.support:support-v4:$googleLibraryVersion"
compile "com.android.support:design:$googleLibraryVersion"
compile "com.android.support:gridlayout-v7:$googleLibraryVersion"
compile "com.android.support:support-annotations:$googleLibraryVersion"
compile "com.google.firebase:firebase-core:$firebaseAndPlayServicesLibraryVersion"
compile "com.google.firebase:firebase-messaging:$firebaseAndPlayServicesLibraryVersion"
compile 'me.pushy:sdk:1.0.28'
compile "com.google.android.gms:play-services-gcm:$firebaseAndPlayServicesLibraryVersion"
compile "com.google.android.gms:play-services-analytics:$firebaseAndPlayServicesLibraryVersion"
compile 'com.appsflyer:af-android-sdk:4.7.1'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.newrelic.agent.android:android-agent:5.13.0'
compile 'org.greenrobot:greendao:3.2.2'
compile 'at.wirecube:additive_animations:1.5.0'
compile 'com.github.tsurkis:timdicator:1.1.0'
compile 'com.github.signalr4j:signalr4j:2.0.1'
}
apply plugin: 'com.google.gms.google-services'
This is the general gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
classpath "com.newrelic.agent.android:agent-gradle-plugin:5.13.0"
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have browsed the internet for half a day and none of the answers fit. Could the library be flawed?
I've just updated my android gradle plugin from 0.12 to 0.13. Moreover I've downloaded gradle 2.1. Then, I tried with android studio 0.8.9 in beta but according http://tools.android.com/tech-docs/new-build-system/version-compatibility I have to use at least android studio 0.8.11 (canary channel). So I've updated my android studio but I have still the problem.
For now, I have to use gradle 1.10 and android gradle plugin 0.12.+ to work
Here the error from AS
Error:No such property: projectDependencies for class: com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated
Edit :
Here is my build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
// works with 0.12.+ (not with 0.13.+)
classpath 'com.android.tools.build:gradle:0.12.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// The latest version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3'
}
}
allprojects {
repositories {
maven { // For Android-ViewPagerIndicator
url "http://dl.bintray.com/populov/maven"
}
jcenter()
mavenCentral()
maven {
url "http://JRAF.org/static/maven/2"
}
}
}
Here is my gradle-wrapper.properties
#Fri Sep 19 17:50:42 CEST 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
# use gradle-2.1-all.zip with android gradle plugin 0.13
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
EDIT 2 :
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId 'xxx'
minSdkVersion 10
targetSdkVersion 19
versionCode xxx
versionName 'xxx'
}
// For more information see
// #link http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Using-sourceCompatibility-1.7
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
signingConfigs {
debug {
storeFile file('../../KeyStore/debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
storeFile file('xxx')
storePassword 'xxx'
keyAlias 'xxx'
keyPassword 'xxx'
}
}
buildTypes {
// Just intern. This is alpha build
debug {
buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false" // can be set to true in debug but not in other buildTypes
buildConfigField "boolean", "ENABLE_LOG", "true"
buildConfigField "String", "HOST", "\"xxx\""
versionNameSuffix '-alpha'
signingConfig signingConfigs.debug
zipAlign true
}
// For customer
recette {
buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
buildConfigField "boolean", "ENABLE_LOG", "false"
buildConfigField "String", "HOST", "\"xxx\""
versionNameSuffix '-recette'
signingConfig signingConfigs.debug
zipAlign true
}
// PreProd
preprod {
buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
buildConfigField "boolean", "ENABLE_LOG", "false"
buildConfigField "String", "HOST", "\"xxx\""
signingConfig signingConfigs.debug
zipAlign true
}
// Prod
release {
buildConfigField "boolean", "FORCE_GOOG_GEO_API", "false"
buildConfigField "boolean", "ENABLE_LOG", "false"
buildConfigField "String", "HOST", "\"xxx\""
signingConfig signingConfigs.release
zipAlign true
runProguard true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
}
}
// This is important, it will run lint checks but won't abort build
lintOptions {
abortOnError false
disable 'MissingTranslation'
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'AndroidManifest.xml'
}
}
apt {
arguments {
resourcePackageName android.defaultConfig.packageName
androidManifestFile variant.processResources.manifestFile
}
}
def GoogPlayServVersion = '5.0.+';
def GsonVersion = '2.2.4';
def LibPhoneNumbVersion = '5.9';
def GreenRobotVersion = '2.2.1';
def OkHttpVersion = '2.0.0';
def OkHttpConnVersion = '2.0.0';
def JacksonCore = '2.4.1';
def JacksonDatabind = '2.4.1';
def JacksonAnnotations = '2.4.0';
def SwitchVersion = '1.3.1';
def CroutonVersion = '1.8.4';
def ActionBarSherlockVersion = '4.4.0';
def ViewpagerIndicatorVersion = '2.4.1';
def PicassoVersion = '2.3.4';
def RoboSpiceVersion = '1.4.12';
def StickyListHeaders = '2.4.1';
def AAVersion = '3.1';
def RobotiumVersion = '5.2.1';
dependencies {
// Include all jar in libs folder
compile fileTree(dir: 'libs', include: ['*.jar'])
// Google Play Services
compile "com.google.android.gms:play-services:$GoogPlayServVersion"
// Gson
compile "com.google.code.gson:gson:$GsonVersion"
// LibphoneNumber
compile "com.googlecode.libphonenumber:libphonenumber:$LibPhoneNumbVersion"
// GreenRobot
compile "de.greenrobot:eventbus:$GreenRobotVersion"
// OkHttp [We use repackaged version #see https://github.com/square/okhttp/issues/967]
// compile "com.squareup.okhttp:okhttp:$OkHttpVersion"
// compile "com.squareup.okhttp:okhttp-urlconnection:$OkHttpConnVersion"
// Jackson
compile "com.fasterxml.jackson.core:jackson-core:$JacksonCore"
compile "com.fasterxml.jackson.core:jackson-databind:$JacksonDatabind"
compile "com.fasterxml.jackson.core:jackson-annotations:$JacksonAnnotations"
// Switch backport
compile "org.jraf:android-switch-backport:$SwitchVersion"
// Crouton lib
compile("de.keyboardsurfer.android.widget:crouton:$CroutonVersion") {
// exclusion is not neccessary, but generally a good idea.
exclude group: 'com.google.android', module: 'support-v4'
}
// You must install or update the Support Repository through the SDK manager to use this dependency.
// The Support Repository (separate from the corresponding library) can be found in the Extras category.
// compile 'com.android.support:support-v4:19.1.0'
// compile 'com.android.support:gridlayout-v7:19.1.0'
// ActionBarSherlock
compile "com.actionbarsherlock:actionbarsherlock:$ActionBarSherlockVersion#aar"
// Android-ViewPagerIndicator
compile "com.viewpagerindicator:library:$ViewpagerIndicatorVersion#aar"
// Picasso
compile "com.squareup.picasso:picasso:$PicassoVersion"
// Robospice
compile "com.octo.android.robospice:robospice:$RoboSpiceVersion"
// StickyList headers
compile "se.emilsjolander:stickylistheaders:$StickyListHeaders"
// Facebook sdk
compile 'fr.avianey:facebook-android-api:+#aar'
// android annotations
compile "org.androidannotations:androidannotations-api:$AAVersion"
apt "org.androidannotations:androidannotations:$AAVersion"
compile 'com.sothree.slidinguppanel:library:+'
// Tests part
androidTestCompile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion"
compile "com.jayway.android.robotium:robotium-solo:$RobotiumVersion"
}
Do you know how can I solve this ?
Thx
android-apt 1.3 doesn't seem to be compatible with v0.13 of the Android Gradle plugin. Please use android-apt 1.4 instead:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}