I add .so file to app\src\main\jniLibs\libs directory as below:
app
...main
.......jniLibs
..............libs
..................armeabi
.........................libjsqlite.so
..................armeabi-v7a
.........................libjsqlite.so
..................x86
.........................libjsqlite.so
and after sync the project. But android studio doesn't know package from libjsqlite and couldn't import libraries to code. I tried different way at stackoverflow but I couldn't. Is there any useful way?
It's my project info:
compileSdk 31
defaultConfig {
applicationId "com.example.masterngo"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Thanks
Related
Flutter is building apk on android API level 29 by default I want to upgrade it to 30 how can I? I am new to flutter I don't know, I tried to google it but it wasn't helpful
Open a Flutter project in Android Studio and you have to edit the build.gradle file. In a flutter project, it is found at the path ./android/app/build.gradle
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.projectname"
minSdkVersion 19
targetSdkVersion 28 // Set this to 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Inspiration from this answer and modified accordingly
I'm working on an android app where I tried importing a different module(another project), also tried adding the dependencies of the second module to the first module by going to project structure. But it says Gradle project sync failed and I've posted the screenshots down below.
1st module build gradle
compileSdkVersion 27
defaultConfig {
applicationId "com.example.*****.*****"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
2nd module build gradle
compileSdkVersion 28
defaultConfig {
applicationId "com.example.*****.*****"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Screenshots of output-1
Screenshots of output-2
Please help me out!
Did you try this?
Build > Clean Project
then
Build> Rebuild Project
I have recently started using the android studio. Just after installing and downloading all the requisite files, I am welcomed by this error,"Failed to find the target with the hash string 'API 27'....", whereas I already have both API 27 and 28 installed (although 28 shows up to be partly installed).
I am completely new to this software.
Tools
SDK
error
you should use like below in gradle
{
compileSdkVersion 27
buildToolsVersion '27.0.1'
defaultConfig {
applicationId "xxxxxxxxx"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
}
don't write like compileSdkVersion 'API 27' its compileSdkVersion 27 only
Currently, all my test reports are being created and stored in the folder 'test-reports' in the project root directory. Below is the gradle file, in which I have specified the directory under 'testOptions'.
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.edk1kor.decodedemov3"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testOptions{
reportDir "$rootDir/test-reports"
}
}
I want to create a new folder, each time a test is run. Is it possible to dynamically create a folder each time? If not via gradle code, via the android source code?
Gradle2 4.2
My app/build.gradle:
android {
compileSdkVersion 26
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.myproject"
minSdkVersion 16
targetSdkVersion 23
versionCode 25
versionName "1.2.25"
}
}
My steps for deploy apk to Fabric (Beta by CrashLytics)
Manually increment versionCode and verionName. In this example: versionCode 26 and versionName "1.2.26"
Create distributive (apk) and deploy to CrashLytics by command:
gradlew assembleDebug crashlyticsUploadDistributionDebug
And as result my apk success deploy to Fabric with versionName = "1.2.26"
OK. It's work fine.
But I need to automatically increment versionCode and versionName BEFORE deploy to Fabric.
To do this I need to write custom Gradle task. Does my approach correct?