Comments (12)
Whats your use-case? and why do you need this full fledge project to be a library project/module?
from edx-app-android.
I am actually in the same boat as Jackson, I am working on an app to help highschool students successfully transition to college and one of the requirements is that I embed Open edX inside of my app.
I ran through the usual steps (https://developer.android.com/studio/projects/android-library.html#Convert):
- removed the
applicationId
- applied the
com.android.library
plugin - I also had to change
android.applicationVariants.all
toandroid.libraryVariants.all
and copy buildSrc over to the root of the new project
I hit a wall with building my AAR though. Error:(15, 34) error: package org.edx.mobile.databinding does not exist
. Do you have any advice on next steps?
from edx-app-android.
I may have come across the databinding issue a long time again and I remember needed to recompile my project. https://stackoverflow.com/questions/40440662/databinding-does-not-exist-how-to-solve-it
@miankhalid @farhan Any experience on librarification?
from edx-app-android.
Actually we have almost same requirement as @DevKate. First time we didn't have the requirement in our edx project. So we fully build it as a seperate project. Now we have to include this as a module in our project
we tried to recombile this project
error: package org.edx.mobile.databinding does not exist
but this error got us nowhere
from edx-app-android.
@BenjiLee Nops didn't get a chance to work on librarification so far.
@MirzaMubasharBaig Will not it be a good idea to create a story of that and we can do research and resolve it in that.
from edx-app-android.
Same as @farhan in this case. Will have to invest some time into it.
from edx-app-android.
I've made some progress. Because library resource ids are not constants, I had to remove all @InjectView
and @ContentView
annotations and replace them with calls to findViewById
. I also had to replace a few switch statements with if/else for the same reason.
A few other changes I made were:
- updating from
org.apache.commons.lang
toorg.apache.commons.lang3
- changing
provided
toannotationProcessor
forroboguice:roboblender
- adding
vectorDrawables.useSupportLibrary = true
to the defaultConfig in OpenEdXMobile/build.gradle - adding a default flavor dimension
Databinding errors are gone and I am able to generate dev and prod AARs. My current issue is loading those AARs as dependencies from my main application. I used android studio's "Import Module From Library" to add the AAR to my project, but when I included it as a dependency in my application module implementation project(':OpenEdXMobile')
, I got this error:
Error:Could not determine the dependencies of task ':OpenEdXMobile:compileProdDebuggableJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':OpenEdXMobile:prodDebuggableCompileClasspath'.
> Could not resolve project :android-iconify.
Required by:
project :OpenEdXMobile
> Unable to find a matching configuration of project :android-iconify:
- Configuration 'debugApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'debug'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
- Configuration 'debugRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'debug'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.
- Configuration 'releaseApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'release'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
- Configuration 'releaseRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'release'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.
> Could not resolve project :android-iconify-fontawesome.
Required by:
project :OpenEdXMobile
> Unable to find a matching configuration of project :android-iconify-fontawesome:
- Configuration 'debugApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'debug'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
- Configuration 'debugRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'debug'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'debug' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.
- Configuration 'releaseApiElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'release'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found compatible value 'java-api'.
- Configuration 'releaseRuntimeElements':
- Required com.android.build.api.attributes.BuildTypeAttr 'debuggable' and found incompatible value 'release'.
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'release' but wasn't required.
- Required default 'prod' but no value provided.
- Required org.gradle.api.attributes.Usage 'java-api' and found incompatible value 'java-runtime'.
My friend suggested I try adding matchingFallbacks = ['debug', 'release']
to android.buildTypes.debug, but then the aar failed to build with this error Could not set unknown property 'matchingFallbacks' for BuildType_Decorated
from edx-app-android.
@marcotuts FYI
from edx-app-android.
@DevKate Is this the kind of work that would be ok to open a WIP pull request to get early feedback / comments on? If so we can move discussion to a PR instead of this github issue. .
from edx-app-android.
Sorry to leave you hanging @marcotuts, PR sounds like a great idea. It sounds like requirements for this project may potentially allow installing the edx dependency as a separate apk, in which case my issue will shift from compiling openedx as a library to interfacing with the openedx apk from my main application. This would likely result in some custom code to handle authentication from the main app when the edx apk is launched, and some changes to the manifest to launch the app at specific activities. The goal is just to allow students to take their classes from our app. Not sure if this would also satisfy @jacksonej's issue. I was thinking of creating a fork for an embeddable version of openedx if my company does opt for this solution instead of librification, unless you'd prefer we make a PR and support this use case from the main project.
from edx-app-android.
@staubina FYI
from edx-app-android.
@BenjiLee Thank you for the heads up on this.
from edx-app-android.
Related Issues (20)
- Connection error in Courses tab HOT 8
- Not able to load authenticated block HOT 1
- SSLHandshakeException, CertPathValidatorException, Trust anchor for certification path not found. HOT 6
- Crashlytics initialize Issue HOT 3
- Caused by: org.gradle.api.resources.MissingResourceException: Could not read script 'C:\DineshSingh\studybytech\edx-app-android\ExoPlayer\core_settings.gradle' as it does not exist. HOT 2
- app doesn´t connect with a backend with http, only https backends servers allowed HOT 2
- BUG when you rotate the device twice while watching a youtube video HOT 2
- Error inflating class com.google.android.exoplayer2.ui.PlayerView HOT 2
- Caching in AuthenticatedWebView HOT 1
- Could not find method leftShift() HOT 4
- java.lang.IllegalStateException: Not a JSON Object HOT 6
- Microsoft Login azuread-oauth2 header
- Randomised content block - Remove "View on Web" Message HOT 2
- HMS support for HUAWEI's phones HOT 1
- HarmonyOS support! HOT 1
- Why EDX videos are disappearing? HOT 6
- Lint issues on building for release HOT 4
- Connection error in Courses tab ( in Text content and Html xblock in my android app)
- Unable to register or sign up new user HOT 1
- [DEPR]: Shifting edX-app-android to openedx-unsupported + Updated documentation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from edx-app-android.