openedx-unsupported / edx-app-android

The Open edX mobile app for Android!
https://docs.google.com/document/d/15MYZ2LAmahB82P5wkPkQOqjszfou0Qkeae3qz7STxUQ/edit
Apache License 2.0
301 stars 333 forks source link

Caused by: groovy.lang.MissingMethodException: No signature of method: java.io.File.plus() #1165

Closed Praveenvermatech closed 5 years ago

Praveenvermatech commented 6 years ago

When i setup edx-app-android in my project. I found a issue,In my logcat err Log like this:

org.gradle.api.GradleScriptException: A problem occurred evaluating project ':OpenEdXMobile'.
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:199)
    at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
    at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:204)
    at org.gradle.configuration.BuildOperationScriptPlugin$1.run(BuildOperationScriptPlugin.java:61)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.configuration.BuildOperationScriptPlugin.apply(BuildOperationScriptPlugin.java:58)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:41)
    at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:26)
    at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:64)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
    at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:666)
    at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:135)
    at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
    at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
    at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
    at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:249)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:167)
    at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:126)
    at org.gradle.initialization.DefaultGradleLauncher.getConfiguredBuild(DefaultGradleLauncher.java:104)
    at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:87)
    at org.gradle.internal.invocation.GradleBuildController$2.call(GradleBuildController.java:84)
    at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
    at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
    at org.gradle.internal.invocation.GradleBuildController.configure(GradleBuildController.java:84)
    at org.gradle.tooling.internal.provider.runner.ClientProvidedBuildActionRunner.run(ClientProvidedBuildActionRunner.java:64)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
    at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
    at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
    at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
    at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
    at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
    at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
    at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
    at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
    at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
    at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
    at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
    at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
    at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
    at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
    at org.gradle.util.Swapper.swap(Swapper.java:38)
    at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
    at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
    at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
    at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
    at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
    at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
    at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)
Caused by: groovy.lang.MissingMethodException: No signature of method: java.io.File.plus() is applicable for argument types: (java.lang.String) values: [ not found. Skipping.]
Possible solutions: list(), list(java.io.FilenameFilter), split(groovy.lang.Closure), use([Ljava.lang.Object;), is(java.lang.Object), wait()
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
    at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
    at org.edx.builder.TaskHelper.loadConfig(TaskHelper.groovy:27)
    at org.edx.builder.TaskHelper$loadConfig.call(Unknown Source)
    at build_2kn6r2umw70ksrp07qbq2kwrg.run(/home/praveen/praveenData/development/CoachEnggApplication/OpenEdXMobile/build.gradle:233)
    at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:90)
    ... 97 more

My android studio configuration: Android Studio 3.2.1 JRE: 1.8.0_152-release-1136-b06 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.15.0-36-generic Using dependencies version: classpath 'com.android.tools.build:gradle:3.2.1' I have attached screen shot in my android studio. screenshot

ankushgupta1393 commented 6 years ago

@miankhalid @farhan Can you please check and suggest a solution?

farhan commented 6 years ago

Please try, one of them may work: 1) run './gradlew clean' command on terminal 2) Refresh all gradle projects from Gradle tab 3) Rebuild the project from 'Build->Rebuild Project'

miankhalid commented 6 years ago

Also, can you verify:

miankhalid commented 6 years ago

I tried your configuration i.e. I did the following:

constants.gradle

