I began to program with android and so I downloaded Android Studio 2.1.3 and android SDK and jdk 1.8.0_60 the Gradle version is 2.14.1.
I want to program with Android 2.2.
In my class called GameView is the problem:
bmp = BitmapFactory.decodeResource(getResources(),
R.mipmap.ic_launcher);
it can not resolve symbol R
I read that I can solve the problem in these ways:
BUILD -> Clean Project
Tools -> Android -> Sync Project with Gradle Files
File -> Invalidate Caches / Restart
Nothing helped so I tried to changed the Versions in build.gradle(Module: app).
I do not really know wich Versions I need to program for Android 2.2.
Please help me or do you know any other solution to fix that problem?
Thanks!!!
In my case the solution was to put the minSdkVersion from 8 to 9.
I also changed the versions in build.gradle:
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.panjutorials.lazypudding"
minSdkVersion 9
targetSdkVersion 24
versionCode 1
versionName "1.0"
The only disadvantage is that I program with Android Nougat now but that's okay.
Good luck for everybody who has a similar problem.
Related
I was working on a project in late 2018 and left that as it is after that now i want to make changes in it and publish it to the playstore. The project had the v7 dependencies
&
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.andropc.wallpro"
minSdkVersion 15
targetSdkVersion 27
The app crashes after Android7.1 so how to run the app on above android versions what changes to make in the project or in dependencies to make it run in all versions.
First of all android support libraries had mean migrated to androidx!(https://developer.android.com/jetpack/androidx/releases/appcompat)
But you can still use old dependencies as well (I would recommend you to switch to androidx).
You need to change targetSdkVersion: 29 in build.gradle in order to support latest android version which is android 10.
I have an app published in the Play store. I updated the compileSDKVersion and targetSDKVersion to 27. After the update was released, it did work for some but did not work for most users.
I tried to switch back and forth these compile and target and versions. However, on testing on the device it works but it does not work when I release it in the Play Store.
Which versions I have been using:
compileSDKVersion = 18, targetSDKVersion = 18 (Worked, it was like this originally)
compileSDKVersion = 27, targetSDKVersion = 27 (worked for some after updating but downloading it as a new app didn't work)
compileSDKVersion = 18, targetSDKVersion = 18 (Couldn't even release)
compileSDKVersion = 23, targetSDKVersion = 23 (Was able to release but still doesn't work, when I update the currently installed app, or when I install it as a new app)
Dependencies (In the current version):
compile 'com.android.support:appcompat-v7:23.0.+'
compile 'com.android.support:support-v4:23.0.0'
buildToolsVersion "24.0.2"
Looking for an advice to solve this issue, really stuck!
Thanks very much!
I'm guessing you haven't made the permissions changes necessary when targeting SDK >=23 (Android 6.0).
See the documentation at https://developer.android.com/training/permissions/requesting
I am trying to run an app that has a Google Maps Activity on my phone. My phone's running on Android 4.1.3 and the Minimum SDK for my project is API 15: Android 4.0.3
I just created the project on Android Studio and tried to run it on my phone. But it won't run and I am keep getting this error. Can someone tell me how to solve this?
That error probably means that you are using too much libraries. And because you are trying to use google maps I'm guessing you included everything google.
Try to just use the libraries you need.
For maps use this:
dependencies {
com.google.android.gms:play-services-maps:9.2.1
}
Reading material:
https://developers.google.com/android/guides/setup
You need to configure your gradle for multidex.
Modify the module-level build.gradle file configuration to include the support library and enable multidex output, as shown in the following code snippet:
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
See more on same link which you are refering : https://developer.android.com/studio/build/multidex.html#mdex-gradle
You can also see some related question for same error:
How to enable multidexing with the new Android Multidex support library
Android java.exe finished with non-zero exit value 1
in android studio im getting a lot of errors because i think something must have happened in the build.gradle. I may have accidentally deleted the dependices method (or whatever it is) inside the build.gradle now everytime i try to run a gradle project sync this happens (below)
I have tried the invalidate caches/restart but that has not worked.
Here is my what my gradle settings look like. (below).
All my other projects in android studio seem to be working fine. Can someone please help me here.
You misplaced the defaultConfig block. Should be like:
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 11
targetSdkVersion 21
versionCode 1
versionName "1.0"
applicationId "com.example.app"
}
buildTypes {
...
}
...
}
Android studio shows this Failure [INSTALL_FAILED_OLDER_SDK]
error occurs while installing the application.
I tried to change min sdk levels, gradle min sdk level but it is not working. Any suggestions?
Make sure the <uses-sdk> line in your manifest matches what's in build.grade, and that your target device/emulator version is in the same range.
Applications that target/compile with the Android L preview currently cannot be run on devices that do not have the L preview.
Change your compile and target versions to API 19 in your build.gradle like so and you should be all set:
android {
compileSdkVersion 19
defaultConfig {
targetSdkVersion 19
}
}