Git Product home page Git Product logo

Comments (12)

miankhalid avatar miankhalid commented on June 16, 2024

Whats your use-case? and why do you need this full fledge project to be a library project/module?

from edx-app-android.

katien avatar katien commented on June 16, 2024

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 to android.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.

BenjiLee avatar BenjiLee commented on June 16, 2024

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.

jacksonej avatar jacksonej commented on June 16, 2024

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.

farhan avatar farhan commented on June 16, 2024

@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.

miankhalid avatar miankhalid commented on June 16, 2024

Same as @farhan in this case. Will have to invest some time into it.

from edx-app-android.

katien avatar katien commented on June 16, 2024

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 to org.apache.commons.lang3
  • changing provided to annotationProcessor for roboguice: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.

BenjiLee avatar BenjiLee commented on June 16, 2024

@marcotuts FYI

from edx-app-android.

marcotuts avatar marcotuts commented on June 16, 2024

@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.

katien avatar katien commented on June 16, 2024

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.

BenjiLee avatar BenjiLee commented on June 16, 2024

@staubina FYI

from edx-app-android.

staubina avatar staubina commented on June 16, 2024

@BenjiLee Thank you for the heads up on this.

from edx-app-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.