Seems to me that android has an android.support.v8 package that contains Renderscript support. The thing is, this doesn't seem documented anywhere - the support library docs don't say anything about a v8 package, just v4 and v13.
Is that package supported on all devices with API level 8 and above and can it be safely used in production?
Its not yet production quality.
My Android tools contain the files:
./build-tools/18.1.0/renderscript/lib/renderscript-v8.jar
./build-tools/18.1.1/renderscript/lib/renderscript-v8.jar
Putting them in the libs/ directory of your project will result in a working build in Eclipse and with ant.
PSA for Googlers: RenderScript is now part of the Android Support Library. You can use it on Android 2.2+.
I have eclipse, android sdk tools 22.6.3, android platform tools 19.0.1 and I set both of these projects API 19 android 4.4.2.
I was able to compile and run hellocompute(from the samples of android 19) and wants to change it to android support v8 things.
following steps works for me:
1.set android build target to 4.4.2 api 19.
2.add "rendersrcipt-v8.jar" to libraries in android build path
3.in project.properties set things like
"target=android-19
renderscript.target=19
renderscript.support.mode=true
sdk.buildtools=19.0.3"
4.Comment out the following import lines:
import android.renderscript.RenderScript;
import android.renderscript.Allocation;
and import
import android.support.v8.renderscript.*;
5.clean the project and rebuild.
Related
android studio code screeshot
Some Android imports are showing...Cant resolve symbol. even though those classes are available in SDK/Sources/...|(Red color code in picture)
Did you setup support library?
I think this is similar question.
You must setup support library same version of your project SDK version.
(ex. Android SDK version is 22, you must import com.android.support:appcompat-v7:22.+)
I am trying to use the support library for testing in Android. However, when I try to import
import android.support.test.runner.AndroidJUnit4;
as it is described here it says
The import android.support.test can not be resolved
I want to use revision 22 as I want to use the new features presented for UiAutomator.
There is no support\test folder in sources
I was digging around the sdk folder and I've notice that even though the path sources\android-21\android\support\test exists, sources\android-22\android\support has no test folder (there is a tests one but only with GrantActivity.java inside).
Did I forget to import any jars? (I tried importing support-annotations, and support-v4 but it's the same result).
Am I doing something wrong? I hope so and that you guys can help me figure it out.
Thanks in advance!
Note: I have downloaded the Android Support Repository and Library, I have all the packages from API 22 and I have Tools, Platform-Tools and Build-Tools up to date.
(I don't think it matters but I'm using Eclipse Kepler in Windows 7)
This isn't really supported, but since you're using Eclipse, you'll need to import the jar manually. The Android Support Repository gets downloaded to <SDK_DIR>/extras/android/m2repository. The class you want is part of the testing-support-lib, which is in the repository under com/android/support/test/testing-support-lib/0.1
Android uses .aar files for libraries, and the testing-support-lib is published as an aar. This format isn't supported by Ant, but if you unzip the testing-support-lib-0.1.aar file, it contains a classes.jar file that you can import.
As mentioned in the comments, you really should make the switch to Android Studio and use Gradle going forward so that you don't have to jump through these hoops.
I am having a issue regarding the resolving of appcompat_v7...As mentioned on many answers i imported the jar file from the \sdk\extras\android\support\v7\appcompat\libs...
but the problem is under properties->android i am getting a red cross next to appcompat_v7
as mentioned on various answers i then clicked on add button here...but i get no library name
the library is installed as the import is working properly as can be seen here the import shows no error..but my style.xml file in the res folder is showing the following error
can somebody please tel me what i am doing wrong here..
also my SDK manager shows that my android support library is installed...
I am just new to android and cant figure out what I am doing wrong here..
You dont import jar's from the appcompact-v7 library. You import the library itself in your workspace. Then you add the library into your project. In your project you can remove the appcompact-v7 in red and add it again. That should solve the issue.
Note also that:
You must have the latest versions of SDK Tools / Build Tools / Platform Tools. If you try this and it doesn't work, then go to the Android SDK Manager and make sure you have the latest versions of the required tools.
In case your project only requires API level 14 (Ice Cream Sandwich) & above, select API level 14 for "minimum required SDK" in the project wizard when you create a new project. Now the appcompat_v7 library will not be required for this project, and the application will use the native ActionBar class which is present in AOSP builds from ICS onwards.
Hopefully I am not missing something obvious. I have done a good bit of work to isolate this issue. Say I create a new Android project:
Target Platform: Google APIs Android 3.1 (API 12)
Min Platform: Android 2.2 Froyo (API 8)
When the project is created, AndroidManifest.xml shows min=8, target=15 (not sure why 15 and not 12 actually, but that's not the issue). And this looks fine:
included JAR: Google APIs [Android 3.1]
project.properties shows target=Google Inc.:Google APIs:12
So far, so good.
Now, without even editing the fresh project, I remove that project from the workspace, move it somewhere, and import using Import->Android->Existing Android Code into Workspace.
Now:
Included JAR: Android 2.2
project.properties shows target=android-8
And the project now has errors due to things like the Holo style not being present in 2.2.
I tried Project->Clean, nothing. I tried Android->Fix Project Properties. No change.
The only fix is to remove the project, delete the project.properties, update the AndroidManifest.xml to use min-sdk 12, and re-import. Even, then, I don't get the Google JAR:
Included JAR: Android 3.1
project.properties shows target=android-12
It seems like the import process incorrectly uses the min SDK value instead of the target when creating the project. Or is this somehow expected behavior? What am I missing?
(This scenario may seem a bit contrived, but I am an instructor trying to import student assignments. So this is causing me difficulties!)
Right click the imported project and go to
Properties - Android - Project Build Target
Specify the build target as the target sdk version.
Now it should include the correct jar file.
Hope this helps
I have imported a project to Eclipse. The version of the API was 15 and it compiled successfully, but I needed 7th because on my phone the OS cannot be updated. After changing the version of the Android API to older one (7th) I can't compile the project, the follwing errors occures:
import android.hardware.usb.UsbConstants;
import android.hardware.usb.UsbDevice;
import android.hardware.usb.UsbDeviceConnection;
import android.hardware.usb.UsbEndpoint;
import android.hardware.usb.UsbInterface;
import android.hardware.usb.UsbManager;
It says R cannot be resolved to a variable:
setContentView(R.layout.main);
And in main.xml
android:layout_width="match_parent"
it says: String types not allowed (at 'layout_width' with value 'match_parent').
Is it possible to resolve this errors, but still using the old API version?
If you need the USB functionality: No. It exists since API level 12.
You have to compile your project with the latest Android Api.
Project Properties -> Android -> Android 4.0
In the manifest, you can set the
<uses-sdk android:minSdkVersion="7" />
If you are not using any library or new feature, it should work.
Add the Jar of API 15 from platforms folder and include in Android MAnifesh as Android minsdk as 9 and target sdk as 15 then i hope your app will run