sadiqrazasyed / wallpaperboard-enhanced

Android Json based wallpaper dashboard library
38 stars 23 forks source link

Fully disable ads? #12

Open yasanglass opened 6 years ago

yasanglass commented 6 years ago

disabling ads, adblock message etc.

when i dont put my ad codes it wont show ads but it will still show adblock message to some users while the app doesnt have any ads.

sadiqrazasyed commented 6 years ago

AD Block message has nothing to do with AdMob and works differently. Just remove the startHandler(); from WallpaperBoardActivity.java and it won't check for any adblocker.

yasanglass commented 6 years ago

okay thanks ill try it.

yasanglass commented 6 years ago

im trying to do this but i cant build the library source on android studio. everytime i get this error:

Unable to find method 'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputPropertyBuilder;'. Possible causes for this unexpected error include:

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

i have tried the "redownload dependencies" alot of times and every single time the same result. also i did invalidate cache but still i cant make it work. is this a problem from your side or am i doing something wrong?

sadiqrazasyed commented 6 years ago

im trying to do this but i cant build the library source on android studio. everytime i get this error:

Unable to find method 'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputPropertyBuilder;'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes. i have tried the "redownload dependencies" alot of times and every single time the same result. also i did invalidate cache but still i cant make it work. is this a problem from your side or am i doing something wrong?

Did you update your Android Studio? That could be the reason.

You will have to update the gradle tools version and support library version. Here's what you need to do :

Update classpath 'com.android.tools.build:gradle:3.0.1' to "3.2.0".

Update BuildTools = "27" to "28", followed by TargetSdk = 27 & CompileSdk = 27 to "28".

Then, update SupportLibrary = "27.1.0" to "28.0.0".

After making the changes, "Sync" and it should be fine. If you get the same error then after following those directions, update distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip to "4.6-all" and sync again.

Also, replace "compile" to "implementation" & "testCompile" to "testImplementation"

If you face any google services related or multidex error then update

    // Required for OneSignal
    implementation 'com.google.android.gms:play-services-gcm:11.8.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'

    // Google Ads
    compile 'com.google.android.gms:play-services-ads:11.8.0'

To


    // Required for OneSignal
    implementation 'com.google.android.gms:play-services-gcm:12.0.1'
    implementation 'com.google.android.gms:play-services-analytics:12.0.1'

    // Google Ads
    compile 'com.google.android.gms:play-services-ads:12.0.1'

And then, replace this snippet

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion rootProject.ext.SupportLibrary
            }
        }
    }
}

With this

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion rootProject.ext.SupportLibrary
           } else if (requested.group == "com.google.android.gms") {
                details.useVersion '12.0.1'
            }
        }
    }
}

And you should be fine.

Dani needs to update his project with latest Build.Gradle Tools & SDK in order to avoid the problems.

Edit: Seems like SupportLibrary 28.0.0 is causing issues as per StackOverFlow and Reddit so I suggest you to downgrade your AS version to "3.0.1" and wait for Google to fix the issue. If you use latest version of AS then you will have problems.

yasanglass commented 6 years ago

I did these changes. it builds with only this error:

One of the plugins you are using supports Java 8 language features. To try the support built into the Android plugin, remove the following from your build.gradle: apply plugin: 'me.tatarka.retrolambda' To learn more, go to https://d.android.com/r/tools/java-8-support-message.html

but the build is successful anyways. but when i try to build an apk i get this:

Compilation failed; see the compiler error output for details. Run task: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:compileDebugJavaWithJavac'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73) at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51) at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101) at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54) at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:256) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:249) at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:238) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:663) at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:597) at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:745) Caused by: org.gradle.api.internal.tasks.compile.CompilationFailedException: Compilation failed; see the compiler error output for details. at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:52) at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:37) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:98) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:51) at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:37) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:35) at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:25) at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringDecorator.execute(IncrementalResultStoringDecorator.java:41) at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringDecorator.execute(IncrementalResultStoringDecorator.java:27) at org.gradle.api.internal.tasks.compile.incremental.IncrementalAnnotationProcessingCompiler.execute(IncrementalAnnotationProcessingCompiler.java:50) at org.gradle.api.internal.tasks.compile.incremental.IncrementalAnnotationProcessingCompiler.execute(IncrementalAnnotationProcessingCompiler.java:36) at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:156) at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:126) at com.android.build.gradle.tasks.factory.AndroidJavaCompile.compile(AndroidJavaCompile.java:92) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73) at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:50) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39) at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:124) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336) at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328) at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199) at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113) at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95) ... 33 more

sadiqrazasyed commented 6 years ago

Which version of Android Studio are you using? Cause I personally tried compiling apk with and without the signature and it seems to work.

Edit: If you've followed my instructions properly then it shouldn't cause any problems. Nevertheless, try

  1. Clean Project
  2. Rebuild project
  3. Sync project with Gradle file

Also, invalidate the cache and restart as well. If the problem exists, then run --stacktrace --debug or simply add it to AS > Preferences > Compiler > Command-line options : --stacktrace --debug (refer to the screenshot) and try to build the app again and share the logs.

screen shot 2018-10-06 at 1 08 02 am

ankit68 commented 6 years ago

Hello Sadiq,

