유니티에 카카오톡 링크를 구현하기위해 안드로이드로 플러그인을 만드려고합니다.
기본적으로 유니티와 안드로이드 사이에 상호 통신하는 플러그인을 만든후 카카오톡 링크를 붙였는데
에러만 나오네요 ㅠㅠ
에러내용은
//--------------------------------------------------------------------------------------
E/Unity: AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/kakao/message/template/LinkObject;
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/kakao/message/template/LinkObject;
Caused by: java.lang.ClassNotFoundException: Didn’t find class “com.kakao.network.callback.ResponseCallback” on path: DexPathList[[zip file “/data/app/com.jpsoft.englishrun-2/base.apk”],nativeLibraryDirectories=[/data/app/com.jpsoft.englishrun-2/lib/arm, /data/app/com.jpsoft.englishrun-2/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
//--------------------------------------------------------------------------------------
이렇게 나오고 있고
build.gradle(project)
//--------------------------------------------------------------------------------------
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
subprojects{
repositories{
google()
jcenter()
mavenCentral()
maven { url ‘http://devrepo.kakao.com:8088/nexus/content/groups/public/’ }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
//--------------------------------------------------------------------------------------
build.gradle(Module)
//--------------------------------------------------------------------------------------
apply plugin: ‘com.android.library’
android {
compileSdkVersion 27
defaultConfig {
//applicationId “com.jpsoft.kakaoplugin”
minSdkVersion 15
targetSdkVersion 27
//versionCode 1
//versionName “1.0”
testInstrumentationRunner “android.support.test.runner.AndroidJUnitRunner”
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile(‘proguard-android-optimize.txt’), ‘proguard-rules.pro’
}
}
}
dependencies {
compileOnly fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
compileOnly files('libs/classes.jar')
compileOnly group: 'com.kakao.sdk', name: 'kakaolink', version: project.KAKAO_SDK_VERSION
}
//--------------------------------------------------------------------------------------
gradle.properties
//--------------------------------------------------------------------------------------
org.gradle.jvmargs=-Xmx1536m
KAKAO_SDK_VERSION = 1.16.0
//--------------------------------------------------------------------------------------
샘플로 구현중이 구현부 코드는
//--------------------------------------------------------------------------------------
public void ShareKakao()
{
Log.w(TAG, “ShareKakao start”);
FeedTemplate params = FeedTemplate
.newBuilder(ContentObject.newBuilder("딸기 치즈 케익",
"http://mud-kage.kakao.co.kr/dn/Q2iNx/btqgeRgV54P/VLdBs9cvyn8BJXB3o7N8UK/kakaolink40_original.png",
LinkObject.newBuilder().setWebUrl("https://developers.kakao.com")
.setMobileWebUrl("https://developers.kakao.com").build())
.setDescrption("#케익 #딸기 #삼평동 #카페 #분위기 #소개팅")
.build())
.setSocial(SocialObject.newBuilder().setLikeCount(286).setCommentCount(45)
.setSharedCount(845).build())
.addButton(new ButtonObject("웹으로 보기", LinkObject.newBuilder().setWebUrl("https://developers.kakao.com").setMobileWebUrl("https://developers.kakao.com").build()))
.addButton(new ButtonObject("앱으로 보기", LinkObject.newBuilder()
.setWebUrl("https://developers.kakao.com")
.setMobileWebUrl("https://developers.kakao.com")
.setAndroidExecutionParams("key1=value1")
.setIosExecutionParams("key1=value1")
.build()))
.build();
Log.w(TAG, "make complete FeedTemplate");
KakaoLinkService.getInstance().sendDefault(this, params, serverCallbackArgs, callback );
Log.w(TAG, "ShareKakao finish");
}
//--------------------------------------------------------------------------------------
대략 이렇습니다.
안드로이드쪽은 익숙하지 않아서 어떤부분이 문제인지 잘 모르겠네요.
원인을 아시는분 도와주세요~
kakaoplugin.zip (1.7 MB)