android.support.v8 cannot be resolved - android

I am trying to use renderscript in my Android project. I installed sdk tools 22.6.2 and sdk build tool 19.0.3 and then updated my adt to the latest version. But now I get error that
"The import android.support.v8 cannot be resolved" on the line where I wrote import android.support.v8.renderscript.*. I have also made the following changes in projects.properties
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=19.0.3
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazing.imazing"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.amazing.imazing.MainActivity"
android:label="#string/app_name"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
I am new to Android programming.

I removed all the entries from the project.properties except the one 'target=android-18' and copied the renderscript-v8.jar to the libs folder of my project. I found this jar file in sdk/build-tools/18.1.0/renderscript/lib. I stopped getting that error.
I repeated this process in another project and it works.

Try this
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=18.1.0

Which IDE are you using? Pay attention to the fact that Android Studio/Gradle-based builds are not yet supported by the RenderScript support library.
In addition, IntelliJ IDEA ignores the project.properties file, even if you are using the default build system ("make").

Related

Why the import android.support.v7.widget.Toolbar cannot be resolved in my project

I've trying create an app which is need Toolbar. I've already add "appcompat_v7.jar" to my project which I've got no result.
I've already review some links below and they couldn't help so.
The Import android.support.v7 cannot be resolved
The import android.support.v7.app cannot be resolved
The Import android.support.v7 cannot be resolved
Here is my "AndroidManifect":
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tabex"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Also image from Eclipse:
As you can see other import from v7 works but the Toolbar not. I've really appropriate your help.
Looking at your SDK Manager screenshot, you are using an old version of the Support Library. The Toolbar widget did not get introduced until v21, you are using v20. Upgrade to latest.
I've Upgrade my Android Support Library to Latest version which is 23.0.1 and It's work hundred percent.

unable to change version in androidmanifest.xml

I am creating any android application and the want to upload in play store.My problem is the that when i try to change the version i am AndroidMainfest.xml and try to build the apk then version of application change to previous one.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.menubar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
in Android Studio just change Version value in Build.gradle this will override values with manifest.xml
defaultConfig {
applicationId "YourID"
.......
versionCode 001
versionName '0.0.1'
}
If you are using Eclipse then just change version in manifest.xml and clean and built new apk. I am damn sure this'll change your app version.
android:versionCode="1.1"
android:versionName="1.0.1"
If you are using Android Studio, you must change the App Version in gradle.
When you build your application, Gradle replace values from manifest.
If you are using eclipse, check if you do not change AndroidManifest.xml placed on build folder.
If this does not work, try to project > clean, make changes and rebuild.

Error: Could not find MyFirstApp.apk

I am following he tutorial from this site: http://developer.android.com/training/basics/firstapp/creating-project.html, but when I run the default program in eclipse when an android project is created, it gives me the error R could not be found. To fix this, I commented out the lines with R and ran it again, but now it gives me the error: Could not find MyFirstApp.apk!... I have tried all other solutions on this site, but none of them work. If anybody knows how to fix this, please let me know!
here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.myfirstapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
When your .R class could not be found, there is an error in your project - commenting out the lines with the .R class does not fix the problem.
Perhaps you just have to clean your workspace (Project > Clean...) or delete the bin and gen folder in your project, they should be rebuilt automatically.
Look at the Problems tab next to the Console tab where you get the errors and take a look at the messages.
when I had originally installed the android sdk it installed to some folder in my filesystem. I moved the SDK manager to a folder on my desktop, and installed updates through there. I had to change my android path to that folder, and everything fixed! Thanks for your help though, it was much appreciated.

Android: error: R cannot be resolved to a variable

