Java Question stan.jar, the hierarchy of the type is inconsistent

alwaysbusy

Expert
Licensed User
Longtime User
I'm trying to create a stan.jar file to be used in a Wear OS library in Eclipse. I got almost everything covered, except Ambient mode, which needs a FragmentActivity.

I do need the 'android.support.v4.app.FragmentActivity'.

So, I created a new project in B4A, added (I also need play-services-wearable, but I get the same error with only the #AdditionalJar: com.android.support:wear line):

B4X:
#AdditionalJar: com.google.android.gms:play-services-wearable
#AdditionalJar: com.android.support:wear

And compiled. So far, so good.

Now, in Eclipse I use this stan.jar file:

B4X:
package com.ab.test;

import android.support.v4.app.FragmentActivity;

public class TestActivity extends FragmentActivity {

}

And now Eclipse gives me the following error on TestActivity:

B4X:
the hierarchy of the type is inconsistent

I've installed the Android SDK 28, and are using this android.jar.

Do I need another #AdditionalJar? And in that case, which one?
 
Last edited:

alwaysbusy

Expert
Licensed User
Longtime User
It is in there (see screenshot) and I also tried adding the support-fragment yesterday but it gives the same result. I also tried it with others like AppCompatActivity (using #AdditionalJar: com.android.support:appcompat-v7), but with the same error.

I'm starting to wonder if it isn't an error in Eclipse. I'm using:

Version: Oxygen.3a Release (4.7.3a)
Build id: 20180405-1200

What do you use to make libraries? If Eclipse (I found some stuff on stackoverflow about cycling, which version?

FYI, this is how my manifest looks like (for the app to create the stan.jar file):

B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="26"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
CreateResourceFromFile(Macro, Themes.DarkTheme)
'End of default text.

eclipse.png
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
This is the important error:
SS-2018-09-27_09.54.57.png


I was mistaken. stan.jar only includes the jars that were expanded from AAR libraries. This is not the case with android.arch.lifecycle. The jar is referenced directly so it is not copied anywhere.

You can find it under:
C:\android-sdk-windows\extras\b4a_remote\android\arch\lifecycle\common\1.1.1

Add it to your Eclipse project. You will then need to add an unimplemented abstract method and it will compile.
 
Top