NDK for AndroidStudio - android-studio

I follow this page to study "NDK setting under androidStudio".
http://www.shaneenishry.com/blog/2014/08/17/ndk-with-android-studio/
But I face an issue when I Config ndk with gradle.here is error message.
have anybody help me?
Error:(20, 0) Gradle DSL method not found: 'ndk()'
Possible causes:The project 'My Application' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper fileThe build file may be missing a Gradle plugin.
Apply Gradle plugin

I had this problem and solved it by following the steps in this blog:
http://ph0b.com/new-android-studio-ndk-support/
and looking at the source code of this project:
https://github.com/googlesamples/android-ndk/tree/master/hello-jni
I hope that helps.

Related

Problem with build Gradle 7.2 , still writtencolud not find Gradle 6.1.1

I just downloaded gradle6.1.1 to my android studio ,every time i build any project i get the following: Could not find com.android.tools.build:gradle:6.1.1.
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/6.1.1/gradle-6.1.1.pom
Required by:
project :capacitor-app
Add google Maven repository and sync project
Open File
is there a way anyone can help me… or may be tell me where to save gradle-6.1.1.pom on my device.
Thank you
build.gradle file must be like that
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
gradle-wrapper.properties file must be like that
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-all.zip

No incremental compile snapshot data available gradle error

I am launching a Gradle task and it gives me an error like No incremental compile snapshot data available. I've searched online and I can't find a sufficient description for this. Do you know what exactly raises this error?
What gradle version are you using, found an old bug in v4.10: https://github.com/gradle/gradle/issues/6612
My project is using gradle 4.10 version. However, gradlew.bat clean build --refresh-dependencies solved this problem for me.
By Deleting the .gradle folder of Android Project.
Then do gradle sync and build apk.
It will solve this problem

ARToolKit ARSimpleProj Error

When I open the ARSimpleProj in Android Studio and try to update the gradle version I get this message:
Failed to update the version of the Android Gradle plugin.
Please click 'OK' to perform a textual search and then update the build files manually.
After this, I'm getting this error:
Error:(58, 0) Gradle DSL method not found: 'android()'
Possible causes:
* The project 'ARSimpleProj' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Fix plugin version and sync project
* The project 'ARSimpleProj' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
* The build file may be missing a Gradle plugin. Apply Gradle plugin.
I tried removing the android->buildToolsVersion and dependencies tag from the top-level, build.gradle file (as indicated in the AS_Migration document) but still it doesn't work.
I finally make it work. When opening the project on the Android Studio, I select "Remind me later" to the Android Gradle Plugin Update recommendation. After this, I could execute and install the application on my cell phone.
Make sure you are using JDK 1.7 in Project Structure. I had problems when using the JDK 1.8 with ARToolkit for Android.

Gradle build error: Gradle DSL method not found: 'uildscript()'

Hey I am getting this error while running the app. Please can someone tell me how to fix it?
Error:(1, 0) Gradle DSL method not found: 'uildscript()' Possible
causes:The project 'ePulse2' may be using a version of Gradle
that does not contain the method. Open
Gradle wrapper fileThe build file may be missing a Gradle
plugin. Apply Gradle plugin
You have a typo: change uildscript to buildscript. Here are the docs.

Android Studio include maven artifact in APK (gradle)

I have an Android project that requires the Jsoup library. I've tried everything I can think of to get the jar shaded into the APK.. I just can't get it working. Logcat tells me:
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: org.jsoup.Jsoup
Does anyone know how to include/shade a maven artifact into an APK with Android Studio?
I have found the answer. The trick is to append ":sources". See an example here: http://www.alonsoruibal.com/my-gradle-tips-and-tricks/
I have seen the same type of error every time someone else adds a library with Gradle. Build is usually successful but app crashes when it tries to use the new library. Running task clean with Gradle helps.

Resources