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.
Related
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
Android Studio signs an APK only when I go Build/Build Bundles Apks/Build APK. When the run button to automatically run it on the emulator is clicked the application is not signed. I have verified this by inspecting the application with adb pull from the emulator.
The following is the build gradle I have:
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
signingConfigs {
config {
keyAlias 'androiddebugkey'
keyPassword 'android'
storeFile file('/home/pc/.android/debug.keystore')
storePassword 'android'
}
}
defaultConfig {
applicationId "com.example.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
custom {
signingConfig signingConfigs.config
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
debuggable true
}
}
}
I am choosing from the build variants the custom one I have created.
I havent touched this app for a while now but a similar project I had was working properly several months ago. Is there some update or something else that is causing this behavior? Am I missing something?
Android Version 3.6.1
Java Version = java-8-openjdk
I know the config is correct as the Build APK actually signs the APK
I know that the APK installed on the emulator when the button run is clicked does not contain the signature as i have inspected the META-INF directory of the apk. But i have also verified it by trying to print the signature programmatically.
According to Android user guide the run button should have the same result as the Build APK!
What could be the issue of the above and how to solve it?
I spent a considerable amount of time trying to solve this and I hope to save some time from anyone else facing this.
Go to Run/Edit Configurations
In the tab General in section Installation Options
In Deploy choose APK from app bundle
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
I have an app on the android playstore. I want to release a new version of the app. I have checked my code, and the original appears without the app version line as follows android:versionCode="1"
Can I just add this line of code to the new release as below, even though it did not appear on the original?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="2"
package="com..........." >
In build.gradle file of your app,
android {
.
.
defaultConfig {
applicationId "com......"
minSdkVersion 15
targetSdkVersion 22
versionCode 2 //Should be greater than playstore
versionName 1.1
}
.
.
}
If the versionCode is not greater than the version code of the app present on playstore, it will ask you to update your app.
For checking the version code of your app on your device, install Dexplorer app and find the versionCode in manifest.xml
Hope this helps!
If you build your app with gradle (like expected) ignore the AndroidManifest.xml and adjust those kind of properties in the corresponding build.gradle-file, because gradle will overwrite those values in the manifest.
Also check for the field versionName
If you work with Eclipse, app version code is in the manifest.xml.
In Android studio, version code is stored in the file build.gradle in the app folder. If you want to change it, simply change in file or use menu "Project structure" (CTRL+ALT+SHIFT+S).
I don't believe you can publish app on play market without version code. I suggest you to check on developer console which version are published.
build.gradle file should be like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.nascenia.pfa"
minSdkVersion 15
targetSdkVersion 22
versionCode 1 // change here
versionName "2.2" // change your version here
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
}
I need to add demo and full flavors to my app.
https://developer.android.com/tools/building/configuring-gradle.html tells me:
"1. On the Project panel, expand BuildSystemExample, and then expand the app directory.
2. Right-click the src directory under app and select New > Directory."
I am using Android Studio 1.2.1.1, so when I create a project, it doesn't show a src directory in the project.
How do I proceed?
Maybe you can use the "Project Structure" dialog to create a flavor for your application. I added a full and a home flavors in the example project as shown in below picture.
You can get the "project Structure" dialog through menu "File" -> "Project Structure".
here is the build.gradle text file for the app module.
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.zephyr.myapplication"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
full {
minSdkVersion 14
applicationId 'full'
targetSdkVersion 17
}
home {
minSdkVersion 14
applicationId 'home'
targetSdkVersion 17
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Hope it helps.