Sketchware-Pro / Sketchware-Pro

Sketchware Pro's sources in Java. Now anyone can contribute to Sketchware Pro.
https://sketchware.pro
Other
863 stars 254 forks source link

Admob library causing bug in my production app #888

Open abrihamdemisse opened 11 months ago

abrihamdemisse commented 11 months ago

a lot of my users are facing "[ java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/tasks/Tasks; at com.google.android.gms.internal.ads.zzdyu.zzb(com.google.android.gms:play-services-ads@@20.1.0:2) at com.google.android.gms.ads.internal.zzi.(com.google.android.gms:play-services-ads@@20.1.0:8)" this kind of bug, fix the app's admob library as soon as possible.

when i tried to add the library manually the compiler crash and say "a.a.a.By: Duplicate files from two libraries detected File1: /data/user/0/com.sketchware.remod/cache/libs/libs/play-services-tasks-17.2.1/classes.jar File2: /storage/emulated/0/.sketchware/libs/local_libs/play-services-tasks_V_18.0.1/classes.jar Archive path: play-services-tasks.properties at a.a.a.Dp.buildApk(Dp.java:628) at com.besome.sketch.design.DesignActivity$BuildAsyncTask.b(DesignActivity.java:1073) at a.a.a.MA.a(Unknown Source:11) at com.besome.sketch.design.DesignActivity$BuildAsyncTask.doInBackground(DesignActivity.java:1176) at com.besome.sketch.design.DesignActivity$BuildAsyncTask.doInBackground(DesignActivity.java:928) at android.os.AsyncTask$3.call(AsyncTask.java:394) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) "

JavkhlanK commented 11 months ago

are you using any Local libraries? could you tell any steps to reproduce that issue?

abrihamdemisse commented 11 months ago

are you using any Local libraries? could you tell any steps to reproduce that issue?

yes i am using other library but for completely different use., what do you mean to reproduce that issue. the issue occurred for some users not for all users

JavkhlanK commented 11 months ago

to your edited message: of course it's not going to work! you have to exclude the built-in one first if you even want that. see #696 for more details on that

JavkhlanK commented 11 months ago

what do you mean to reproduce that issue. the issue occurred for some users not for all users

I'm asking for steps to e.g. make my own project crash just like yours. I can't possibly try all combinations while you at least have 1 project where the issue's occurring.

Anyway I just checked built-in libraries' dependencies and it looks like only having AdMob enabled could make Sketchware Pro "forget" to add the Play Services Tasks library. I definitely need to look further into that though.

JavkhlanK commented 11 months ago

Also, don't edit comments and expect people to magically notice you did. Unlike posting new comments, that doesn't notify members of the thread.

abrihamdemisse commented 11 months ago

Also, don't edit comments and expect people to magically notice you did. Unlike posting new comments, that doesn't notify members of the thread.

😅 sorry about that, anyways please fix it on time, it is causing troubles in my app.

abrihamdemisse commented 11 months ago

what do you mean to reproduce that issue. the issue occurred for some users not for all users

I'm asking for steps to e.g. make my own project crash just like yours. I can't possibly try all combinations while you at least have 1 project where the issue's occurring.

Anyway I just checked built-in libraries' dependencies and it looks like only having AdMob enabled could make Sketchware Pro "forget" to add the Play Services Tasks library. I definitely need to look further into that though.

it just has Normal app having admob integrated, the issue occurred for some users not for all users

JavkhlanK commented 10 months ago

should've been fixed by 20855e7af010fb10bc7288f1c8e061db0139b401

adesonob commented 9 months ago

no corrected. In app debug it works , But not in production

adesonob commented 9 months ago

I added admob to my project and compiled it, it worked perfectly. I generated aab and sent it to playstore, and it didn't work anymore. The app opens and closes at the same time.

I entered the playstore to see the failure:

