flutter Failed to find Platform SDK with path: platforms;android- - android

I am trying to run a flutter app on Android studio. It throws error
flutter Failed to find Platform SDK with path: platforms;android-R
My app build.gradle is
buildscript {
...
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.inspireui.fluxstore"
minSdkVersion 23
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
resConfigs "en"
}
afterEvaluate {project ->
if (project.hasProperty("android") && project.property("android").compileSdkVersion.equals("android-R")) {
android {
compileSdkVersion 30
}
}
}
}
Have tried below solution
Failed to find Platform SDK with path: platforms;android-P

Related

Android Studio throws "No signature of method" error, pointing to build.gradle:app

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.

Problems when build Skia for Android

I try to build Skia for Android, there is my configuration:
ndk = "/root/workspace/ndk/android-ndk-r22/"
ndk_api=22
target_os="android"
target_cpu="arm"
is_official_build=false
is_component_build=false
After building skia successfully, I get libskia.a file, But cant work on my computer, its say:
error: undefined symbol atof
referenced by pngget.c
error picture
Android gradle configuration is:
android {
compileSdkVersion 29
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.impactjs.ejecta"
minSdkVersion 18
targetSdkVersion 29
versionCode 1
versionName "1.0"
ndk {
abiFilters 'armeabi-v7a'
}
externalNativeBuild {
cmake {
arguments '-DGCANVAS_WEEX=0', '-DGSTANDALONE=1'
}
}
}
ndkVersion '22.0.7026061'
}
My Cmake configuration is:
target_link_libraries(
iwanmg
z
log
jnigraphics
gcanvas
${CMAKE_CURRENT_SOURCE_DIR}/v8/libs/${ANDROID_ABI}/libwee8.a
${CMAKE_CURRENT_SOURCE_DIR}/skia/libs/${ANDROID_ABI}/libskia.a
)
please help~

Android studio never ending build

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.

More than one file was found with OS independent path 'lib/armeabi/libBugly.so'

I tried to debug my application, but an error appeared:
More than one file was found with OS independent path 'lib/armeabi/libBugly.so'
This is a part of my gradle:
android {
compileSdkVersion 26
dataBinding {
enabled = true
}
defaultConfig {
multiDexEnabled true
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0"
ndk {
abiFilters "armeabi", "armeabi-v7a"
}
}
}
dependencies {
implementation 'com.tencent.bugly:crashreport_upgrade:latest.release'
implementation 'com.tencent.bugly:nativecrashreport:latest.release'
}
Android Studio 3.1.3, Gradle4.1 in my project.
Add something in app's build.gradle :
android {
packagingOptions {
pickFirst 'lib/armeabi/libBugly.so'
}
}
Then, it works.

Could not resolve com.android.support:design:27.0.3

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
}
}

Categories

Resources