AAkira / Napier

Logging library for Kotlin Multiplatform
Apache License 2.0
820 stars 36 forks source link

Failed to build with real iOS device #15

Closed yshrsmz closed 5 years ago

yshrsmz commented 5 years ago

I got following error while building iOS app for real device.

w: skipping /Users/user/.gradle/caches/modules-2/files-2.1/com.github.aakira/napier-ios/0.0.4/aa6805b163ff862b63e862f4e63fa7852ca4d751/napier-ios-0.0.4.klib. The target doesn't match. Expected 'ios_arm64', found [ios_x64]

It looks like napier-ios artifact is for iOS simulator.

Please consider either of these;

https://repo.maven.apache.org/maven2/com/squareup/sqldelight/ios-driver/1.1.3/ this link is the example of iOS common artifact. As you can see, common module should include *.module file to choose appropriate artifact for different variants.

AAkira commented 5 years ago

Thank you for reporting!

I will try to make the ios common module on the next version. Please specify the napier-iosArm64 or napier-iosArm32 in your gradle till then.


For other peoples

This is the artifacts list. https://bintray.com/beta/#/aakira/maven/napier?tab=files

You should specify the napier-iosArm64 or napier-iosArm32 in your gradle if you want to use real iOS device.

iOSMain {
    dependencies {
        implementation 'com.github.aakira:napier-iosArm64:0.0.5'
    }
}
JanStoltman commented 5 years ago

@AAkira Is there any progress on this?

yshrsmz commented 5 years ago

My current workaround is something like this.

def napier = [
  common  : "com.github.aakira:napier:${versions.napier}",
  android : "com.github.aakira:napier-android:${versions.napier}",
  iosX64  : "com.github.aakira:napier-ios:${versions.napier}",
  iosArm64: "com.github.aakira:napier-iosArm64:${versions.napier}",
]

kotlin {
  def iosTargetName = project.findProperty("kotlin.target") ?: "iosX64"
  def iosTarget = presets.getByName(iosTargetName)

  targetFromPreset(iosTarget) {
    binaries {
      framework()
    }
  }

  sourceSets {
    iosMain {
      dependencies {
        implementation napier[iosTargetName]
      }
    }
  }
}
JanStoltman commented 5 years ago

@yshrsmz Oh, that's clever 👍

AAkira commented 5 years ago

@yshrsmz @JanStoltman @wuseal

Hi guys! I have good news. I just published Napier 1.0.0. It has the napier-ios artifact which includes Arm64, Arm32, and X64. Please check it.

yshrsmz commented 5 years ago

That's great! Thanks a lot 👍

wuseal commented 5 years ago

Great! Really Good News

JanStoltman commented 5 years ago

Nice, thanks!

horita-yuya commented 5 years ago

Amazing, thanks!!!!