It turns out that I needed to edit the local.properties file in plaform/frameworks/support to add the sdk directory, i.e.
sdk.dir=/path/to/android-sdk-linux/
Adding this actually led to the disappearance of all shennigans llvm-rs-cc, but ... there is more
The answer to stackoverflow that I used said to use this command
platform\frameworks\support\v4\gradle clean jar
which I interpreted as meaning going to the v4 directory and then calling gradle with
gradle clean jar
Here are the complete steps that I followed if someone also wants to create a support library.
- First follow the instructions in this:
You need to check the additional repositories https://android.googlesource.com :
- platform / framework / support
- platform / prebuilts / gradle -plugin
- Platform / prebuilts / maven_repo / android
- Platform / prebuilts / SDK
- Platform / prebuilts / tools
Please keep the directory structure as in the Android repository.
Install lib32stdc++6 and lib32z1 , I used apt-get
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
Download android sdk from the Android developer website here
Unzip the archive to any place, then go to it, then to tools\
Run ./android , this should hide the sdk manager, and then download these packages if they are not already loaded
- All android api from api 4 to api 22 (You may need to show outdated packages).
- Build Tools 19.01 (You may need to show deprecated packages) and the latest build tools
- The latest platform tools
- Latest SDK Tools
Usually this is enough to create a support library using gradle, but it turns out that the jar file in the git repository for api 22 is not actually updated, because it does not contain the new AccessibilityInfo methods that were added in api 22, yes, I decompiled it to be sure. So a few more steps.
- Replace the
andoid.jar file in the platform/prebuilts/sdk/current that you downloaded from the git repository named android-sdk-linux/platforms/android-22/
We are almost done here, but two more problems. If you try to build the library now, there will be two compilation errors in FragmentActivity.java and in FragmentActivity.java do not hesitate to fix them as you like, since I'm not sure how correct my fix is ββfor them.
To fix them, in Fragment.java on line # 935 I added a listing like this
result.setFactory(mChildFragmentManager.getLayoutInflaterFactory());
has become
result.setFactory((LayoutInflater.Factory)mChildFragmentManager.getLayoutInflaterFactory());
For another fix in FragmentActivity.java on line # 299 I replaced
final View v = mFragments.onCreateView(name, context, attrs);
with this
final View v = mFragments.onCreateView(null, name, context, attrs);
The reason for adding a null value was that in previous versions, the first parameter, which is the View parent , did not exist and was declared and initialized to be null in the onCrateView parent method.
The resulting jar file can be found in platform/out/host/gradle/frameworks/support/support-v4/build/libs/ * Some steps may be missing, because this process took me a lot of time, and I may have forgotten some things, which i did.