In Android studio, I started a project with one name say "First Project" and later I renamed project as "Second Project", changed package name and everything to this new name but Logcat title (debugging process name ) shows previous process name as
com.example.app.first_project. I want it to be com.example.app.second_Project,
How do I achieve this, can someone help !!!
change build.gradle (Module: app) applicationId in defaultConfig:
defaultConfig {
applicationId "com.example.app.second_Project"
minSdkVersionhttps: 14
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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 am new to Android Studio and I am trying to get versionCode in build.gradle.
I have read this post and this post, and I tried their solution:
import com.example.BuildConfig;
...
...
...
// Get current version code
int currentVersionCode = BuildConfig.VERSION_CODE;
But IDE keeps saying Cannot resolve symbol 'BuildConfig'. Actually I haven't found any string in the whole project folder named "BuildConfig" (searched in Windows Explorer). Is there something wrong with my project configuration/creation?
defaultConfig in build.gradle (module: app) is like
defaultConfig {
applicationId "com.foo.bar"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Your BuildConfig should always be:
import <applicationId>.BuildConfig (replacing <applicationId> with its value)
If you're still getting the error after trying that, then select invalidate caches / restart from the menu. This happened to me, went googling this error, then had a "duh" moment as I remembered that trick. Invalidating your caches will often fix compilation errors that seem like they shouldn't be happening.
You get to it statically like so....
com.foo.project.BuildConfig.VERSION_CODE; //this value will be an int
In your 'Module: app' Gradle file all of this info can be found in the 'defaultConfig' section.
defaultConfig {
applicationId 'com.foo.project'
minSdkVersion 21
targetSdkVersion 29
versionCode 18
versionName '2.6'
signingConfig signingConfigs.config
}
I have followed the official guide for creating different flavours of my Flutter application.
When I build either of the flavours on my emulator,
flutter build apk --flavor a -t lib/main-a.dart
flutter install
the app succesfully builds but instantly crashes on startup. I have looked at other solutions but none seem to work.
I checked if my package names are the same.
android/app/src/main/AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.flutterclient">
android/app/build.gradle
defaultConfig {
minSdkVersion 19
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
flavorDimensions "app"
productFlavors {
a {
dimension "app"
applicationId "com.example.flutterclient"
versionCode 1
versionName "1.0"
}
b {
dimension "app"
applicationId "com.example.flutterclient"
versionCode 1
versionName "1.0"
}
}
app/src/main/java/com/example/flutterclient/MainActivity.java
package com.example.flutterclient;
I've tried flutter clean before building
Any help is appreciated!
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
Currently, all my test reports are being created and stored in the folder 'test-reports' in the project root directory. Below is the gradle file, in which I have specified the directory under 'testOptions'.
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.edk1kor.decodedemov3"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testOptions{
reportDir "$rootDir/test-reports"
}
}
I want to create a new folder, each time a test is run. Is it possible to dynamically create a folder each time? If not via gradle code, via the android source code?