{ "id": "174893", "key": "TIMOB-27835", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2020-04-08T16:01:47.000+0000", "created": "2020-04-07T12:37:06.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "20033", "name": "Release 9.0.0", "archived": false, "released": true, "releaseDate": "2020-03-18" }, { "id": "20950", "name": "Release 9.1.0", "archived": false, "released": true, "releaseDate": "2020-08-25" } ], "issuelinks": [], "assignee": null, "updated": "2020-04-08T16:01:51.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h5.Description\r\n\r\nWhen providing an extra maven repository that provides a dependency in a modules build.gradle file, when building an application that uses that dependency cannot be resolved.\r\n\r\n*Workaround*:\r\n\r\nIn your application, add a build.gradle to {{platform/android}} (classic) or {{app/platform/android}} (alloy) that contains the repository definition. \r\n\r\nh5.Steps to reproduce\r\n\r\n1. Copy the below to a build.gradle file in a module\r\n{code}\r\nallprojects {\r\n\trepositories {\r\n\t\tmaven { url 'https://dl.bintray.com/radiusnetworks/flybuy-sdk'}\r\n\t}\r\n}\r\ndependencies {\r\n\timplementation \"com.radiusnetworks.flybuy:sdk:1.1.1\"\r\n\timplementation \"com.radiusnetworks.flybuy:api:1.1.1\"\r\n}\r\n\r\n{code}\r\n2. Build the module using {{appc run -p android}} (so the app creation/building happens)\r\n\r\nh5.Actual\r\n\r\nDuring the *application build* the following error occurs\r\n\r\n{code}\r\n[ERROR] [GRADLE]\r\n[ERROR] [GRADLE] FAILURE: Build failed with an exception.\r\n[ERROR] [GRADLE]\r\n[ERROR] [GRADLE] * What went wrong:\r\n[ERROR] [GRADLE] Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.\r\n[ERROR] [GRADLE] > Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.\r\n[ERROR] [GRADLE] > Could not find com.radiusnetworks.flybuy:api:1.1.1.\r\n[ERROR] [GRADLE] Required by:\r\n[ERROR] [GRADLE] project :app > com.awam:foo:1.0.0\r\n[ERROR] [GRADLE]\r\n[ERROR] [GRADLE] * Try:\r\n[ERROR] [GRADLE] Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.\r\n[ERROR] [GRADLE]\r\n[ERROR] [GRADLE] * Get more help at https://help.gradle.org\r\n[ERROR] [GRADLE]\r\n[ERROR] [GRADLE] BUILD FAILED in 2s\r\n[ERROR] \"gradlew\" tool returned exit code: 1\r\n[ERROR] Failed to run ti /Users/awam/.nvm/versions/node/v10.16.3/bin/ti\r\n{code}\r\n\r\nh5.Expected\r\n\r\nMy expectation is that the repository definition shouldn't be required in app and module (but I could be wrong)", "attachment": [], "flagged": false, "summary": "Android: Repository specified in modules build.gradle is not able to be resolved when building an application", "creator": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "subtasks": [], "reporter": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "environment": "SDK: 9.0.0.GA, 9.1.0.v20200406120646", "closedSprints": [ { "id": 1190, "state": "closed", "name": "2020 Sprint 7", "startDate": "2020-03-27T16:30:21.583Z", "endDate": "2020-04-10T16:30:00.000Z", "completeDate": "2020-04-10T17:43:27.544Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "455006", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It's an issue with the \"build.gradle\" file. The \"allprojects\" part can only be used by the root \"build.gradle\" which the app developer cannot define; it's auto-generated by Titanium. So, just get rid of the \"allprojects\" part like the below. I've tested it and it works.\r\n\r\n{code:groovy}\r\nrepositories {\r\n\tmaven { url 'https://dl.bintray.com/radiusnetworks/flybuy-sdk'}\r\n}\r\ndependencies {\r\n\t implementation \"com.radiusnetworks.flybuy:sdk:1.1.1\"\r\n\t implementation \"com.radiusnetworks.flybuy:api:1.1.1\"\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-07T15:59:37.000+0000", "updated": "2020-04-07T16:00:59.000+0000" }, { "id": "455010", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Note that if you're building a module, then you need the above \"build.gradle\" in your module's \"android\" directory.\r\n\r\nUnfortunately, gradle ignores custom repo URLs in the POM file used to declare the libraries dependencies.\r\nhttps://github.com/gradle/gradle/issues/8811\r\n\r\nSo, in your Titanium app project, you need to add a \"build.gradle\" under the \"./platform/android\" directory too\r\n{code:groovy}\r\nrepositories {\r\n\tmaven { url 'https://dl.bintray.com/radiusnetworks/flybuy-sdk'}\r\n}\r\n{code}\r\n", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-04-07T21:18:10.000+0000", "updated": "2020-04-07T21:18:10.000+0000" }, { "id": "455025", "author": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "body": "Closing as not our bug based off previous comments.\r\n\r\nThis is a limitation in gradle where a repository set in a module isn't persisted in the built sources (gradle does this for security). As stated in the ticket description the repository needs to be set in both the ", "updateAuthor": { "name": "eharris", "key": "eharris", "displayName": "Ewan Harris", "active": true, "timeZone": "Europe/Dublin" }, "created": "2020-04-08T16:01:20.000+0000", "updated": "2020-04-08T16:01:20.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }