Android Question Migration to Android V8 target sdk 26

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi,

we are doing some tests to anticipate the compatibility of our app with Android V8 and got the problem:

java.lang.RuntimeException: Unable to start service org.abtollc.service.ABTOSipService@1eea1f8 with Intent { act=org.abtollc.service.ABTOSipService cmp=com.comten/org.abtollc.service.ABTOSipService (has extras) }: java.lang.SecurityException: Failed to find provider org.abtollc.db for user 0; expected to find a valid ContentProvider for this authority

How can I fix it? It's working on Android V7!
 

Marcos Alves

Well-Known Member
Licensed User
Longtime User
We cannot guess what you are doing. You should provide more information.
Ok. lets go:

- We use a lib from Abto > THIS https://www.b4x.com/android/forum/threads/voip-sip-sdk-for-b4a.73860/#post-578518

- It's running fine up to Android 7. When trying to install in an AVD using Andoid 8, got the error (exactly):

java.lang.RuntimeException: Unable to start service org.abtollc.service.ABTOSipService@12db774 with Intent { act=org.abtollc.service.ABTOSipService cmp=com.comten.nexphone/org.abtollc.service.ABTOSipService (has extras) }: java.lang.SecurityException: Failed to find provider org.abtollc.db for user 0; expected to find a valid ContentProvider for this authority

Doing some research, I could see that it's something related to the Manifest (https://stackoverflow.com/questions...-provider-null-for-user-0-on-activeandroid-on) - but I really can't see how can I fix it... could you help?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Ok. lets go:

- We use a lib from Abto > THIS https://www.b4x.com/android/forum/threads/voip-sip-sdk-for-b4a.73860/#post-578518

- It's running fine up to Android 7. When trying to install in an AVD using Andoid 8, got the error (exactly):
I don't see how you expected us to know this information.

There are several options. Start with the most optimistic. Maybe this library doesn't work on the emulator. Does it work on the emulator if you set the targetSdkVersion to 23 ?
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
I don't see how you expected us to know this information.

There are several options. Start with the most optimistic. Maybe this library doesn't work on the emulator. Does it work on the emulator if you set the targetSdkVersion to 23 ?
Yes, works in emulator with Android 7 and in target 26 also! Doesn't work in Android 8 AND target 26. It looks that it's something related to "contents provider" in manifest. I'm not sure but I fell that this behavior in V8 could affect other libraries also requiring some manifest change no?


Hello @Abto , as this is a commercial lib written by you, I think that your development team could help us here...
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
I guess that this library creates a content provider and it should have been declared in the manifest editor.

This doesn't affect other libraries as most libraries do not create a content provider.
suppose that @Abto doesn't answer here... is it possible to guess the required manifest clause only reading the error message ?

<provider
android:name="com.activeandroid.content.ContentProvider"
android:authorities="??????????"
android:enabled="true"
android:exported="false">
</provider>
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
#UPDATE: @Abto answered via ticket as follows:

To fix this crash:
In manifest should be added:
<provider android:name="org.abtollc.db.DBProvider"
android:authorities="--authorities_name---">
</provider>
<meta-data android:name="AbtoVoipAuthority" android:value="--authorities_name--" />

this can be done via 'AddApplicationText'.

They send also a new lib to update - if any member uses the old lib, request them the update.
I'll test and post results here.
 
Last edited:
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
#UPDATE: @Abto answered via ticket as follows:

To fix this crash:
In manifest should be added:
<provider android:name="org.abtollc.db.DBProvider"
android:authorities="--authorities_name---">
</provider>
<meta-data android:name="AbtoVoipAuthority" android:value="--authorities_name--" />

this can be done via 'AddApplicationText'.

They send also a new lib to update - if any member uses the old lib, request them the update.
I'll test and post results here.
Hi we also use the SDK, what is the "--authorities_name---" as I have the same issue.
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Hi we also use the SDK, what is the "--authorities_name---" as I have the same issue.
Hello,

and... how to fix it ? I tested on a Virtual Device without any problem....
About your question, authorities name is the name of file provider used by app. Android 8 requires a reference to the file and path where the app storage data.
For example... suppose that you app pack name is: com.mypack... then

B4X:
AddApplicationText(
<meta-data android:name="AbtoVoipAuthority" android:value="com.mypack.db" />
<provider
android:name="org.abtollc.db.DBProvider"
android:authorities="com.mypack.db"
android:exported="false" />
)

Remember that Abto updated the lib also... but even after this manifest clause /update I'm still getting the "parse error" on Android 8 only in Physical device, specifically S8 Samsung.
 
Last edited:
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello,

and... how to fix it ? I tested on a Virtual Device without any problem....
About your question, authorities name is the name of file provider used by app. Android 8 requires a reference to the file and path where the app storage data.
For example... suppose that you app pack name is: com.mypack... then

B4X:
AddApplicationText(
<meta-data android:name="AbtoVoipAuthority" android:value="com.mypack.db" />
<provider
android:name="org.abtollc.db.DBProvider"
android:authorities="com.mypack.db"
android:exported="false" />
)

Remember that Abto updated the lib also... but even after this manifest clause /update I'm still getting the "parse error" on Android 8 only in Physical device, specifically S8 Samsung.


Ok, thanks I will try it, when did they give you the updated SDK ?
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Yes, but what did you put in the manifest file ?
Exactly the lines those I posted ... replacing the authority-name by my package name "plus" ".db"
I mean: package name: com.mypack -> authority name -> com.mypack.db

Works fine for physical Android 7 and emulator Android 8. I didn't tested for physical device Android 8 but an user told me that is getting the "package parsing error" during install in a Samsung S8 (notice that the user is trying to install using apk - the new version isn't at play store yet...)
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Yes, they gave me. Request them via ticket and they will give to you also - when you bought the lib you must to had received by email a link to contact them.

Our company paid them to develop the lib for B4A :)

Is this correct ?
B4X:
AddApplicationText(
               AddApplicationText(
                   <meta-data android:name="AbtoVoipAuthority" android:value="com.islesystems.pushtotalk.db" />
                   <provider
                       android:name="org.abtollc.db.DBProvider"
                       android:authorities="com.islesystems.pushtotalk.db"
                       android:exported="false" />
               )


Our package name is : com.islesystems.pushtotalk
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
Our company paid them to develop the lib for B4A :)

Is this correct ?
B4X:
AddApplicationText(
               AddApplicationText(
                   <meta-data android:name="AbtoVoipAuthority" android:value="com.islesystems.pushtotalk.db" />
                   <provider
                       android:name="org.abtollc.db.DBProvider"
                       android:authorities="com.islesystems.pushtotalk.db"
                       android:exported="false" />
               )


Our package name is : com.islesystems.pushtotalk
Yes, we paid. A wrap of SIP for B4A is a "must"... must to have the same for B4I but there isn't... :(
 
Upvote 0

Marcos Alves

Well-Known Member
Licensed User
Longtime User
But... I'm still getting the "parsing problem" installing on S8 and I'm really don't animated to buy a S8 only to test and fix it... can anybody else help?
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
THIS -> https://www.b4x.com/android/forum/threads/problem-parsing-the-package.94100/#post-595505

Sorry, I mistaken the posts... but this is related to that. I think that, at the end of the day, maybe sometime after update you could get the problem listed on the subsequent post.

Hi we just test on a physical Android 8.0 device and did not get a parse error. In the abto lsdk they provide and sample apk, maybe try that and see if it installs without the parse error.

Regards

John.
 
Upvote 0
Top