Closed Praveenvermatech closed 5 years ago
@miankhalid @farhan Can you please check and suggest a solution?
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'
Also, can you verify:
com.android.tools.build:gradle:3.2.1
to com.android.tools.build:gradle:3.1.3
?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.
@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.
Can you paste the content of your buildSrc/build.gradle
file?
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) } } }
/**
@return The semantic version string, or "0.0.1" if we failed to determine one. */ def getVersionName = { -> def description = "0.0.1" try { def branch = System.getenv("BRANCH") if (null == branch || branch.isEmpty()) { def branchout = new ByteArrayOutputStream() exec { commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD' standardOutput = branchout } branch = branchout.toString().trim() }
def hasSemanticVersion = { s ->
// This branch/tag contains a semantic version (e.g. "rc/2.6.0" or "release/2.5")
return s.indexOf("rc/") >= 0 || s.indexOf("release/") >= 0
}
if (hasSemanticVersion(branch)) {
description = branch
} else {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe'
standardOutput = stdout
}
def describe = stdout.toString().trim()
if (hasSemanticVersion(describe)) {
description = describe
}
}
} catch (e) { logger.error("Could not determine version name", e) } return description.substring(description.indexOf("/") + 1).split("-")[0].trim() }
/**
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
@Praveenvermatech check this, it may help https://github.com/edx/edx-app-ios/issues/1010
@miankhalid @farhan Please check and help, the error is not resolved, the project is not building
There are 2 things that come to my mind:
edx.properties
file. There's a chance that your configurations might have a problem in them.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.
@Junaid388 can you share the exact problem that you are facing? with some logs and snapshots?
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()
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.
I have followed the exact procedures and checked the steps multiple times. I am facing the same issues mentioned by @Praveenvermatech
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.
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.
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)
@miankhalid Thank you for support. solved the issue. The problem was with android.yaml
Great! Care to share the issue and its resolution for the community as well?
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.
@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
@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.
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
When i setup edx-app-android in my project. I found a issue,In my logcat err Log like this:
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