Android app is not building after change the android studio version - android

I created an Android app using the android studio (2016) with the following parameters
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.2.1'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.stl.sciocardio.app.androidapp"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Also, I use third party projects inside the project as well. When I change the Android studio 2020 the app is not built or even not detected as an android project. It gives me the following error once I try to rebuild it
Unable to find Gradle tasks to build: [:app, :, :GraphView-master].
Build mode: REBUILD.
Tests: None.
How can I fix the issue?

Try this:
Delete folders [build, .idea, .gradle]
Invalidate Caches / Restart
If it does not get resolved, then repeat the above step by removing
include ':app' from settings.gradle

Related

Could not get unknown property 'experimentalProperties' for extension 'android' | Android Jetpack Macrobenchmark

I am following macrobenchmark setup configurations from -
https://developer.android.com/studio/profile/macrobenchmark#configuration
In following code in my macrobenchmark's build.gradle
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 29
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
targetProjectPath = ":app" // Note that your module name may be different
experimentalProperties["android.experimental.self-instrumenting"] = true
buildTypes {
release {
debuggable = true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
following build error is thrown while gradle sync:
A problem occurred evaluating project ':macrobenchmark'.
> Could not get unknown property 'experimentalProperties' for extension 'android' of type com.android.build.gradle.TestExtension.
I'm new to android, any help is appreciated, thanks in advance.
Fixed the error, via following -
Updated Android Studio to Arctic Fox Beta Version
Updated gradle version in project build.gradle to 7.0 beta4
Found solution through documentation of benchmark samples repository provided by google and comparing gradle files.
Due other dependencies I had to update to version 7.1.0-alpha02 of gradle plugin in project build.gradle file.
And this property got recognized.

How to get applictionid in android studio?

i mistakenly deleted my applicationId in build.gradle (Module:app)
in my android studio project.
is there any way for me to reset it?
i cannot run or debug or rebuild my project .
please help,I'm stuck.
Rewrite it in gradle like this..
android {
compileSdkVersion 28
defaultConfig {
applicationId "abc.com.mobile"
minSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
If App is already Published and then go to app link and in link after id= is your pakage name as in this link ez.intandif.iniplayer is pakage name.
https://play.google.com/store/apps/details?id=ez.intandif.iniplayer
Android Studio saves the history of all your file changes. Open you build.gradle file, go to Menu VCS -> Local History -> Show History. You can also revert automatically to previous versions by selecting a version in the left pane, right click and select Revert.

Unable to zipalign apk android android studio 2.2

I am publishing my app using android studio 2.2 preview 3 and generating signed apk. But when i am uploading apk to google play i am getting error
You uploaded an APK that is not zip aligned. You will need to run a zip align tool on your APK and upload it again.
Also i tried to used zipalign tool manually but i am getting error verification failed.
Here is my build.gradle file
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "blackdogs.newaomsi"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
Got it. Error was due to gradle version i was using.
Downgraded gradle version to
'com.android.tools.build:gradle:2.1.2'
This is a known issue with Android Studio 2.2 Preview 3, as explained in this blog post and this issue.
You have to download Preview 2 or use the stable version of Android Studio.
solved in the next release
classpath 'com.android.tools.build:gradle:2.2.0-alpha4'
reference link:https://code.google.com/p/android/issues/detail?id=212591

Cannot resolve symbol (after Android Studio update) but the project builds for app/library project

I have an an Android Studio project A which is an app, and a project B which is a library project. I have included project B in project A. Project B has some dependencies (android async http, and org.json) that are used in both project B and project A. I upgraded Android Studio to 2.2 Preview 2, and am now having an issue where all of my usages of android async http are saying Cannot Resolve Symbol. However, my JSON usages are just fine. When I build the project, I get no errors and can run it just fine. How can I fix the Cannot Resolve Symbol issue in Android Studio?
I have tried
cleaning & rebuilding both projects
making a change in the app's build.gradle & syncing grade
re-arranging the order of dependencies
sync project with gradle files
delete android async http.xml from .idea/libraries & sync project with gradle files
opening and closing android studio
setting minifyEnabled=true in the app & library
Is there something I am missing?
app > build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 19
targetSdkVersion 23
versionCode 33
versionName "2.3"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile project(':mylibrary')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v13:21.0.3'
}
library > build.gradle
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 2
versionName "1.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
useLibrary 'org.apache.http.legacy'
}
dependencies {
compile files('libs/org.json-20120521.jar')
compile files('libs/android-async-http-1.4.5.jar')
}

Gradle finished with non-zero exit value 2?

I am trying to integrate Google Sign-in into my app
Google developer.
As mentioned I have also added to build.gradle files as follows:
dependency to project's top-level build.gradle:
classpath 'com.google.gms:google-services:1.4.0-beta3'
plugin to app-level build.gradle:
apply plugin: 'com.google.gms.google-services'
when I start syncing,it downloads some stuff.
But after running it shows error that Gradle finished with non-zero exit value 2.
Currently I am using Android Studio v1.4
The most probable cause of this would be, you have a lot of libraries and thus lots of methods. Try enable multiDex in your app's build.gradle like below
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "in.alphawolf.wallmax"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true // Like this
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
and you will be able to build your project!

Categories

Resources