I'm having the exact same problem as reported above by Yasan. In my case I'm using the latest Android Studio 3.2

On Sat, Oct 6, 2018 at 1:04 AM Sadiq notifications@github.com wrote:

Which version of Android Studio are you using? Cause I personally tried compiling apk with and without the signature and it seems to work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sadiqrazasyed/wallpaperboard-enhanced/issues/12#issuecomment-427475985, or mute the thread https://github.com/notifications/unsubscribe-auth/AKuZQtgWMQ1aCZKJq6TPkphbBGQd0BPiks5uh7RHgaJpZM4W7lP2 .

yasanglass commented 6 years ago

oh right. i am using 3.2, thats why there are problems i guess! I have to wait for Google to fix it then.

sadiqrazasyed commented 6 years ago

@yasandev @anikt68 use Android Studio 3.0 and you should be fine as Google has made major changes to version 3.2. I'll update the project and make it compatible with the latest version ASAP.

Edit: Also, give heads up to Dani regarding this as his actual library needs to be updated as well, especially now that Google has restricted apps to be Targeted to 27 SDK and his project targets 26 SDK.

yasanglass commented 6 years ago

@sadiqrazasyed he is kinda stopped working on WB as it looks. hopefully he will update it.

also i cant really find a way to downgrade my AS. even if i reinstall AS ill get the latest version. im not sure what im supposed to do except waiting.

sadiqrazasyed commented 6 years ago

@yasandev You can directly run the AS 3.0 version instead of re-installing the whole thing. You can download it from here : https://developer.android.com/studio/archive. And guess I should fix all these errors and make it compatible with latest version of AS myself then, which will take some time. But I'll try to contact Dani and see if he's up for it.

yasanglass commented 6 years ago

Okay thanks. I'll probably do it so I won't have to wait for your fix and update my app.

I'll create an issue on WP for Dani.

yasanglass commented 6 years ago

With AS 3.0 im getting these errors:

Error:(251, 5) error: resource android:attr/fontVariationSettings not found. Error:(251, 5) error: resource android:attr/ttcIndex not found.

Error:(498) resource android:attr/fontVariationSettings not found. Error:(498) resource android:attr/ttcIndex not found.

Error:failed linking references. Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details Error:Execution failed for task ':app:processDebugResources'.

Failed to execute aapt Information:BUILD FAILED in 23s

sadiqrazasyed commented 6 years ago

Replace this in gradle(Project)

classpath 'com.android.tools.build:gradle:3.1.4'

    rootProject.ext {
        BuildTools = "27"
        MinSdk = 16
        TargetSdk = 28
        CompileSdk = 28
        SupportLibrary = "28.0.0"
    }
}

Remove this line buildToolsVersion rootProject.ext.BuildTools Also from here HERE

And paste this line

buildToolsVersion '27.0.3'

Then in library gradle


    compile 'com.google.android.gms:play-services-location:12.0.1'
    compile 'com.google.android.gms:play-services-gcm:12.0.1'

    // Google Ads
    compile 'com.google.android.gms:play-services-ads:12.0.1'
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion "28.0.0"
            } else if (requested.group == "com.google.android.gms") {
                details.useVersion '12.0.1'
            }
        }
    }
}

Then

  1. Clean Project
  2. Rebuild project
  3. Sync project with Gradle file

This is just a temprory fix.

yasanglass commented 6 years ago

after these changes:

capture

capture2

capture3

currently i cant build any of my apps because of these errors. the important problem on them is that they are still linked to your OneSignal so the users get your ads which makes them uninstall and leave 1 star reviews.

sadiqrazasyed commented 6 years ago

Download and import this test release on AS 3.0.1 - Google Drive.

Changes -

Bugs in this version - "toolbarIcon" color is now only black and not changeable until Google updates their support library or we find a workaround.

I'm trying my best to overcome these errors and make this library compatible with latest Gradle-Tools and AS but don't email and bug me, instead, be patient or try solving errors yourself and contribute. Thank you.

yasanglass commented 6 years ago

I tried to fix it for like a week and then realized i have to contact you here. i dont want to annoy you and i know everyone has a life and stuff. i also didn't email.

If there wont be notification ads on my app ill wait for a full fix instead of these temp fixes because the current versions of my app are probably more stable. i mean its not really urgent for me but if there will be notification ads i have to update my app before i lose all my users.

sadiqrazasyed commented 6 years ago

Don't worry, I didn't specifically mean that to you, instead gave a heads up to everyone in general. And regarding notifications, I've generated another test key so you shouldn't have problems there either.

Cheers.

yasanglass commented 6 years ago

Thats great. although users of my paid ad-free app cant use the app with ad-block lol! but well no one should use adblock anyways!

Hopefully this will be fixed soon so i can update the apps. Good luck! I wish i had more knowledge about these stuff so i could help.

Amitind commented 6 years ago

Anyone else if want to tryout these changes https://github.com/sadiqrazasyed/wallpaperboard-enhanced/issues/12#issuecomment-429574312 in there current app without extra effort try this plugin to easily make changes to current project

Installation: Open: File > Settings > Plugins Click on the button “Browse repositories”, find the “Compare Directories” plugin in the available plugins list, right click on it and choose install.

image

Source: https://stackoverflow.com/questions/31172396/i-want-to-compare-two-projects-in-android-studio