segunda-feira, 6 de março de 2017

Ionic Android - AAPT: No resource found that matches the given name (at 'icon' with value '@drawable/icon')

E aí meu brother que está lendo esse artigo, tudo bom? :)

Rodei o comando "ionic build android" e tive o seguinte erro:

cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-ldpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-mdpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-hdpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-xhdpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-xxhdpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\icon\drawable-xxxhdpi-icon.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-ldpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-mdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-hdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-xhdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-xxhdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-land-xxxhdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-ldpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-mdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-hdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-xhdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-xxhdpi-screen.png
cp: no such file or directory: C:\work\Dropbox\workspaces\ws-ionic\my-app\resources\android\splash\drawable-port-xxxhdpi-screen.png

[...]
:CordovaLib:compileDebugJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

[...]
:CordovaLib:compileReleaseJavaWithJavacNote: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease
:CordovaLib:mergeReleaseJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease
:CordovaLib:bundleRelease
:prepareComAndroidSupportSupportV42411Library
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResourcesC:\work\Dropbox\workspaces\ws-ionic\my-app\platforms\android\build\intermediates\manifests\full\debug\AndroidManifest.xml:25:23-37 : AAPT: No resource found that matches the given name (at 'icon' with value '@drawable/icon').
 FAILED


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\work\Dropbox\android\sdk\build-tools\23.0.1\aapt.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace
 option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED

Total time: 40.179 secs
ERROR building one of the platforms: Error code 1 for command: cmd with args: /s,/c,"C:\work\Dropbox\workspaces\ws-ionic\my-app\platforms\android\gradlew cdvBuildDebug -b C:\work\Dropbox\workspaces\ws-ionic\my-app\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
You may not have the required environment or OS to build this project
Error: Error code 1 for command: cmd with args: /s,/c,"C:\work\Dropbox\workspaces\ws-ionic\my-app\platforms\android\gradlew cdvBuildDebug -b C:\work\Dropbox\workspaces\ws-ionic\my-app\platforms\android\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

Para resolver fiz o seguinte:
- Fui na pasta /platforms/android/res
- Criei uma pasta chamada "drawable"
- Coloquei um arquivo png qualquer chamado icon.png

Pronto, resolveu :)

Não sei se é a melhor solução, provavelmente não hahah Talvez seja algum conflito de versão ou versão desatualizada de algo (do sdk talvez)...
Como não sou eu que vou gerar o aplicativo para a play store, estou só resolvendo uns bugs aqui, então pra mim, essa solução foi suficiente... Talvez pra vc não tenha sido, mas acredito que posso ter te ajudado a pelo menos entender melhor o problema.

Fonte: http://stackoverflow.com/questions/4736523/no-resource-found-that-matches-the-given-name

Abraço!
Adriano Schmidt

Nenhum comentário:

Postar um comentário