I created a CMake-supporting C++ project in Android Studio and everything works perfectly.
I saw that the native build system is Ninja, and I would like to get a standalone library folder like when you type:
make -j8 install.
which the equivalent could be:
ninja install.
My CMake scripts are supported to do this.
But when I build my project I see there is no Ninja install.
So I tried to configure in:
menu *File → Settings and in the project → opening open-module-settings.
But there is nothing to configure Ninja native build or NDK configuration.
Here the samples:
Just to know where I can configure the Ninja options in the Android Studio or in Gradle files.
My configuration:
Android Studio 2.3.1
build-tools: 25.0.2
CMake 3.6.5
Gradle 3.3
By default, ninja.build files are generated in </path/to/your/app>/Application/.externalNativeBuild/cmake/<build-type>/<arch-name>.
There you can run ninja. If you have set up an install target, you can call it so. The default folders of the compiled libraries will be something like </path/to/your/app>/Application/build/intermediates/cmake/<build-type>/obj/<arch-name>.
Related
I am learning CI/CD Workflows for Flutter apps, I have successfully set up the CI/CD for the flutter android app but it still shows the warning while submitting through CI/CD as follows:
This App Bundle contains native code, and you've not uploaded debug symbols. We recommend you upload a symbol file to make your crashes and ANRs easier to analyze and debug.
whereas it does not show any warning when I manually build the app and submit it to the play store.
1. Install the NDK (Side By Side)
In Android Studio, install the NDK to your Flutter Project by following these steps
From an open project, select Tools > Android > SDK Manager from the main menu.
Click the SDK Tools tab.
Check the box to Show Package Details and note the version number
Check the box next to NDK, CMake, and Android SDK Command-line Tools
Click Apply
Install NDK and CMake in Android SDK Manager
After the necessary files are installed, go to File > Project Structure > SDK and select the NDK version.
or add this line to your ./android/app/src/build.gradle file
android {
compileSdkVersion 30
ndkVersion "21.1.6352462" // << Add this line with your version of the NDK
...
}
See the NDK documentation here for more details on installing the NDK.
2. CodeMagic Build Settings
In your Project Set up on codemagic.io make sure you're building for release then try building your app again.
Under build settings make sure you're building for release and not debug
It's a partial answer. I took the solution from this answer and wrote a post-build script. The script, shared below, creates the required debug symbol zip that we can upload manually. I haven't automated the distribution step so I can't say what we need to do there.
#!/usr/bin/env sh
pushd build/app/intermediates/merged_native_libs/release/out/lib
zip -r $CM_EXPORT_DIR/aab-debug-symbols.zip *
popd
I installed Android Studio on my Mac. I have an android project. I'd like to build it in command-line. If I try to build, or even just get the available tasks:
./gradlew tasks
I got this error:
No Java runtime present, requesting install.
I don't want to install a new JDK. I can build the app in Android Studio. How can I use the JDK installed by Android Studio?
In this article you can find a solutiuon:
https://medium.com/#peter.configcat/build-your-android-app-from-command-line-with-android-studio-on-mac-ee1f7434709b
Add Android Studio JDK to your PATH. Add this to your .zshenv:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
export PATH=”$JAVA_HOME/bin:$PATH”
./gradlew tasks and ./gradlew assmebleDebug should work.
I would like my Android Studio project to use a different version of cmake than the one installed in Android Studio.
I added a variable
cmake.dir=C\:\\path\\to\\a\\different\\cmake
to my local.properties file, and this location is used for some of the compilation of my project but not all.
In the logs of my project build, I still see references to the cmake version installed in AS, and for example, in build_model.json under apps.cxx\cmake\debug\x86, I see:
"cmakeExecutable":
"C:\\Users\\myname\\AppData\\Local\\Android\\Sdk\\cmake\\3.10.2.4988404\\bin\\cmake.exe",
What other file/setting do I need to change so that AS uses exclusively an external verison of cmake for all compilation?
I have create a new Mobile Module Project, but when i try to build it, i have this error:
BUILD FAILED
C:\ProgramData\Titanium\mobilesdk\win32\5.2.2.GA\module\android\build.xml:165:
no executable specified
Did something wrong? I did the following step:
-Installed Appcelerator Studio
-It automatically installed Titanium SDK and i selected to install Android SDK
-Installed JAVA JDK
-Createed new module and tryed to build it
To fix this, edit the file:
C:\ProgramData\Titanium\mobilesdk\win32\5.2.2.GA\module\android\build.xml
Or for any newer SDK versions, just use e.g. 5.3.1 instead of 5.2.2
On line 159, add ".exe" to aidl, like so:
TO
To develop android module you will have to install some additional component and configure some path variables. There is a nice quick start guide where you will find everything. Thinks that need to install:
Android NDK
Ant
Eclipse Java Development Tools plugin
Android Development Tools plugin
gperf
Python
Documentation Link
I'm trying to build Terminal Emulator for Android. I'm running Android Studio 1.4 in Kubuntu 15.04. I also tried building it in Ubuntu 14.04 LTS with the same results. The project requires the latest Android NDK, SDK 22, and SDK 11 which I've downloaded and configured in Android Studio. My system gradle version is 2.8, and Android Studio has downloaded some other versions internally. I'm using jdk1.8.0_65, which is set to JAVA_HOME and configured in Android Studio. I've built several other projects with my configured Android Studio and only seem to have a problem with this project. I need to use this project as a base for an app I'm developing.
I end up with same error, posted below, no matter what route I take to fix it in Android Studio. This is generally what I've done to try and get the project to work. I open up the project unmodified in Android Studio. I click Build >> Rebuild Project. I get an error telling me ndk implementation is deprecated. I add a file gradle.properties to the root directory of the project with the line android.useDeprecatedNdk=true and rebuild. It gives me an error: Task 'generateDebugTestSources' not found in project. I execute Sync Project With Gradle Files to resolve it. Then I end up with the following error and can't get past it.
Gradle 'Android-Terminal-Emulator-master' project refresh failed
Error:exception during working with external system:
or
Gradle sync failed: exception during working with external system:
Consult IDE log for more details (Help | Show Log)
idea.log
Things I've done to try and get the project to build:
Modify all of the project's build.gradle files to use the experimental plugin
Use different versions of Android Studio
Switch from openjdk to Oracle's jdk
Upgrade gradle to the latest version
Set gradle to default wrapper (default) and also set gradle to different versions
invalidate cache, remove ~/.gradle, and rebuild project
Make sure PATH includes the gradle and jdk bin directories and is in ~/.bashrc, ~/.profile, and ~/.zshrc
remove proguard from libtermexec library
reboot computer
I should note that the project builds without issue on the command line. I'd really like to get the project to build in Android Studio for development.
Install Arch and run Android Studio there.
I decided to try building Terminal Emulator on my Arch server, so I installed a xfce (Desktop Environment) and Android-Studio through pacman. I followed the same general path to get things setup, and the app built without issue.
The idea log Android Studio generated for the failed build on Windows and Ubuntu didn't point to any clear problem, even with --stacktrace enabled with gradle. I'm not going to waste my time figuring out why gradle doesn't want to build apps in Ubuntu or Windows.