Android Question Error Mysql

TheFalcon

Active Member
Licensed User
Longtime User
Good morning, I have an apk that queries a Mysql, on some devices I get the error

B4X:
Error: java.net.UnknownServiceException: CLEARTEXT communication to www.mywebsite.com not permitted by network security policy

I have added the following line to ManifestEditor

B4X:
SetApplicationAttribute(android:usesCleartextTraffic, "true")
use both modes, with true and with false


And now I get the following error.
B4X:
AndroidManifest.xml:25: error: No resource identifier found for attribute 'usesCleartextTraffic' in package 'android'


As the error persisted, I updated the libraries using SDK manager
And now I get the following error.

B4X:
AndroidManifest.xml:29: error: Error parsing XML: not well-formed (invalid token)

I would appreciate any help.
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

TheFalcon

Active Member
Licensed User
Longtime User
I have read the link you told me followed the steps

1. Open Tools - B4A Sdk manager.
2. Install all recommended items. This will make the switch to AndroidX. You can always go back to the previous SDK.
3. Open Tools - Jetifier.
4. Click on Jetify. It is possible that the jetifier will fail to jetify a few libraries. In most cases you can ignore it as those libraries don't need to be jetified.
5. Clean the project (Ctrl + P)
6. Run your project. The compilation dialog will tell you which SDK was used:

But the error persists

B4X:
Organizando librerías.    (0.00s)
    (AndroidX SDK)
Generando el fichero R.    Error
AndroidManifest.xml:29: error: Error parsing XML: not well-formed (invalid token)

I don't know if it would be advisable to do a clean installation of androidX, instead of updating SDK to androidX.


and I also use firebasemessaging in my project, I don't know if it has anything to do with the token error, but even if I delete the firebassing lines from the ManifestEditor, the error continues


thx
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If you want i can help you Configuring the SDK correctly. I can connect to your PC using AnyDesk and i´ll help.

Start with downloading the ReadtorunSDK from here: https://www.b4x.com/android/forum/threads/ready-to-run-sdk.99780/

Give me your AnyDesc id and i´ll connect to your PC helping configuring anything.

It would be of help for me if you change your PC Language to ENGLISH first. I am not able to read spanish or whatever language it is which you are talking.
 
Upvote 0

TheFalcon

Active Member
Licensed User
Longtime User
I think I solved the problem, uninstalled all the Android, SDK and did clean installation.
Download AndroidX from B4 and use Jenifer.

And the mistake he gave me now was about firebassingmessage, so the new problem was the code that had it outdated

change

B4X:
'************ Google Play Services Base ************
AddApplicationText(
   <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"
  android:exported="false"/>
    <meta-data
  android:name="com.google.android.gms.version"
  android:value="@integer/google_play_services_version" />
)
'************ Google Play Services Base (end) ************

by

B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)


At the moment it seems that everything is correct, waiting for a friend who gave the network security error, try it
 
Upvote 0
Top