1

I clone OpenVPN project in ics-openvpn. And then I install NDK, CMake, swig(4.0.1), update git ... follow doc/README.txt and I open it with Android studio after that. But when open the project with Android studio I can't see another package in the project.

Here is my result:

enter image description here

How I can fix it to see all the packages and build the project?

Thank you so much!

Maximilian Ast
  • 3,369
  • 12
  • 36
  • 47
Hoa.Tran
  • 935
  • 10
  • 26

1 Answers1

4
    flavorDimensions("implementation")
    
    productFlavors {
        create("ui") {
            setDimension("implementation")
            buildConfigField("boolean", "openvpn3", "true")
        }
        create("skeleton") {
            setDimension("implementation")
            buildConfigField("boolean", "openvpn3", "false")
        }
    }
  1. add the module in the dependency in your build.gradle :

implementation project(path: ':your-module-name')

  1. sync the project and it is done :-)

NOTE: if you can not see the module files click on the gradle on the right of android studio and left-click on the openvpn module and choose refresh Gradle project.

I hope it can help someone.

Mohammad Sommakia
  • 1,773
  • 3
  • 15
  • 48
  • Thank you so much but when I import module with main folder it so error : Specify location of the gradle of android eclipse project – Hoa.Tran Dec 04 '19 at 01:38
  • ok the error indicate that you are importing the module in the wrong way – Mohammad Sommakia Dec 05 '19 at 15:33
  • In Android Studio: File -> Import Module -> open ics-openvn -> select main. What is wrong? – Hoa.Tran Dec 06 '19 at 03:43
  • ok i tried it my self and no error message show up i dont know what is wrong – Mohammad Sommakia Dec 07 '19 at 09:31
  • try to open main module as project – Mohammad Sommakia Dec 07 '19 at 09:31
  • @MohammadSommakia Thank you for these amazing instructions. I have a question about step 5. I have imported the module as `vpnLib`. Do I download the submodules into `myApp/vpnLib/src/main/cpp`, or into `myApp/vpnLib/`? – Houman Mar 23 '21 at 08:27
  • Hello @Houman You need to download the submodules into myApp/vpnLib/src/main/cpp You are welcome please upvote the answer if it helps you – Mohammad Sommakia Mar 23 '21 at 09:13
  • @MohammadSommakia And when I do step 10, I get one error when building the project: `myApp/vpnLib/build.gradle.kts:152:9: Unresolved reference: applicationVariants`. What do I do here please? – Houman Mar 23 '21 at 09:28
  • Hmmm, I can't be sure what is the error exactly I need to see the code so I can fix it because last time I build the project year ago :) – Mohammad Sommakia Mar 23 '21 at 09:33
  • @MohammadSommakia You have so much experience with this. Do you think you could start a new project just to confirm if these instructions still work, please? That would be amazing. – Houman Mar 23 '21 at 12:44
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/230262/discussion-between-mohammad-sommakia-and-houman). – Mohammad Sommakia Mar 23 '21 at 13:07