I have tried nearly everything to get the R.java file to reappear and nothing has worked yet. The src folder and the AndroidManifest.xml file both have an error icons next to them.
I get the following error from the Manifest file...
"error: No resource identifier found for attribute 'installLocation' in package 'android'"
I get the following errors from some .java files in the src folder...
"R cannot be resolved to a variable"
In these .java files the "R" is underlined with a red squiggle.
I have tried the following and none of these methods have worked...
Cleaning & Rebuilding the project
Removing the "import Android.R" statement
Renaming the project and changing it in the Manifest file
Checking to ensure that the res/drawable files are lowercase
Check that my package declaration in your AndroidManifest.xml matches package name
Restarting Eclipse
Ticking Android Version Checkbox in the Java Build Path
Installing the correct SDK Platform
Any suggestions??
EDIT:
Here's the manifest file...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.jfedor.frozenbubbleupdate"
android:installLocation="preferExternal"
android:versionCode="8"
android:versionName="1.7" >
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true" />
<uses-sdk android:minSdkVersion="2" />
<application
android:icon="#drawable/app_frozen_bubble"
android:label="#string/app_name" >
<activity
android:name="org.jfedor.frozenbubbleupdate.FrozenBubble"
android:alwaysRetainTaskState="true"
android:configChanges="orientation|keyboardHidden"
android:label="#string/app_name"
android:launchMode="singleInstance" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="org.jfedor.frozenbubble.GAME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
What value do you have in the minSDK in your AndroidManifest?
This problem can be due to having a sdk version lower than API 8:
http://developer.android.com/guide/topics/data/install-location.html.
Also, if you could post your Manifest would be usefull. Your R file is not being generated because some error in your project, in your Manifest from what you said.
You will need something like this:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
You should add android:targetSdkVersion="17" to your <uses-sdk> tag. The target SDK should always be set to the highest SDK version currently available.
As the android:installLocation attribute wasn't introduced until API version 8, it is likely that not specifying the target SDK is causing the compiler to compile against the wrong API version.

Conversion to Dalvik format failed with error 1 with android-support-v4.jar

I am trying add the facebook library to my Android project, a getting Conversion to Dalvik format failed with error 1 error. After searching, it seems that my problem is related to the android-support-v4.jar.
Both the jar appears in the facebook dependencies and in the dependencies in my project. I deleted both jars and re-added one to the facebook library, but I still get the error. Below is a screen shot to show where the dependencies are.
Thanks.
You have a duplicated dependency issue.
Remove the last dependency on the NCC project
android-support-v4.jar - /Users/Heather/Documents/workspace/facebook-android-sdk-3.0/facebook/libs
android-support-v4.jar is already provided by the FacebookSDK library project, therefore there's no need to reference it again on the main project
I was having this problem too with an app that used Facebook SDK. I was trying all sorts of stuff, so I'm not sure what exactly fixed but here's settings that worked for me:
FacebookSDK > Properties > Java Build Path > Order and Export
Android 2.2 - NOT CHECKED
Android Private Libraries - CHECKED
Android Dependencies - CHECKED
MyApp > Properties > Java Build Path > Order and Export
Android 4.2.2 - CHECKED
Android Private Libraries - CHECKED
Android Dependencies - CHECKED
In addition, I had done this before, not sure it mattered. Reverted to Facebook SDK version 3.5 from 3.5.2. Updated to latest ADT 22.2.1. Changed Facebook SDK to use Android 2.2 from 4.2.2.
Sometimes the error is caused due to the permissions also. Check if you have declared multiple permissions in your manifest file. Delete the extraneous permission from the file.
This worked for me :
this is a typical manifest file for facebookSDK based app
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devey.androidnativeapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:permission="android.permission.ACCESS_CHECKIN_PROPERTIES"
android:theme="#style/AppTheme" >
<activity
android:name="com.devey.androidnativeapp.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="#string/app_id" />
<activity android:name="com.facebook.LoginActivity" >
</activity>
<activity
android:name="com.devey.androidnativeapp.Testnative"
android:label="#string/title_activity_testnative" >
</activity>
</application>
</manifest>
I deleted this extra permission and clean build my app with no further errors :
android:permission="android.permission.ACCESS_CHECKIN_PROPERTIES"

Categories

Resources