PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Add custom style to Android project
Add custom style to Android project
Débuté par Antonino Neri, 25 jan. 2017 14:58 - 3 réponses
Posté le 25 janvier 2017 - 14:58
Hi Gents,

I would like to add a custom style to my Android project. In order to do so I am trying this:





(I've also tried to check the "write" option with the same result)
The error that I receive is the following one:


Failure creating the Android application named <D:\Documents\My Mobile Projects\EXPRESS_WM21_TEST\Exe\WM21_Test.apk>.

Command Line: "C:\Program Files\Java\jdk1.8.0_121\bin\java.exe" "-Dorg.gradle.appname=D:\Documents\My Mobile Projects\EXPRESS_WM21_TEST\Android\Generation" -classpath "D:\Documents\Android\gradle-2.9\lib\gradle-launcher-2.9.jar" org.gradle.launcher.GradleMain assembleDebug -b build.gradle

Error returned:
D:\Documents\My Mobile Projects\EXPRESS_WM21_TEST\Android\Generation\src\com\optimus\prime\wm21_test\wdgen\GWDPEXPRESS_WM21_Test.java:132: error: cannot find symbol
super.ajouterFichierAssocie("CustomStyle.xml",com.optimus.prime.wm21_test.R.values.customstyle_1+23, "");
^
symbol: variable values
location: class R
1 error
FAILED


What am I doing wrong?


Cheers,
Antonino
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 25 janvier 2017 - 17:06
Hi,

View link

http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/254-android-sdk-homologado/read.awp

http://forum.pcsoft.fr/fr-FR/pcsoft.br.windev/254-android-sdk-homologado/read.awp


ok

--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/
Posté le 26 janvier 2017 - 10:17
Hi Mr. Boller,

thanks a lot for this thread that is very useful but I can see a specific fix for this specific error.
The xml file I want to add contains a custom style for my project. If in the "APK Destination" column I select "Automatic" the project is compiled with no error but I can't call my style using this syntax R.style.MY_STYLE_NAME. The same syntax works fine in Android Studio.

Any suggestions???

Thanks for your time and care.


Kindest Regards,
Antonino
Posté le 26 janvier 2017 - 14:06
Hi. You can't use a Android Studio style in WM. You must define the styles and resources to use in the Windows Designer. WM generate all the code and resource files for you.

You are adding the XML file like an asset resource or additional file, but you can't use the XML in this form to reference it from R.java.

Rubén