Unable to import latest Android Studio projects

Sysprogs forums Forums VisualGDB Unable to import latest Android Studio projects

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #13058
    megaderek
    Participant

    Hello,

    I just upgraded from VisualGDB 4 to VisualGDB 5. When I follow the tutorial for importing an Android Studio project I’m having issues. I have Android Studio 3.0 installed.

    I create a new Android Project with VisualGDB and select “Import existing project from Eclipse or Android Studio”. I browse to where the gradlew.bat file is.

    VisualGDB pops up a message saying “Could not detect the compiler version from your make file. You may need to specify additional build arguments (eg. NDK_MODULE_PATH) etc..”

    When I click finish I get another message “Toolchain test failed: Cannot query the value of TARGET_CXX…”

    Also adding more cpp source files in Visual Studio doesn’t appear to update the CMakeLists.txt used by Android Studio.

    The following is output when I try to build.

    1>Build started 26/11/2017 9:54:27 AM.
    1>Build:
    1>  Found CMakeLists.txt. Skipping the manual NDK build.
    1>  VisualGDB: Run "cmd.exe /c gradlew.bat assembleDebug " in directory "E:\TestProjects\AndroidProject2\..\MyApplication1" on local computer
    1>  Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
    1>  
    1>  FAILURE: Build failed with an exception.
    1>  
    1>  * What went wrong:
    1>  Unable to start the daemon process.
    1>  This problem might be caused by incorrect configuration of the daemon.
    1>  For example, an unrecognized jvm option is used.
    1>  Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html
    1>  Please read the following process output to find out more:
    1>  -----------------------
    1>  Error occurred during initialization of VM
    1>  Could not reserve enough space for 1572864KB object heap
    1>  
    1>  
    1>  * Try:
    1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    1>  
    1>  * Get more help at https://help.gradle.org

    I can clone NDK samples fine however these will create projects using the old ant build system. I really need to have support for the newer Gradle stuff as a lot of 3rd party libraries expect you to be using it with their integration instructions.

    Regards

    Derek.

     

     

    #13076
    support
    Keymaster

    Hi,

    The VM error shown in the log is actually a known Java issue and can be easily solved via environment: https://stackoverflow.com/questions/18040361/java-could-not-reserve-enough-space-for-object-heap-error

    Regarding Gradle support, the latest Gradle switched the build system from ndk-build to CMake, breaking backward compatibility. The latest version of VisualGDB has introduced a new Advanced CMake subsystem (currently supported for Linux and Embedded projects only) that replaces the regular Visual C++ logic for CMake-based projects and we are planning to extend it with support for Android projects in the next major VisualGDB release.

    Currently we recommend installing an SDK version that supports ndk-build (importing Gradle projects from Android Studio is supported). Once we release a VisualGDB preview supporting CMake on Android, the CMake-based projects will start working out-of-the-box as well.

     

    #13084
    megaderek
    Participant

    I tried rolling back the SDK version but I think CMake is permanent in Android Studio 3, new projects with C++ are automatically configured to use CMake. So I uninstalled and tried the last version of Android Studio 2.x prior to them introducing CMake. I managed to import the native-activity from the ndk-build branch of the NDK Samples into Android Studio, build and run. I then imported it into VisualGDB, although I was still required to resolve some issues with the native build side of things. It runs now but can’t be debugged (debuggable is true) VisualGDB pops up a warning saying “trying to debug an older version of the app, Please reinstall the app on the device” I guess there is something broken about it that I don’t understand.

    I’ve also tried importing the plain VisualGDB Android Project Wizard into Android Studio in the hope that it will convert it to the gradle system which can then be re-imported into VisualGDB. Usually there is something that will break along the way. Unfortunately a lot of this requires intimate knowledge of the how the Android build system works.

    It would be good to have the possibility to create a new Android project with the VisualGDB Wizard that allows you to choose Gradle support. Either that or CMake support would probably solve my issues.

    Is there an ETA on CMake support for Android?

     

    #13094
    support
    Keymaster

    Hi,

    We are planning to roll out Android CMake support around the beginning of the next year. As a temporary workaround, we can publish a version addressing the build issues (but not including the 2-way CMake integration yet) in 2-3 weeks. Let us know if you would like to try it out.

    #13097
    megaderek
    Participant

    I would definitely like to try it out. I have a couple of large projects that were built using VisualGDB 4 and some new ones planned.

    #13288
    support
    Keymaster

    Hi,

    OK, we have managed to add the Android support for Advanced CMake Project Subsystem in the upcoming v5.3R8. You can download a preview build with this functionality here: http://sysprogs.com/files/tmp/VisualGDB-5.3.17.1966.msi

    A detailed tutorial is available here: https://visualgdb.com/tutorials/android/cmake/

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.