package name is not determined in android studio - android

i am using Android studio 1.5. and at when i click run i receive
unable to determine package name
i checked the manifest file and it is as shown in the image below...but i do not know why the activities are marked with red even the app name and the icon
as well.
please let me know how to fix this
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.bt_11"
minSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
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:23.0.1'
}

I followed the same steps as user2121 and eventually tried downgrading to Android Studio 1.4.1. Unlike user2121, I still got an error, however it was different than when on 1.5.1.
AndroidManifest.xml file not found
Upon searching for this new error, I found this StackOverflow answer which solved the problem for me on 1.5.1 as well as 1.4.1.

Related

how to use marshmallow in Android studio

I am using Android studio and i want to use Marshmallow API and AppCompatActivity. When I created a new project the build.gradle contained the below lines but I receive error at R class which says not a symbol.
Please let me know how to correct the build.gradle to get the App work.
gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.com.myapplication"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
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:23.0.1'
}
Click on Build->Clean Project and that will perform a gradle clean
Update your Android SDK Manager Install all component of Android 6.0 (API 23)
R file can be erased due to many reasons, try rebuilding your project(which is the most common issue) and other issues may include any syntax error or inappropriate file permissions in work space, the exact error report can help address the issue better.

Android Gradle Error - Illegal UTF8 string in constant pool in class

From one day to the other I opened the Android project that I'm currently working on and I got this gradle error, also happens when I try to create a new project:
Gradle sync failed: Illegal UTF8 string in constant pool in class file com/android/build/gradle/tasks/RenderscriptCompile$_ConfigAction_execute_closure7
Also I noticed that the arrangement of all the app packages has changed to this configuration and it is not able to import AppCompactActivity:
Error print screen
I had been trying to find something on the web but so far I found nothing related to this specific case. I tried a few things myself but I think it only made it even worse..
Anyone out there that can help me?
Thanks!
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "my.app.*****.musicpad"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
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'
compile 'com.android.support:design:22.2.1'
}
For anyone facing this error i have solved it by deleting the temp files.
Control panel-->Java-->Settings-->delete files and restore defaults.

My codes are highlighted in red, but my code works. How can I fix this?

I'm trying to implement Google Maps in my app, I've already requested the API and already properly put in the API key at the right place, and the map seem to load up without any problems, but sections of codes are highlighted in red. Would appreciate any help! Oh, and I am using android studio.
Also, I've tried it on a test app before this, and it worked fine iirc. Then I deleted that project and all the keys at google's developer console and started new for my main project and this happens. If this info helps in any way.
Here's a screenshot of the code error :
Here's build.gradle if it helps :
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "bossharriscorporation.sendmethere"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
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.0'
compile 'com.google.android.gms:play-services:7.8.0'
}
I found the answer. I was careless. Apparently the application name cannot have an exclamation mark in it. I didn't know before. I shall learn more to better myself.

Unable to use github library in Android Studio

I want to use this library in a project in Android Studio, so as mentioned in read me, I created new project in the Android Studio and added dependencies in build.gradle file inside the app folder as:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.mycompany.swipe_instagram"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.lorentzos.swipecards:library:1.0.8#aar'
}
Then when I sync I started getting this error as:
I have Searched on the google and stack overflow but can't find any appropriate solution.
I used your "build.gradle" file and it is working fine for me (both with and without "aar"). Could be something wrong with the cache. Try "File -> Invalidate Caches / Restart"). Another way to generate more error message detail is to try building the module from the command line and getting verbose output
gradle -info compileDebugSources
You'll get lots of output which should give you a hint as to what's going wrong

Gradle build fails in Android Studio

I am using Android Studio and created a new project, which created the standard "Hello world" mock.
My gradle.build file has the following contents:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.whatever.blabla"
minSdkVersion 19
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
Even though I did not change anything, Gradle still fails when trying to build it with the error:
Failed to complete Gradle execution.
Cause:
A fatal exception has occurred. Program will exit.
First of all, is there any way of getting extra info about the problem? And secondly, why is this happening since I only created a standard project?
I had the same problem and could fix it by following solution provided in the below link -
https://code.google.com/p/android/issues/detail?id=67946
Though I am not sure how setting the maxheapsize has fixed the issue.

Categories

Resources