can i use Unity IAP in kitkat?
hi
I want to do Unity iap on Android KitKat, but the machine I'm testing is Galaxy S3. But everything else is normal, but if I attach Unity IAP, the app crashes on my S3.
Looking at the logcat...
E/cutils ( 1960): Failed to mkdirat(/storage/extSdCard/Android): Read-only file system W/ContextImpl(19393): Failed to ensure directory: /storage/extSdCard/Android/data/xxx/cache W/Vold ( 1960): Returning OperationFailed - no handler for errno 30 I/SwappyCommon(19393): Swappy version 1.3 I/SwappyCommon(19393): SDK version = 19 E/SwappyCommon(19393): Error while getting method: getAppVsyncOffsetNanos E/Swappy (19393): SwappyCommon could not initialize correctly. E/Swappy (19393): Failed to initialize SwappyGL E/CRASH (19393): E/CRASH (19393): Version '2019.4.0f1 (0af376155913)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' E/CRASH (19393): Build fingerprint: 'samsung/c1skt/c1skt:4.4.4/KTU84P/E210SKSUKOL2:user/release-keys' E/CRASH (19393): Revision: '14' E/CRASH (19393): ABI: 'arm' E/CRASH (19393): Timestamp: 2020-06-19 19:36:51+0900 E/CRASH (19393): pid: 19393, tid: 19415, name: UnityMain >>> xxx <<< E/CRASH (19393): uid: 10226 E/CRASH (19393): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 E/CRASH (19393): Cause: null pointer dereference E/CRASH (19393): r0 00000000 r1 00000000 r2 00000000 r3 45a3e6c8 E/CRASH (19393): r4 695106c0 r5 00000000 r6 64494304 r7 1d20042e E/CRASH (19393): r8 647de904 r9 647df240 r10 647df66c r11 647df67c E/CRASH (19393): ip 00000003 sp 647de868 lr 63f66ce5 pc 63f66cec E/CRASH (19393): E/CRASH (19393): backtrace: E/CRASH (19393): #00 pc 00713cec /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #01 pc 00708de9 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #02 pc 0023eacb /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #03 pc 00253f6b /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #04 pc 0024891f /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #05 pc 00257479 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #06 pc 00249d3d /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #07 pc 0024a761 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #08 pc 002586b5 /data/app-lib/xxx/libunity.so (BuildId: 5a1907db1b2b879df33887a5f8bc93126c2f7027) E/CRASH (19393): #09 pc 0001ec0c /system/lib/libdvm.so (dvmPlatformInvoke+112) E/CRASH (19393): #10 pc 0004f1ab /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+398) E/CRASH (19393): #11 pc 00028020 /system/lib/libdvm.so E/CRASH (19393): #12 pc 0002f004 /system/lib/libdvm.so (dvmMterpStd(Thread*)+76) E/CRASH (19393): #13 pc 0002c69c /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184) E/CRASH (19393): #14 pc 00061611 /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+336) E/CRASH (19393): #15 pc 00061635 /system/lib/libdvm.so (dvmCallMethod(Thread*, Method const*, Object*, JValue*, ...)+20) E/CRASH (19393): #16 pc 0005630f /system/lib/libdvm.so E/CRASH (19393): #17 pc 0000d2a0 /system/lib/libc.so (__thread_entry+72) E/CRASH (19393): #18 pc 0000d438 /system/lib/libc.so (pthread_create+240)
When it tried to call "getAppVsyncOffsetNanos", it crashed.
When I looked for this function, this function was added in Android SDK 21. https://developer.android.com/reference/android/view/Display#getAppVsyncOffsetNanos()
I definitely set the minimum SDK level to 19 (kitkat) But it is calling SDK 21. I thought Unity was upgrading a version of the minimum sdk somewhere, so I looked up the documentation and found this in the IAP documentation.
[1.11.0] - 2017-05-01
Added
FacebookStore - Facebook Gameroom Payments Lite support. Available on Unity 5.6+ when building for Facebook Platform on Gameroom (Windows) and WebGL. Preliminary documentation is available here - Apple platforms - Added experimental support for setting "simulatesAskToBuyInSandbox". Please let us know how this impacts ask-to-buy testability for you. ```csharp extensions.GetExtension().simulateAskToBuy = true; ``` - Apple platforms - Added support for setting "applicationUsername" field which will be added to every payment request to help the store detect fraud. ```csharp // Set the applicationUsername to help Apple detect fraud extensions.GetExtension().SetApplicationUsername(hashedUsername); ```
Requirement
GooglePlay - "Android SDK API Level 24 (7.0)" (or higher) must now be installed. To upgrade, either perform the one-time step of setting the project's "Android Player Settings > Other Settings > Minimum API Level" to 24, building an APK, then resetting to the project's previous value. Or, run the android
Android SDK Manager tool manually and install "Android 7.0 (API 24)". Addresses build error messages: "Unable to merge android manifests." and "Main manifest has \ but library uses targetSdkVersion='24'". Note the Minimum API Level support is unchanged; merely the installation of API 24 SDK is now required for Daydream VR.
Fixed
GooglePlay Daydream VR - Uses decoration-free Activity for purchasing - GooglePlay - Avoids sporadic price serialization exception - Apple App Stores - Improve handling of the situation where an attempt to finish a transaction fails (if the user is signed out of the store and cancels the sign in dialog, for example). The Apple store implementation will now remember that the transaction should be finished, and attempt to call finishTransaction again if the transaction is retrieved from the queue again. When this happens, the store will call OnPurchaseFailed with the reason "DuplicateTransaction"—this prevents a situation where a call to InitiatePurchase could result in no call to ProcessPurchase or OnPurchaseFailed. - Amazon - Fix for a crash when loading product metadata for subscription parent products
According to the above article, when the IAP becomes version 1.11, the Android sdk API version should be 24 or higher. This is too high to be called the minimum version. Is this true? Even if it's true, I should be able to run my application on kitkat.
what can i do?