project.ext {
    GRADLE_PLUGIN_VERSION = "3.2.1"
    BUILD_TOOLS_VERSION = "28.0.3"
    SUPPORT_LIBRARY_VERSION = "27.1.1"
    COMPILE_SDK_VERSION = 27
    // API Level that the application will target
    TARGET_SDK_VERSION = 27
    // Minimum API Level required for the application to run
    MIN_SDK_VERSION = 19
......

and gradle/wrapper/gradle-wrapper.properties

#Mon Nov 05 16:37:31 PKT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

and everything worked fine on the repo's current master branch.

Praveenvermatech commented 6 years ago

@miankhalid I am tried your given configuration like this:

project.ext {
    GRADLE_PLUGIN_VERSION = "3.2.1"
    BUILD_TOOLS_VERSION = "28.0.3"
    SUPPORT_LIBRARY_VERSION = "27.1.1"
    COMPILE_SDK_VERSION = 27
    // API Level that the application will target
    TARGET_SDK_VERSION = 27
    // Minimum API Level required for the application to run
    MIN_SDK_VERSION = 19

......................................

But my problem is not resolved, same problem occure. I am also used clean and rebuild project and also tried invalidate cache and restart the Android Studio, but not resolved.

miankhalid commented 6 years ago

Can you paste the content of your buildSrc/build.gradle file?

Praveenvermatech commented 6 years ago

I have mentioned below All build.gradle file. buildSrc/build.gradle

`buildscript { repositories { mavenCentral() } }

subprojects { apply plugin: "groovy"

rootProject.dependencies {
    it.runtime project(path)
}

it.repositories {
    mavenCentral()
}

it.dependencies {
    // These should really be under the projects themselves,
    // but when building on travis
    // the per project dependencies didn't seem to
    // get picked up. We only have one buildSrc plugin
    // so it doesn't really matter, but if we ever get more
    // we should figure this out
    compile 'org.codehaus.groovy:groovy-all:2.4.12'
    compile gradleApi()
    compile 'org.yaml:snakeyaml:1.14'
}

}

repositories { mavenCentral() }

**openEdxMobile/build.gradle:** import groovy.json.JsonBuilder import org.edx.builder.TaskHelper

buildscript { repositories { google() jcenter() mavenCentral() maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url 'https://maven.fabric.io/public' } }

dependencies {
    classpath 'org.yaml:snakeyaml:1.14'

    //Included for NewRelic
    classpath "com.newrelic.agent.android:agent-gradle-plugin:5.4.1"

    classpath 'com.facebook.testing.screenshot:plugin:0.4.2'
    classpath 'com.google.gms:google-services:4.0.1'
}

}

apply plugin: 'edxapp' edx { platform = ANDROID }

apply plugin: 'com.android.application' apply plugin: 'newrelic' apply plugin: 'com.facebook.testing.screenshot' apply from: 'jacoco.gradle'

class AndroidHelper { static def saveProcessedConfig(project, config) { def path = project.file('assets/config') path.mkdirs() def jsonWriter = new FileWriter(path.absolutePath + '/config.json') def builder = new JsonBuilder(config) jsonWriter.withWriter { builder.writeTo(it) } } }

/**

/**

task(version) << { println String.format('%s (%s)', getVersionName(), getVersionCode()) }

dependencies { implementation fileTree(dir: 'libs', include: '*.jar')

implementation project (':android-iconify')
// Note that we have the Font Awesome TTF file
// in the local assets as well, to enable the
// graphical layout editor to render it. Since
// that is what will be compiled in the APK now,
// we need to ensure that it's updated along
// with module updates.
implementation project (':android-iconify-fontawesome')

implementation "com.android.support:appcompat-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:recyclerview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:cardview-v7:${SUPPORT_LIBRARY_VERSION}"
implementation "com.android.support:design:${SUPPORT_LIBRARY_VERSION}"
// For the optional Nullable annotation
implementation "com.android.support:support-annotations:${SUPPORT_LIBRARY_VERSION}"

implementation "com.google.android.gms:play-services-plus:16.0.0"
implementation "com.google.android.gms:play-services-analytics:16.0.4"
implementation "com.google.android.gms:play-services-auth:16.0.1"
implementation "com.google.android.gms:play-services-ads:17.0.0"
// Google Firebase
implementation "com.google.firebase:firebase-core:16.0.4"
implementation "com.google.firebase:firebase-messaging:17.3.4"
implementation 'com.paytm:pgplussdk:1.1.2'

implementation 'com.facebook.android:facebook-android-sdk:3.23.1'
implementation 'com.google.code.gson:gson:2.7'
implementation 'de.greenrobot:eventbus:2.4.1'
implementation 'com.squareup.phrase:phrase:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.0.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.0.1'
/* Exclude dependencies defined statically at the top-
 * level, to prevent them from being resolved to the
 * latest version as a result of dynamic version
 * definitions in the transitive dependencies.
 */
implementation ('com.squareup.retrofit2:retrofit:2.1.0') {
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}
implementation ('com.squareup.retrofit2:converter-gson:2.1.0') {
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    exclude group: 'com.google.code.gson', module: 'gson'
}
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation ('com.github.bumptech.glide:okhttp3-integration:1.4.0'){
    exclude group: 'glide-parent'
}

implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'uk.co.chrisjenx:calligraphy:2.1.0'

// Segment Library
implementation 'com.segment.analytics.android:analytics:4.2.6'

implementation('com.segment.analytics.android.integrations:google-analytics:1.0.0') {
    exclude module: 'play-services-analytics'
    transitive = true
}

// Branch SDK
// Check this link for guide to updating Branch integration:
// https://github.com/BranchMetrics/android-branch-deep-linking

//New Relic Integration
implementation 'com.newrelic.agent.android:android-agent:5.4.1'

//Include DI framework
implementation 'org.roboguice:roboguice:3.0.1'
compileOnly 'org.roboguice:roboblender:3.0.1'

// test project configuration
testImplementation 'junit:junit:4.12'
testImplementation ("org.mockito:mockito-core:1.10.19"){
    exclude group: 'org.hamcrest'
}
testImplementation 'commons-lang:commons-lang:2.6'
testImplementation "org.robolectric:robolectric:3.0"
testImplementation "org.robolectric:shadows-support-v4:3.0"
testImplementation "org.robolectric:shadows-multidex:3.0"
testImplementation 'org.assertj:assertj-core:2.5.0'
testImplementation ('com.squareup.assertj:assertj-android:1.1.1') {
    exclude group: 'com.android.support'
}
testImplementation ('com.squareup.assertj:assertj-android-support-v4:1.1.1') {
    exclude group: 'com.android.support'
}
testImplementation ('com.squareup.assertj:assertj-android-appcompat-v7:1.1.1') {
    exclude group: 'com.android.support'
}
testImplementation 'com.squareup.okhttp3:mockwebserver:3.0.1'
testImplementation ('com.squareup.retrofit2:retrofit-mock:2.1.0') {
    exclude group: 'com.squareup.okhttp3', module: 'okhttp'
}

androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test:rules:1.0.1'
androidTestImplementation 'org.hamcrest:hamcrest-library:1.3'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation "com.crittercism.dexmaker:dexmaker:1.4"
androidTestImplementation "com.crittercism.dexmaker:dexmaker-mockito:1.4"
androidTestImplementation ("org.mockito:mockito-core:1.10.19"){
    exclude group: 'org.hamcrest'
}

}

configurations { androidTestImplementation.exclude group: 'com.android.support', module: 'support-annotations' androidTestImplementation.exclude group: 'com.android.support', module: 'multidex' androidTestImplementation.exclude group: 'javax.inject' androidTestImplementation.exclude group: 'javax.annotation' }

def config = new TaskHelper().loadConfig(project) def firebase = config.get('FIREBASE') def firebaseEnabled = firebase?.get('ENABLED') if (true) { apply plugin: 'com.google.gms.google-services' }

android { signingConfigs { releasekey { storeFile file(RELEASE_STORE_FILE) storePassword RELEASE_STORE_PASSWORD keyAlias RELEASE_KEY_ALIAS keyPassword RELEASE_KEY_PASSWORD } }

compileSdkVersion COMPILE_SDK_VERSION
buildToolsVersion BUILD_TOOLS_VERSION

dataBinding {
    enabled = true
}

dexOptions {
    javaMaxHeapSize "2g"
}

flavorDimensions "default"

defaultConfig {
    applicationId "com.rdnc.coachengg"
    // minimum version is Android 4.1
    minSdkVersion 14
    targetSdkVersion TARGET_SDK_VERSION

    versionCode 2016007
    versionName "2.16.7"

    renderscriptTargetApi 22
    renderscriptSupportModeEnabled true

    vectorDrawables.useSupportLibrary = true

    // test configuration
    testApplicationId 'org.edx.mobile.test'

    if (project.gradle.startParameter.taskNames.contains("screenshotTests")) {
        Map<String, String> map = new HashMap<String, String>();
        map.put("package", "org.edx.mobile.test.screenshot");
        setTestInstrumentationRunnerArguments map
    }

    testInstrumentationRunner "org.edx.mobile.test.EdXTestRunner"

    testHandleProfiling true
    testFunctionalTest true
    testBuildType "debuggable"

    // Enabling multidex support.
    multiDexEnabled true

    def platformName = config.get('PLATFORM_NAME')
    resValue "string", "platform_name", platformName

    def appShortcutName = config.get('APP_SHORTCUT_NAME')
    if (appShortcutName == null) {
        appShortcutName = platformName
    }
    resValue "string", "shortcut_name", appShortcutName

    def phoneticPlatformName = config.get('PHONETIC_PLATFORM_NAME')
    if (phoneticPlatformName == null) {
        phoneticPlatformName = platformName
    }
    resValue "string", "phonetic_platform_name", phoneticPlatformName

    manifestPlaceholders = [supportsRtl:"false",
                            firebaseEnabled: firebaseEnabled?: false,
                            branchKey: "a"]

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath false
        }
    }
}
sourceSets {
    main {
        manifest.srcFile 'AndroidManifest.xml'
        java.srcDirs = ['src/main/java']
        resources.srcDirs = ['src/main/java']
        aidl.srcDirs = ['src/main/java']
        renderscript.srcDirs = ['src/main/java']
        res.srcDirs = ['res']
        assets.srcDirs = ['assets']
    }

    // Move the build types to build-types/<type>
    // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml.
    // This moves them out of default location under src/<type>/... which would
    // conflict with src/ being used by the main source set.
    // Adding new build types or product flavors should be accompanied
    // by a similar customization.
    debug.setRoot('build-types/debug')
    release.setRoot('build-types/release')

    if (project.hasProperty('RES_DIR')) {
        prod.res.srcDirs = [RES_DIR]
    }

    if (project.hasProperty('ASSETS')) {
        prod.assets.srcDirs = [ASSETS]
    }

    String sharedTestDir = 'src/sharedTest/java'
    test {
        java.srcDir sharedTestDir
    }
    androidTest {
        java.srcDir sharedTestDir
    }
}

lintOptions {
    checkReleaseBuilds false
    abortOnError true
    showAll true
    warning 'TypographyQuotes', 'InvalidPackage'
    error 'StopShip', 'ContentDescription'
    /**
     * This is a bug that is fixed in the up-coming Android Studio 2.4 release.
     * Link to issue: https://issuetracker.google.com/issues/37630182
     */
    //TODO: Remove GradleCompatible after we upgrade to Android Studio 2.4
    disable 'GradleCompatible'
}

productFlavors {
    prod {
        if (project.hasProperty('APPLICATION_ID')) {
            applicationId APPLICATION_ID
        }
    }
}

buildTypes {
    debug {
        testCoverageEnabled true
        pseudoLocalesEnabled true // Set device language to "en_XA" to test glyphs, or "ar_XB" to test RTL support
        manifestPlaceholders = [ supportsRtl:"true"]
    }
    debuggable.initWith(buildTypes.debug)
    debuggable {
        testCoverageEnabled = false // Set to "false" to work around debugger issue: https://code.google.com/p/android/issues/detail?id=123771
        matchingFallbacks = ["debug"]
    }

    release {
        signingConfig signingConfigs.releasekey
        applicationVariants.all { variant ->
            variant.outputs.all { output ->
                project.ext { appName = 'edx' }
                outputFileName  = "${project.ext.appName}-${variant.buildType.name}-${versionName}.apk"
            }
        }
    }
}

packagingOptions {
    exclude 'LICENSE.txt'
    exclude 'APK LICENSE.txt'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
}
testOptions {
    unitTests.all {
        maxHeapSize '1g'
    }
}

}

android.applicationVariants.all { variant -> def variantName = variant.name.capitalize() def taskName = "applyConfig" + variantName def configureTask = project.task(taskName) << { def helper = new AndroidHelper() helper.saveProcessedConfig(project, config) } def generateTask = project.tasks.getByName("generate" + variantName + "Resources") generateTask.dependsOn(configureTask)

tasks.all {task ->
    if (task.name.startsWith("test")) {
        task.mustRunAfter(configureTask)
    }
}

}

screenshots { testApkTarget = 'packageProdDebuggableAndroidTest' connectedAndroidTestTarget = 'connectedProdDebuggableAndroidTest' }`

myProject/build.gradle:

`// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() // This is the default repo mavenCentral() // This is the Maven Central repo maven { url 'https://maven.google.com/' name 'Google' } google() } dependencies { classpath 'com.android.tools.build:gradle:3.1.3' classpath 'com.google.gms:google-services:4.0.1' } }

allprojects { repositories { jcenter() maven { url 'https://maven.google.com/' name 'Google' } } }

project.ext { GRADLE_PLUGIN_VERSION = "3.1.3" BUILD_TOOLS_VERSION = "27.0.3" SUPPORT_LIBRARY_VERSION = "27.1.1" COMPILE_SDK_VERSION = 27 // API Level that the application will target TARGET_SDK_VERSION = 27 // Minimum API Level required for the application to run MIN_SDK_VERSION = 16

// dummy keystore configuration if not already defined
if ( !project.properties.containsKey("RELEASE_STORE_FILE")) {
    RELEASE_STORE_FILE = "edx-android-release-key.keystore"
    RELEASE_STORE_PASSWORD = "*****"
    RELEASE_KEY_ALIAS = "edx-android-release"
    RELEASE_KEY_PASSWORD = "*****"
}

} // task that creates 'artifacts' directory task createBuildArtifactsDirectory << { task -> def hashPipe = new ByteArrayOutputStream() task.project.exec { commandLine = ['git', 'rev-parse', '--verify', 'HEAD'] standardOutput = hashPipe }

def destDir = "artifacts"
task.project.exec {
    commandLine = ['mkdir', '-p', destDir]
}

}

// Copies unit test reports to the 'artifacts' directory task copyUnitTestBuildArtifacts << { task -> // copy unit test reports def srcPath = "OpenEdXMobile/build/reports" task.project.exec { commandLine = ['cp', '-R', srcPath, 'artifacts'] } } copyUnitTestBuildArtifacts.dependsOn createBuildArtifactsDirectory

// Copies lint report to the 'artifacts' directory task copyLintBuildArtifacts(type: Copy) { from 'OpenEdXMobile/build/outputs' into 'artifacts' include 'lint-results' include 'lint-results/**' } copyLintBuildArtifacts.dependsOn createBuildArtifactsDirectory

// Copies acceptance test reports to the 'artifacts' directory task copyAcceptanceTestBuildArtifacts << { task -> // copy acceptance test reports srcPath = "AcceptanceTests/Test-Reports" task.project.exec { commandLine = ['cp', '-R', srcPath, 'artifacts'] } } copyAcceptanceTestBuildArtifacts.dependsOn createBuildArtifactsDirectory

// Disables preDex which reduces the amount of memory required to build an APK. This is important // for CI where there is a memory limit. PreDex is also not useful in CI where a new build is // desired on every run. project.ext.preDexLibs = !project.hasProperty('disablePreDex')

subprojects { project.plugins.whenPluginAdded { plugin -> if ("com.android.build.gradle.AppPlugin".equals(plugin.class.name)) { project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs } else if ("com.android.build.gradle.LibraryPlugin".equals(plugin.class.name)) { project.android.dexOptions.preDexLibraries = rootProject.ext.preDexLibs } } }

// Increases adb timeout for installing an apk. This tweak is need for slow adb installs on an // emulator for CI. com.android.ddmlib.DdmPreferences.setTimeOut(600000) `

Note: My Android studio version 3.1.4 now. Same Error still now: No signature of method: java.io.File.plus() is applicable for argument types: (java.lang.String) values: [ not found. Skipping.] Possible solutions: list(), list(java.io.FilenameFilter), is(java.lang.Object), split(groovy.lang.Closure), use([Ljava.lang.Object;), wait() Open File

ankushgupta1393 commented 6 years ago

@Praveenvermatech check this, it may help https://github.com/edx/edx-app-ios/issues/1010

ankushgupta1393 commented 6 years ago

@miankhalid @farhan Please check and help, the error is not resolved, the project is not building

miankhalid commented 6 years ago

There are 2 things that come to my mind:

  1. Collapse to the error item in your Build window to end and then share the exact error that you see i.e. do the following (like you did in your first screenshot, but follow the instructions that I just added)

33uph3ma

  1. As mentioned in https://github.com/edx/edx-app-ios/issues/1010, share your configurations and edx.properties file. There's a chance that your configurations might have a problem in them.
Junaid388 commented 5 years ago

I have tried above solutions but nothing is working for me. here is the content of

my_config

edx.android { configFiles = ['shared.yaml','android.yaml'] }

I have tried this also edx.android { configFiles = ['android.yaml'] }

please let me know how to solve this.

miankhalid commented 5 years ago

@Junaid388 can you share the exact problem that you are facing? with some logs and snapshots?

Junaid388 commented 5 years ago

When I am triying to compile the project it is giving error as

No signature of method: java.io.File.plus() is applicable for argument types: (java.lang.String) values: [ not found. Skipping.] Possible solutions: list(), list(java.io.FilenameFilter), is(java.lang.Object), use([Ljava.lang.Object;), split(groovy.lang.Closure), wait()

screenshot from 2018-12-10 15-35-53

miankhalid commented 5 years ago

Have you followed the exact steps as mentioned here? https://github.com/edx/edx-app-android#setup

I think you might be misplacing some files/directories or maybe entering their relative path wrong in the configs.

Junaid388 commented 5 years ago

I have followed the exact procedures and checked the steps multiple times. I am facing the same issues mentioned by @Praveenvermatech

miankhalid commented 5 years ago

Here's how my directory structure looks for configs with respect to project:

My base edx.properties file is placed at:

my_project_directory/edx-app-android/OpenEdXMobile/edx.properties


Text content in edx.properties file:

edx.dir = '../../my_config'


Contents in my_config folder (same as the example given /edx-app-android/OpenEdXMobile/default_config):

config.yaml edx.properties local.yaml

Check to see if yours matches this structure.

Junaid388 commented 5 years ago

My directory structure is same as you mentioned.

edx.properties file is placed at:

Directory/edx-app-android/OpenEdXMobile/edx.properties

every file is in same place as you have mentioned above.

miankhalid commented 5 years ago

The only thing that comes to my mind now is how your configurations are written in the files. For instance, there might be an encoding issue while using the apostrophe ' charcter.

For example: Hamlet's father's ghost (U+0027) Hamlet’s father’s ghost (U+2019)

Ref: http://snowball.tartarus.org/texts/apostrophe.html

Junaid388 commented 5 years ago

@miankhalid Thank you for support. solved the issue. The problem was with android.yaml

miankhalid commented 5 years ago

Great! Care to share the issue and its resolution for the community as well?

miankhalid commented 5 years ago

This issue occurs when there is a typo or path issues in the config files. Feel free to reopen if it's still an issue.

shrivastavaanurag commented 4 years ago

@miankhalid Thank you for support. solved the issue. The problem was with android.yaml

Where is android.yaml, I am not able to find the android.yaml. I am also stuck at here

miankhalid commented 4 years ago

@shrivastavaanurag android.yaml would be the configuration file (which is by default found in ⁨edx-app-android⁩ ▸ ⁨OpenEdXMobile⁩ ▸ ⁨default_config⁩ ▸ ⁨config.yaml).

p.s. You can rename it to anything, and in Junaid388's case he must've renamed it to android.yaml

My suggestion for a fix would be to first verify this suggestion in my earlier comment.

yogskumar commented 2 years ago

Hi All,

This was one of the major issues for the ionic/android app

Please follow the below steps.

1) Remove/Delete node-module from root folder 2) npm uninstall cordova-android 3) npm install cordova-android@10.1.1 4) Now remove android platform using: ionic cordova rm platform android 5) Now add platform : ionic cordova platform add android 6) Build Android Project : ionic cordova build android

Problem will be resolved