Java Question SLC problem compiling B4J Library

DonManfred

Expert
Licensed User
Longtime User
Starting step: Compiling Java code.
javac 1.8.0_151
E:\B4J\FirebaseAdmin4J\src\de\donmanfred\FirebaseAdminwrapper.java:54: error: cannot access Credentials
.setCredentials(GoogleCredentials.fromStream(serviceAccount))
^
class file for com.google.auth.Credentials not found
1 error
Error.

The Class com.google.auth.Credentials is inside the file
B4X:
google-auth-library-oauth2-http-0.9.0.jar
which is - beside other jars - inside the libs folder.

/libs/some jars
/src/de/donmanfred/FirebaseAdminwrapper.java

I can resolve the class from inside Eclipse.

Any hints what could be wrong?

I´m using B4J SLC 1.06
 

DonManfred

Expert
Licensed User
Longtime User
Great. THANKs!

After some other #additionaljar i now get the Firebase Admin part running :D

B4X:
    public FirebaseUserWrapper getUserByEmailAsync(String email) throws InterruptedException, ExecutionException{
        UserRecord rec = defaultAuth.getUserByEmailAsync(email).get();
        return (FirebaseUserWrapper) AbsObjectWrapper.ConvertToWrapper(new FirebaseAdminwrapper.FirebaseUserWrapper(), rec);
    }
    public FirebaseUserWrapper getUserByPhoneNumberAsync(String phoneNumber) throws InterruptedException, ExecutionException{
        UserRecord rec = defaultAuth.getUserByPhoneNumberAsync(phoneNumber).get();
        return (FirebaseUserWrapper) AbsObjectWrapper.ConvertToWrapper(new FirebaseAdminwrapper.FirebaseUserWrapper(), rec);
    }
    public String createCustomTokenAsync(String uid) throws InterruptedException, ExecutionException {
        String token = defaultAuth.createCustomTokenAsync(uid).get();
        return token;
    }
    public FirebaseUserWrapper createUser(String uid, String email, boolean emailVerified, String password, String phoneNo, String DisplayName, String PhotoUrl, boolean disabled) throws InterruptedException, ExecutionException {
        CreateRequest request = new CreateRequest()
                .setUid(uid)
                .setEmail(email)
        .setEmailVerified(emailVerified)
        .setPassword(password)
        .setPhoneNumber(phoneNo)
        .setDisplayName(DisplayName)
        .setPhotoUrl(PhotoUrl)
        .setDisabled(disabled);
        UserRecord rec = defaultAuth.createUserAsync(request).get();
        return (FirebaseUserWrapper) AbsObjectWrapper.ConvertToWrapper(new FirebaseAdminwrapper.FirebaseUserWrapper(), rec);
    }
    public FirebaseUserWrapper getUserAsync(String uid) throws InterruptedException, ExecutionException{
        UserRecord rec = defaultAuth.getUserAsync(uid).get();
        return (FirebaseUserWrapper) AbsObjectWrapper.ConvertToWrapper(new FirebaseAdminwrapper.FirebaseUserWrapper(), rec);
    }
 
Top