Exception java.lang.RuntimeException: at android.app.ActivityThread.installProvider (ActivityThread.java:7986) at android.app.ActivityThread.installContentProviders (ActivityThread.java:7492) at android.app.ActivityThread.handleBindApplication (ActivityThread.java:7220) at android.app.ActivityThread.-$$Nest$mhandleBindApplication at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2241) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loopOnce (Looper.java:211) at android.os.Looper.loop (Looper.java:300) at android.app.ActivityThread.main (ActivityThread.java:8410) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:559) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:954) Caused by androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ProcessLifecycleInitializer; at androidx.startup.AppInitializer.doInitialize (AppInitializer.java:162) at androidx.startup.AppInitializer.discoverAndInitialize (AppInitializer.java:198) at androidx.startup.InitializationProvider.onCreate (InitializationProvider.java:42) at android.content.ContentProvider.attachInfo (ContentProvider.java:2468) at android.content.ContentProvider.attachInfo (ContentProvider.java:2433) at android.app.ActivityThread.installProvider (ActivityThread.java:7981) Caused by java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ProcessLifecycleInitializer; at androidx.emoji2.text.EmojiCompatInitializer.dependencies (EmojiCompatInitializer.java:128) at androidx.startup.AppInitializer.doInitialize (AppInitializer.java:143)

abrihamdemisse commented 9 months ago

How is it fixed? , when will be a public new release? it has been a while.

ilyassesalama commented 8 months ago

Do you guys use ProGuard in production?

subhash16 commented 8 months ago

Do you guys use ProGuard in production?

Yes

ilyassesalama commented 8 months ago

Yes

I'd suggest testing your app in production without using ProGuard (you don't have to publish the unobfuscated version to Play Store). Generate the AAB then test it on Firebase or install it on your device. If it works, do the same but this time with ProGuard enabled, and let us know the result.

abrihamdemisse commented 8 months ago

yes of course.

On Sun, Sep 3, 2023, 6:18 PM Ilyasse @.***> wrote:

Do you guys use ProGuard in production?

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/888#issuecomment-1704332194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV24KHCLJKX7G3ADKICX6RDXYSNVDANCNFSM6AAAAAAZFI2JMY . You are receiving this because you authored the thread.Message ID: @.***>

JavkhlanK commented 8 months ago

Caused by androidx.startup.StartupException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/lifecycle/ProcessLifecycleInitializer;

this doesn't look ProGuard-related to me, it's the exact same issue I fixed kinda hackishly in commit 20855e7af010fb10bc7288f1c8e061db0139b401

abrihamdemisse commented 8 months ago

it is now occurring in my phone , i can't test it. i will just try to prevent keep that admob package .

On Thu, Sep 7, 2023, 11:52 AM Abrish Abrish @.***> wrote:

yes of course.

On Sun, Sep 3, 2023, 6:18 PM Ilyasse @.***> wrote:

Do you guys use ProGuard in production?

— Reply to this email directly, view it on GitHub https://github.com/Sketchware-Pro/Sketchware-Pro/issues/888#issuecomment-1704332194, or unsubscribe https://github.com/notifications/unsubscribe-auth/AV24KHCLJKX7G3ADKICX6RDXYSNVDANCNFSM6AAAAAAZFI2JMY . You are receiving this because you authored the thread.Message ID: @.***>

subhash16 commented 8 months ago

Hey I have an idea to fix this and it's working Open project> then goto Configuration (three dot)> AndroidMenifest> App Components> Then paste this code

NB:- ca-app-pub-3940256099942544~3347511713 Is your admob app ID

ilyassesalama commented 8 months ago

We literally warned everyone 2 years ago that their apps would crash if they didn't specify the app ID in manifest. Could you make sure to read everything we post this time?

Screenshot 2023-09-10 at 16 00 32

Here's the invite link if you're not part of our community yet: http://discord.gg/kq39yhT4rX

JavkhlanK commented 8 months ago

@ilyassesalama @subhash16 this Issue tracks a different thing