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
Related
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
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
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?
Getting error while running project with target v 22. I can not change target version.
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
gradle file - build.gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.adsl.beaconapp"
minSdkVersion 19
targetSdkVersion 22
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
Try deleting the build folder and then clean the project
Syncing the project files with gradle files in android studio is resulting in the following error
Error:(14, 0) Could not find method applicationId() for arguments [com.amazon.mysampleapp] on project ':app' of type org.gradle.api.Project.
where the gradle file reads
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
applicationId "com.amazon.mysampleapp"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
What is happening here? Removing applicationID moves the error to minSdkVersion
The applicationId doesn't go inside the android block, but instead your buildConfig block:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "19.1"
defaultConfig {
applicationId "com.example.my.app"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
Pulled that from this page about applicationId: http://tools.android.com/tech-docs/new-build-system/applicationid-vs-packagename