1

The problem is that since this morning (I believe, I have not worked yesterday) when I try to run my ionic 3 application on the device I get an AAPT error.

To recreate the problem I started from a scratch app.

I create a simple new ionic application:

ionic start gradleError tabs

Now if I try to run it on my device it works

Let's say I want to add this plugin using simply this two commands:

ionic cordova plugin add cordova-plugin-mauron85-background-geolocation
npm install --save @ionic-native/background-geolocation

Now when I try to run it on my device I get the following Errors:

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

Reading the error output is seems that the problem is this one:

fontVariationSettings not found.

ttcIndex not found.

First fix attempt was made by changing inside "platforms/android/project.properties" the line into:

cordova.system.library.2=com.android.support:support-v4:26+

After trying to run in on device I start to get a bunch of errors which looks like:

    /Users/zeno/Desktop/Bachelor/App/gradleError/test/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:563: error: cannot find symbol

    @TargetApi(Build.VERSION_CODES.KITKAT)
                                  ^
  symbol:   variable KITKAT
  location: class VERSION_CODES
/Users/zeno/Desktop/Bachelor/App/gradleError/test/platforms/android/app/src/main/java/org/apache/cordova/splashscreen/SplashScreen.java:297: error: cannot find symbol

                LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
                                                                                      ^
  symbol:   variable MATCH_PARENT

With ate the end:

    * What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.

Now following what has been said on the ionic forum I tried to run the following command:

cordova plugin add cordova-android-support-gradle-release --variable ANDROID_SUPPORT_VERSION=27.0.0 

with which I get the same errors as the change I made before.

I tried also to play with the system and the numbers, from 27 to 27.1 to 24 and so on, nothing changed.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Zeno Trevisan
  • 517
  • 1
  • 8
  • 23
  • Might be related to https://stackoverflow.com/q/49162538/5730444. Maybe try if adding a build-extras.gradle fixes this issue – Phonolog Mar 17 '18 at 17:40
  • Sorry for the very late reply. No I tried all the solutions in that post and nothing worked. I tracked down the problem beign https://ionicframework.com/docs/native/background-geolocation/ this plugin The problem now seems to be this: /Users/zeno/Desktop/Bachelor/Ionic/ticaccio/platforms/android/app/src/main/java/com/tenforwardconsulting/cordova/BackgroundGeolocationPlugin.java:563: error: cannot find symbol @TargetApi(Build.VERSION_CODES.KITKAT) – Zeno Trevisan Mar 21 '18 at 15:04

0 Answers0