마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

프로젝트를 합쳤는데 R 과 관련된건지 에러가 발생합니다.

0 추천

안드로이드 스튜디오에서 카메라 제어 되는 어플 소스를 받아서

기존에 다른 소스와 합치려고 하는데

1. JNI 이용한 받은 소스

2. 개발한 소스

 

처음에는 1 소스들을 -> 2에 복사해서 해보려 했으나,

so 파일만 있는 c 원본파일은 없는 프로젝트여서인지

JNI 관련되어보이는 함수들이 제대로 실행이 되지 않았습니다.

 

06-14 13:22:21.698 30189-30189/kr.co.o_______.___mobile______sys E/AndroidRuntime: FATAL EXCEPTION: main
           Process: kr.co.o_______.___mobile______sys, PID: 30189
           java.lang.UnsatisfiedLinkError: Couldn't load HCCore from loader dalvik.system.PathClassLoader[dexPath=/data/app/kr.co.o_______.___mobile______sys-14.apk,libraryPath=/data/app-lib/kr.co.o_______.___mobile______sys-14]: findLibrary returned null
   at java.lang.Runtime.loadLibrary(Runtime.java:358)
   at java.lang.System.loadLibrary(System.java:526)
   at com.h______.netsdk.HCNetSDK.<init>(HCNetSDK.java:37)
   at com.h______.netsdk.HCNetSDK.getInstance(HCNetSDK.java:24)
   at kr.co.o_______.___mobile______sys.DemoActivity.initeSdk(DemoActivity.java:106)
   at kr.co.o_______.___mobile______sys.DemoActivity.onCreate(DemoActivity.java:42)
      (중략)
   at dalvik.system.NativeStart.main(Native Method)

 

JNI설정이나 gradle 등을 수정하다 잘 되지 않아

 

반대로 2-> 1 로

해보려했습니다만

소스구조가 기존은 루트아래에 app 폴더가 있고 그아래에 폴더들이 있다고 보면

받은 소스는 루트아래에 바로 폴더들이 있는 모양새입니다.

 

레이아웃이 있어보이는 폴더에 xml을 복사해넣고

소스폴더에 소스들을 붙여넣었는데

 

복사해 넣은 소스들이 전부 R이 적색이고

 

Information:Gradle tasks [clean, :generateDebugSources, :generateDebugAndroidTestSources, :mockableAndroidJar, :prepareDebugUnitTestDependencies]
D:\AndroidStudioProjects\SimpleDemo\build\intermediates\res\merged\debug\values-ldltr-v21\values-ldltr-v21.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
D:\AndroidStudioProjects\SimpleDemo\build\intermediates\res\merged\debug\values-v21\values-v21.xml
Error:(17) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
Error:(19) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'.
Error:(25) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'.
Error:(32) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'.
Error:(216) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
Error:(218) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
Error:(176) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
Error:(189) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.EditText'.
Error:(10) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:(264) Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification'.
Error:(276) Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.Material.Notification.Title'.
Error:(7) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:(8) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Error:(9) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:(11) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:(12) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:(13) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:(14) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
Error:(15) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
Error:(16) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'.
Error:(20) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:(22) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:(24) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'.
Error:(26) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
Error:(27) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'.
Error:(29) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'.
 

(중략)

D:\AndroidStudioProjects\SimpleDemo\build\intermediates\res\merged\debug\values-v25\values-v25.xml
Error:(5) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.NoActionBar'.
Error:(7) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.NoActionBar'.
Error:(5) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.NoActionBar'.
Error:(7) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.NoActionBar'.
Error:Execution failed for task ':processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Information:BUILD FAILED
Information:Total time: 12.53 secs
Information:225 errors
Information:0 warnings
Information:See complete output in console

 

이런 에러가 뜨면서

ldltr-v21\values-ldltr-v21.xml 파일이 열리고

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="Base.Widget.AppCompat.Spinner.Underlined" parent="android:Widget.Material.Spinner.Underlined"/>
</resources>

 

이상태인데, 테마나 스타일이 파일을 찾을수 없다는거 같은데..

어느부분을 찾아서 수정해야하는건지 알수 있을까요?

달빛별빛 (490 포인트) 님이 2017년 6월 14일 질문

2개의 답변

0 추천
 
채택된 답변
https://stackoverflow.com/questions/31931024/no-resource-found-errors-when-building-app

위 링크에서 내용이 비슷하여 확인중

https://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro

링크를 확인해보니

컴파일SDK과 타켓SDK가 차이가 나서 문제가 발생한거 같아

동일하게 맞춰주니 R에 관련해서 문제되는 부분은 해결되었습니다.
달빛별빛 (490 포인트) 님이 2017년 6월 14일 답변
0 추천
저 같은 경우 메니페스트에 잘못된 부분을 수정 하였을 때 에러가 없어지더라구요
하라르르 (310 포인트) 님이 2017년 6월 14일 답변
역시 메니페스트가 섞이면서 오류가 난걸까요..
JNI를 다시 봐서 so파일만 있는 소스를 합치는게 난건지
메니페스트를 수정하면 될건지 .. 어렵네요 ㅜㅜ
...