adsense728x90


couchbase lite android intellij android studio 귀찮네 META-INF/ASL gradle error Android


한 번에 제대로 되는 게 없고만.
최신 버전을 쓸 땐, gradle이 잘 작동을 안한다.

Error:Execution failed for task ':maskers:packageDebug'.
> Duplicate files copied in APK META-INF/ASL2.0
  File 1: ~/.gradle/caches/modules-2/files-2.1/org.codehaus.jackson/jackson-mapper-asl/1.9.2/95400a7922ce75383866eb72f6ef4a7897923945/jackson-mapper-asl-1.9.2.jar
  File 2: ~/.gradle/caches/modules-2/files-2.1/org.codehaus.jackson/jackson-mapper-asl/1.9.2/95400a7922ce75383866eb72f6ef4a7897923945/jackson-mapper-asl-1.9.2.jar


에서 해결책을 찾았다.


  • If you are using the stable branch of GrocerySync, use the latest version of Android Studio from the stable channel (currently Android Studio 0.3.X)

  • If you are using the master branch of GrocerySync, use the latest version of Android Studio from the canary channel (currently Android Studio 0.4.X)


exclude 'META-INF/... 를 넣어주기.

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 19
    }

    // workaround for "duplicate files during packaging of APK" issue
    // see https://groups.google.com/d/msg/adt-dev/bl5Rc4Szpzg/wC8cylTWuIEJ
    packagingOptions {
        exclude 'META-INF/ASL2.0'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}

21:28:12 Failed to refresh Gradle project 'GrocerySync'
         The project is using an unsupported version of the Android Gradle plug-in (0.8.3).
         Version 0.9.0 introduced incompatible changes in the build language.
         Please read the migration guide to learn how to update your project.
         Open migration guide, fix plug-in version and re-import project
21:28:28 Quick Fix Failed
         Unable to find any references to the Android Gradle plug-in in build.gradle files.
         Please click the link to perform a textual search and then update the build files manually.

에러가 난다.
    dependencies {
        classpath 'com.android.tools.build:gradle:0.8.+'
    }
부분을 
        classpath 'com.android.tools.build:gradle:0.9.+'
로 고쳐주니까 graddle이 작동을 한다.

Android studio 0.5.3

실행이 된다~
앱 실행한 다음에 메뉴 > 설정 에서 sync url을 지정해 줄 수 있다.

emulator에서 실행하는 경우는 192로 시작하는 lan ip를 적어주면 되나보네.

sync_gateway에 log가 찍힌다.

21:41:39.915771 HTTP:  #001: POST /grocery-sync/_revs_diff
21:41:39.915856 HTTP: #001:     --> 404 no such database "grocery-sync"  (0.0 ms)

sync 얘기는 다음 post에 적어야지.

한편,

ios GrocerySync도 다른 문제가 있었다.
library 버전이 안 맞는지 최신 code의 couchbase api가 depredate된 것이 많아서 GrocerySync source code를 많이 고쳐줘야 했다.
sync url 넣는 것도 어떻게 하는지 모르겠다.

한편,

새로 프로젝트를 만들고, 홈페이지 샘플 코드를 써 보면,

build는 되는데, getDatabase를 못한다.

java.lang.RuntimeException: Failed to load storage.  Resource: services/com.couchbase.lite.storage.SQLiteStorageEngine classname:

E/AndroidRuntime( 2007): Caused by: java.lang.RuntimeException: Failed to load storage.  Resource: services/com.couchbase.lite.storage.SQLiteStorageEngine classname:
E/AndroidRuntime( 2007): at com.couchbase.lite.storage.SQLiteStorageEngineFactory.createStorageEngine(SQLiteStorageEngineFactory.java:45)
E/AndroidRuntime( 2007): at com.couchbase.lite.Database.open(Database.java:866)
E/AndroidRuntime( 2007): at com.couchbase.lite.Manager.getDatabase(Manager.java:207)
E/AndroidRuntime( 2007): at me.maskers.android.main.AppMain.onCreate(AppMain.java:34)
E/AndroidRuntime( 2007): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
E/AndroidRuntime( 2007): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4344)
E/AndroidRuntime( 2007): ... 10 more
E/AndroidRuntime( 2007): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 2007): at com.couchbase.lite.util.TextUtils.read(TextUtils.java:52)
E/AndroidRuntime( 2007): at com.couchbase.lite.storage.SQLiteStorageEngineFactory.createStorageEngine(SQLiteStorageEngineFactory.java:38)
E/AndroidRuntime( 2007): ... 15 more

최신 source code를 안쓰고, 1.0-beta2.jar 파일을 수동으로 추가했더니, getDatabase는 된다.

아우 sample source code도 잘 작동 안한다.

E/AndroidRuntime( 2049): Caused by: java.lang.IllegalArgumentException: Unknown pattern character 'T'
E/AndroidRuntime( 2049): at java.text.SimpleDateFormat.validatePatternCharacter(SimpleDateFormat.java:314)
E/AndroidRuntime( 2049): at java.text.SimpleDateFormat.validatePattern(SimpleDateFormat.java:272)

calendar code를 지웠더니 실행은 된다.
//        // get the current date and time
//        SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd’T'HH:mm:ss.SSS'Z'");
//        Calendar calendar = GregorianCalendar.getInstance();
//        String currentTimeString = dateFormatter.format(calendar.getTime());

제대로 되는 건가..




덧글

댓글 입력 영역