question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Help, please. I got errors building my project for Android platform.

See original GitHub issue

It failed to compile.

I have:

  • Windows 10 x64
  • JDK 1.8.0_201 x64

I got this log of errors. Is ‘final’ keyword even required to build a project? Can anyone help me?

:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug
:app:processDebugResources
:app:generateDebugSources
:app:javaPreCompileDebug
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:35: error: local variable action is accessed from within inner class; needs to be declared final
                BannerAd bannerAd = (BannerAd) action.getAd();
                                               ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:38: error: local variable action is accessed from within inner class; needs to be declared final
                        action.optId(),
                        ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:39: error: local variable action is accessed from within inner class; needs to be declared final
                        action.getAdUnitID(),
                        ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:40: error: local variable action is accessed from within inner class; needs to be declared final
                        action.getAdSize(),
                        ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:41: error: local variable action is accessed from within inner class; needs to be declared final
                        "top".equals(action.optPosition()) ? Gravity.TOP : Gravity.BOTTOM
                                     ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:44: error: local variable action is accessed from within inner class; needs to be declared final
                bannerAd.show(action.buildAdRequest());
                              ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:47: error: local variable callbackContext is accessed from within inner class; needs to be declared final
                callbackContext.sendPluginResult(result);
                ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:58: error: local variable action is accessed from within inner class; needs to be declared final
                BannerAd bannerAd = (BannerAd) action.getAd();
                                               ^
C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:64: error: local variable callbackContext is accessed from within inner class; needs to be declared final
                callbackContext.sendPluginResult(result);
                ^
:app:compileDebugJavaWithJavac FAILED
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
9 errors

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
XxFRADxXcommented, Jun 4, 2019

Any progress? We need help hurry! Thanks

C:\project\src\ionic\platforms\android\app\src\main\java\admob\plugin\ads\BannerAd.java:35: error: local variable action is accessed from within inner class; needs to be declared final
                BannerAd bannerAd = (BannerAd) action.getAd();

action is a function param, not a local variable, is it a bug?

1reaction
devgenicommented, Feb 22, 2019

Hey @andrey3diq

Thank you for the answer! But unfortunately I have exactly that 7.1.4 version of android platform.

cordova platform
Installed platforms:
  android 7.1.4
Available platforms:
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  windows ~6.0.0

Some more environment info

AdMob Plus Environment Info:
    System:
      OS: Windows 10
      CPU: (4) x64 Intel(R) Core(TM) i3-5005U CPU @ 2.00GHz
      Memory: 1.82 GB / 5.92 GB
    Binaries:
      Node: 8.9.1 - C:\node64\node.EXE
      Yarn: 1.12.3 - C:\node64\yarn.CMD
      npm: 6.1.0 - C:\node64\npm.CMD
    IDEs:
      Android Studio: Version  3.3.0.0 AI-182.5107.16.33.5264788

cordova: 8.1.2 (cordova-lib@8.1.1)
ionic: 4.10.3
cordova plugins: {
  "cordova-plugin-whitelist": "^1.3.3",
  "cordova-plugin-statusbar": "^2.4.2",
  "cordova-plugin-device": "^2.0.2",
  "cordova-plugin-splashscreen": "^5.0.2",
  "cordova-plugin-ionic-webview": "^3.1.2",
  "cordova-plugin-ionic-keyboard": "^2.1.3",
  "cordova-plugin-apprate": "1.4.0",
  "cordova-plugin-flurryanalytics": "1.4.6",
  "cordova-plugin-facebook4": "4.2.1",
  "cordova-plugin-local-notification": "0.9.0-beta.2",
  "cordova-admob-plus": "^0.24.1"
}

AndroidManifest.xml: using test APPLICATION_ID
Read more comments on GitHub >

github_iconTop Results From Across the Web

Known issues with Android Studio and Android Gradle Plugin
Compilation issue in Kotlin multiplatform projects. Compilation errors may arise in Kotlin MPP code due to missing symbols. Upgrading your Kotlin plugin to ......
Read more >
Showing error when create a new Project in Android Studio
1 Answer 1 ... You are using the support libraries v23,you have to compile your project with API23. In your build.gradle change the...
Read more >
Android Studio:How to find errors in code after compile
If not, please redirect me to the right place.I have just started trying... ... When I compile my project, I get the output:...
Read more >
Troubleshooting Android Issues | Capacitor Documentation
If you have installed a new Plugin from npm and are unable to use or see the plugins in your Android build, try...
Read more >
There are a lot of unwanted messy appcompat_v7_* project ...
so please help me. i removed the appcompat_7 project from my project ... PS, root cause of the later issue is android 5.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found