I developed app with React Native. I tried build but building does not end.
show image
Task :app:multiDexListRelease
Task :app:mergeReleaseJavaResource
These tasks have been processed for 17 minutes. Is this normal?
app/build.gradle
defaultConfig {
applicationId "com.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'general'
}
In your build.gradle file do you have the following:
android{
...
defaultConfig {
...
minSdkVersion 21
multiDexEnabled true
}
...
}
multiDexEnabled needs to be true in order for these gradle commands to run.
Related
Within ../android/app/build.gradle, there is a section that looks like this:
android {
defaultConfig {
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
}
Now, flutter.minSdkVersion seems to be a variable located in which file within my project?
It is the default values flutter takes.
You should updates these as per needed. For latest flutter android build, it should be
android {
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
}
You have to go to \android\local.properties
Then add
flutter.minSdkVersion = 26 // the version is up to your needs.
flutter.targetSdkVersion = 32
After that return to defaultConfig of build.gradle and call it like this :
defaultConfig {
minSdkVersion localProperties.getProperty('flutter.minSdkVersion').toInteger()
targetSdkVersion localProperties.getProperty('flutter.targetSdkVersion').toInteger()
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Don't forget to launch a flutter clean flutter pub get and then flutter run
In the old version, we could change it via android/app/build.gradle. Now it gives an error when we change it.
defaultConfig {
applicationId "com.example.manuel"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
There are those who fix this problem via local.properties, but this method does not work either.
sdk.dir=C:/Users/user/AppData/Local/Android/Sdk
flutter.sdk=C:\\src\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1
you need to edit the build.gradle file in the new version as well. As follows;
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.manuel"
minSdkVersion 16 // <--- There minSdkVersion Content
targetSdkVersion 27 <--- There targetSdkVersion (is actually Max Sdk Version) Content
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
then rebuild the project and build it again.
I hope that will be useful.
I got this error after trying to run a Kotlin application through Android Studio:
A problem occurred evaluating project ':app'.
> No signature of method: build_4blexxmb1pl0fsds689m8rkwz.android() is applicable for argument types: (build_4blexxmb1pl0fsds689m8rkwz$_run_closure1) values: [build_4blexxmb1pl0fsds689m8rkwz$_run_closure1#220b09f3]
The error points me to this section of the build.gradle:app file (specifically, the line with android {):
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
buildFeatures {
viewBinding = true
defaultConfig {
applicationId "com.example.bitfighter"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildReleases {
viewBinding = true
}
What does this error message mean, and what can I change to fix the issue?
Try to structure the code like this
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.bitfighter"
minSdkVersion 19
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures {
viewBinding = true
}
The defaultConfig should always only be in the android clause and not inside the buildFeatures. Other than that, you don't need a buildReleases clause when you already have added a buildFeatures clause.
I can't build a project with Android 27 as target SDK and 27.0.3 as buildToolsVersion.
My Android studio version is 3.0.1 and I also have google() in my repositories in project's buid.gradle.
I get this error:
> Could not resolve com.android.support:design:27.0.3.
> Failed to download SHA1 for resource 'https://maven.google.com/com/android/support/design/27.0.3/design-27.0.3.pom'.
> For input string: "<!"
Because of there isn't 27.0.3, you can use 27.0.1,27.0.2,27.1.0 instead. You can check the valid revision on here.
As per now use 27.0.2
compileSdkVersion 27
buildToolsVersion '27.0.2'
defaultConfig {
applicationId "com.example.packagename"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
implementation 'com.android.support:design:'27.0.2'
Try this code:
android {
compileSdkVersion 24
buildToolsVersion '26.0.2'
aaptOptions {
cruncherEnabled = false
}
defaultConfig {
applicationId "com.rokolabs.app.rokostickers"
minSdkVersion 19 // use 19 only use for transition(21)
targetSdkVersion 23
versionCode 117
versionName "0.1.30"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
}
}
I have an android app with four flavours.Each flavor has his its own google-services.json file.
This file needs to be under /app structure.I found this approach to be working in various links:
productFlavors{
one{
applicationId 'com.flavor.one'
versionName '2.4.3'
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 26
copy {
from 'src/one/'
include '*.json'
into '.'
}
}
two{
applicationId 'com.flavor.two'
versionName '1.0.13'
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 26
copy {
from 'src/two/'
include '*.json'
into '.'
}
}
three{
applicationId 'com.flavor.three'
versionName '1.4.1'
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 5
copy {
from 'src/three/'
include '*.json'
into '.'
}
}
four{
applicationId 'com.flavor.four'
versionName '1.4.1'
minSdkVersion 16
targetSdkVersion 23
multiDexEnabled true
versionCode 5
}
}
But this approach is always copying the last json to app directory.Not copying the flavor based json.