Android Studio Mini-tutorial

Discussion in 'Technical Discussion' started by Andy, Dec 12, 2017.

  1. Bilz636

    Bilz636 Avid Boxer

    Joined:
    Oct 5, 2015
    Messages:
    296
    Likes Received:
    166
    i am these errors in android studio. Anyone can help me out? Also admob ads are not showing. i checked everything from ad unit to Buildbox setting (also no extra spaces). I also tried Testing Ads unit by google but i am still not getting any single ad.

    ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.

    WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
    It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
    Affected Modules:
     
  2. Josh (Nology Games)

    Josh (Nology Games) Head Moderator Staff Member

    Joined:
    Nov 27, 2017
    Messages:
    456
    Likes Received:
    141
  3. APP-STOLZ

    APP-STOLZ Boxer

    Joined:
    May 9, 2019
    Messages:
    8
    Likes Received:
    2
    Hello friend Please edit the following file in Android Studio: Build.Gradle (MODULE: APP)
    Replace all * COMPILE * In * implementation *
    If you see * TestCompile * Replace it with * TestImplementation * Pay attention to the fact that i am written in bulk, with others * compile * Is it important that you * implementation * i write small, i hope you can understand it and it works for you

    Example:
    "NOT CORRECT"
    dependencies {
    compile 'com.google.android.gms: play-services: +'
    compile 'com.android.support:multidex:1.0.3'
    compile fileTree (dir: 'libs', include: ['* .jar'])
    // More deps here //
    }

    "RIGHT"

    dependencies {
    implementation 'com.google.android.gms: play-services: +'
    implementation 'com.android.support:multidex:1.0.3'
    implementation fileTree (dir: 'libs', include: ['* .jar'])
    }
     
    Bilz636 likes this.
  4. Akhele

    Akhele Boxer

    Joined:
    Dec 9, 2017
    Messages:
    11
    Likes Received:
    2
    6) OPEN a new project (do not IMPORT). Select the android directory inside the export. Wait a minute or two for the project to sync. If you get any errors click on the link to install additional packages. I was prompted to install “Build Tools 26.0.2” as an example.


    can you please explain what should I do next after creating a new project in android studio to use the one that I've exported from Buildbox 2 )

    I've tried to import the project but it doesn't work ( so many errors)
    is there any video or tutorial that explains how can use my game in my phone using android studio
     
  5. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    Does anyone know if there's an up to date tutorial that shows how to create a working APK using Android Studio from a BuildBox export? I've spent hours upon hours installing and uninstalling different versions of Android Studio and tweaking bits of code but am yet to create a working APK and it's very frustrating. The tutorials I've seen all seem to be obsolete.

    I use BuildBox because it's advertised as a non-coding solution to game making - I didn't expect to have to amend code and debug outside of BuildBox.
     
  6. Maylock

    Maylock Boxer

    Joined:
    Jan 11, 2018
    Messages:
    5
    Likes Received:
    5
    Are you trying to export from Buildbox 2 or Buildbox 3? The process for BB2 is rather straightforward, with almost no code changes required. I can help you with that. Not sure about BB3, I haven't tried exporting from that yet.

    I agree, the documentation for exporting, monetization, etc. is a huge mess.
     
    phuceh likes this.
  7. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @Maylock thanks for taking the time to respond. I am trying to export from BuildBox 2 (2.3.8) and have used different versions of Android Studio (currently I have 3.5 installed).

    Any help you could provide would be greatly appreciated.
     
  8. Maylock

    Maylock Boxer

    Joined:
    Jan 11, 2018
    Messages:
    5
    Likes Received:
    5
    So this is the process I follow using BB 2.3.8 and AS 3.4 (I guess it will work for AS 3.5 too):
    1. In BB, go to File -> Export -> Android. Enter the name and location for your project. BB will create a folder with that name and location.
    2. Open AS. Go to Import Project (gradle, eclipse ADT, etc.)
    3. In the box that opens, find the folder which BB created in step 1. Expand the folder, and inside there will be a file called 'android'. Click once on that, and click on 'OK'. AS will import your project, which could take a few minutes.
    4. In the project directory in AS, expand 'Gradle Scripts'. Open 'build.gradle (Module: app)' by double-clicking on it. It will open in the code editor.
    5. Make sure these are the values in your file:
    • compileSdkVersion 28
    • buildToolsVersion "28.0.3"
    • minSdkVersion 16
    • targetSdkVersion 28
    If any of these numbers are different, change them to these numbers.​
    6. In the project directory, expand 'app', then 'manifests'. Open 'AndroidManifest.xml' by double-clicking on it. It will open in the code editor.
    7. Go all the way to the bottom, there should be a line like this: "
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    8. Delete this line
    9. Go to File -> Sync Project with Gradle Files. Wait for it to sync.
    10. Go to Build -> Generate signed bundle / APK
    11. For APK: select APK -> enter your keystore, password, etc. -> select 'release' and select both 'V1' and 'V2' -> Finish
    12. For bundle: select bundle -> enter your keystore, password, etc. -> unselect "Export encrypted key..." -> select 'release' -> Finish

    I regularly export APKs and bundles using this process, and publish them on the Play Store without any problems so far. Takes less than 10 minutes. Let me know if you have any issues or errors.
     
    phuceh and Jaro like this.
  9. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @Maylock thank you so much for this - I will give it a go. I really appreciate the detail here.
     
  10. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @Maylock I followed your instructions to the letter (I even downloaded Android Studio 3.4) but I'm getting a lot of errors when generating the APK -

    Code:
    org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures.
        at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:386)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:247)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:159)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:134)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:58)
        at org.gradle.internal.invocation.GradleBuildController$1.execute(GradleBuildController.java:55)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:82)
        at org.gradle.internal.invocation.GradleBuildController$3.create(GradleBuildController.java:75)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:183)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:75)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:55)
        at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:58)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:49)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:44)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:49)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:78)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:78)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:52)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
        at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:55)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:41)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
        at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:81)
        at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
        at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
        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.tasks.TaskExecutionException: Execution failed for task ':app:compileReleaseJavaWithJavac'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119)
        at org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93)
        at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49)
        at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129)
        ... 6 more
    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:36)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.delegateAndHandleErrors(NormalizingJavaCompiler.java:100)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:52)
        at org.gradle.api.internal.tasks.compile.NormalizingJavaCompiler.execute(NormalizingJavaCompiler.java:38)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:51)
        at org.gradle.api.internal.tasks.compile.AnnotationProcessorDiscoveringCompiler.execute(AnnotationProcessorDiscoveringCompiler.java:37)
        at org.gradle.api.internal.tasks.compile.CleaningJavaCompilerSupport.execute(CleaningJavaCompilerSupport.java:39)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:110)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory$2.execute(IncrementalCompilerFactory.java:106)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:59)
        at org.gradle.api.internal.tasks.compile.incremental.IncrementalResultStoringCompiler.execute(IncrementalResultStoringCompiler.java:43)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:59)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler$2.call(CompileJavaBuildOperationReportingCompiler.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
        at org.gradle.api.internal.tasks.compile.CompileJavaBuildOperationReportingCompiler.execute(CompileJavaBuildOperationReportingCompiler.java:51)
        at org.gradle.api.tasks.compile.JavaCompile.performCompilation(JavaCompile.java:154)
        at org.gradle.api.tasks.compile.JavaCompile.compile(JavaCompile.java:122)
        at com.android.build.gradle.tasks.AndroidJavaCompile.compile(AndroidJavaCompile.kt:214)
        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:47)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:284)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:67)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)
        at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)
        at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
        at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
        at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
        at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)
        at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
        at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)
        at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)
        at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)
        at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$3(CacheStep.java:83)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
        at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)
        at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
        at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
        at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$1(SkipUpToDateStep.java:91)
        at java.util.Optional.orElseGet(Optional.java:267)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:91)
        at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
        at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)
        ... 35 more
    
    I've no idea how to resolve these.
     
  11. Maylock

    Maylock Boxer

    Joined:
    Jan 11, 2018
    Messages:
    5
    Likes Received:
    5
    @phuceh That's strange, since we're using the same programs. See if any of these fixes work for you:
    • File -> Settings -> Build, execution, etc. -> instant run -> unselect 'enable instant run...'
    • In 'build.gradle (Module: app)', if you see the word "compile" anywhere (other than compileSdkVersion), change it to "implementation"
    • 1. Build -> Clean project 2. Build -> Rebuild project 3. File -> Sync project with gradle file
    If none of these help, generate apk again and this time in the Build tool at the bottom, click on the 'Toggle view' button (the one with 2 overlapping squares). That could help pinpoint exactly where the errors are happening.
     

    Attached Files:

  12. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8
    @Maylock thanks again for this. I've tried them all - the project syncs okay but I get the same error when trying to generate the SDK.

    When I click the 'Toggle view' button (the one with the two overlapping squares) I get the following

    Code:
    Executing tasks: [:app:assembleRelease]
    
    > Task :app:preBuild UP-TO-DATE
    > Task :app:preReleaseBuild
    > Task :app:compileReleaseAidl
    > Task :app:compileReleaseRenderscript NO-SOURCE
    > Task :app:checkReleaseManifest
    > Task :app:generateReleaseBuildConfig
    > Task :app:prepareLintJar UP-TO-DATE
    > Task :app:generateReleaseSources
    > Task :app:javaPreCompileRelease
    > Task :app:mainApkListPersistenceRelease
    > Task :app:generateReleaseResValues
    > Task :app:generateReleaseResources
    > Task :app:mergeReleaseResources
    > Task :app:createReleaseCompatibleScreenManifests
    > Task :app:processReleaseManifest
    > Task :app:processReleaseResources
    
    > Task :app:compileReleaseJavaWithJavac FAILED
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:14: error: cannot find symbol
    import com.google.android.gms.R;
                                 ^
      symbol:   class R
      location: package com.google.android.gms
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:19: error: package com.google.android.gms.games does not exist
    import com.google.android.gms.games.Games;
                                       ^
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:20: error: package com.google.android.gms.games does not exist
    import com.google.android.gms.games.Player;
                                       ^
    C:\test\android\app\src\main\java\com\threeinfinity\namethat90sfootballplayer\PTPlayer.java:17: error: package com.google.android.gms.games does not exist
    import com.google.android.gms.games.GamesActivityResultCodes;
                                       ^
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:90: error: cannot find symbol
                    .addApi(Games.API).addScope(Games.SCOPE_GAMES)
                                                ^
      symbol:   variable Games
      location: class PTServicesBridge
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:90: error: cannot find symbol
                    .addApi(Games.API).addScope(Games.SCOPE_GAMES)
                            ^
      symbol:   variable Games
      location: class PTServicesBridge
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:263: error: package Games does not exist
                    PTServicesBridge.activity.startActivityForResult(Games.Leaderboards.getLeaderboardIntent(PTServicesBridge.mGoogleApiClient,
                                                                          ^
    C:\test\android\app\src\main\java\com\secrethq\utils\PTServicesBridge.java:300: error: package Games does not exist
                Games.Leaderboards.submitScore(PTServicesBridge.mGoogleApiClient, leaderboardId, PTServicesBridge.scoreValue);
                     ^
    C:\test\android\app\src\main\java\com\threeinfinity\namethat90sfootballplayer\PTPlayer.java:44: error: cannot find symbol
                    else if(resultCode == GamesActivityResultCodes.RESULT_SIGN_IN_FAILED){
                                          ^
      symbol:   variable GamesActivityResultCodes
      location: class PTPlayer
    C:\test\android\app\src\main\java\com\threeinfinity\namethat90sfootballplayer\PTPlayer.java:51: error: cannot find symbol
                    else if(resultCode == GamesActivityResultCodes.RESULT_APP_MISCONFIGURED){
                                          ^
      symbol:   variable GamesActivityResultCodes
      location: class PTPlayer
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    Note: C:\test\android\app\src\main\java\org\cocos2dx\lib\Cocos2dxReflectionHelper.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    10 errors
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:compileReleaseJavaWithJavac'.
    > Compilation failed; see the compiler error output for details.
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
    Use '--warning-mode all' to show the individual deprecation warnings.
    See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
    
    BUILD FAILED in 5s
    13 actionable tasks: 12 executed, 1 up-to-date
    You've already been helpful, I don't expect you to know what to do here so no worries. It just gets increasingly frustrating and there doesn't seem to be much official help on what to do here.
     
    Last edited: Oct 3, 2019
  13. Sean Buildbox

    Sean Buildbox Administrator Staff Member

    Joined:
    Sep 24, 2015
    Messages:
    319
    Likes Received:
    401
    Hey bud, will shoot you a DM. I'm sure we can figure out what the issue is
     
  14. phuceh

    phuceh Boxer

    Joined:
    Nov 20, 2018
    Messages:
    63
    Likes Received:
    8

Share This Page