Android Question puzzle about aar used in b4a?

jstzjjk

Member
i want to merge an ad SDK.
so,i make an tool aar, with SDK aar, in android , i make a simple test project, it runs ok.

my tool aar name is "mylibrary-release.aar", contains MyApplication.java and SplashADActivity ,
do initSDK in Application ,contains a SplashActivity, fetch Ad when Activity start.
as.png

in AS, i do the simple thing.set android:name="com.pocket.zxpa.MyApplication", start the SplashADActivity ,
it runs ok.
but in b4a, i still set SetApplicationAttribute(android:name, "com.pocket.zxpa.MyApplication") , start the SplashADActivity ,
then it aways init GDTADPLugin error.
View attachment 133575

Main Code:
SetApplicationAttribute(android:theme, "@style/Theme.AppCompat.Light.NoActionBar")
SetApplicationAttribute(android:requestLegacyExternalStorage, true)
SetApplicationAttribute(android:name, "com.pocket.zxpa.MyApplication")
AddApplicationText(
 <activity android:name="com.pocket.zxpa.SplashADActivity"/>)
 ------------------
 #AdditionalJar:C:\_FetchDemo\jar_aar\csj_ad_sdk_220513.aar
#AdditionalJar:C:\_FetchDemo\jar_aar\gdt_ad_sdk_220531.aar
#AdditionalJar:C:\_FetchDemo\jar_aar\ks_ad_sdk_220531.aar
#AdditionalJar:C:\_FetchDemo\jar_aar\pocket_ad_sdk_3.0.6.aar
#AdditionalJar:C:\_FetchDemo\jar_aar\gson-2.8.8.jar
#AdditionalJar:C:\_FetchDemo\jar_aar\okhttp-4.9.2.jar
#AdditionalJar: C:\_FetchDemo\jar_aar\kotlin-stdlib-1.4.10.jar
#AdditionalJar:C:\_FetchDemo\jar_aar\okio-jvm-2.8.0.jar
#AdditionalJar:C:\_FetchDemo\jar_aar\\mylibrary-release.aar
--------------
Sub Button1_Click
    'have request permission
     Dim intent1 As Intent
    intent1.Initialize("","")
    intent1.SetComponent("com.pocket.topbrowser/com.pocket.zxpa.SplashADActivity")
    StartActivity(intent1)
End Sub
I don't know why?
the project is big,i cannot attach file. i upload it to my website.
https://github.com/feifeiyu5689/demo
note I found the apk built by as, has assets/gdt_plugin/gdtadv2.jar
i copy to b4a files, and build, then has has assets/gdt_plugin/gdtadv2.jar,
but still error initPLUGIN.
 
Last edited:
Top