proguard rules for tenor sdk - java

Can anyone Provide proguard rules for Tenor Sdk android. There are no rules provided for there sdk on git. The link for git repository is :
https://github.com/Tenor-Inc/tenor-android-core
Following is the crash exception I am getting :
FATAL EXCEPTION: main
Process: com, PID: 14520
java.lang.RuntimeException: Unable to start activity ComponentInfo{com/com.ui.activities.GifListActivity}: java.lang.IllegalArgumentException: Unable to create converter for class com.tenor.android.core.d.a.c
for method d.a
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5525)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: java.lang.IllegalArgumentException: Unable to create converter for class com.tenor.android.core.d.a.c
for method d.a
at h.n$a.a(ServiceMethod.java:752)
at h.n$a.c(ServiceMethod.java:738)
at h.n$a.a(ServiceMethod.java:169)
at h.m.a(Retrofit.java:170)
at h.m$1.invoke(Retrofit.java:147)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at $Proxy0.a(Unknown Source)
at com.i.b.a(GiffRetrievalService.java:38)
at com.ui.activities.GifListActivity.a(GifListActivity.java:93)
at com.ui.activities.GifListActivity.a(GifListActivity.java:63)
at com.ui.activities.GifListActivity.onCreate(GifListActivity.java:58)
at android.app.Activity.performCreate(Activity.java:6272)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
... 9 more
Caused by: java.lang.IllegalArgumentException: class com.tenor.android.core.b.a.b declares multiple JSON fields named a
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:170)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
at com.google.gson.f.a(Gson.java:423)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
at com.google.gson.f.a(Gson.java:423)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory.a(CollectionTypeAdapterFactory.java:53)
at com.google.gson.f.a(Gson.java:423)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
at com.google.gson.f.a(Gson.java:423)
at com.google.gson.internal.bind.CollectionTypeAdapterFactory.a(CollectionTypeAdapterFactory.java:53)
at com.google.gson.f.a(Gson.java:423)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:115)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:164)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.a(ReflectiveTypeAdapterFactory.java:100)
at com.google.gson.f.a(Gson.java:423)
at h.a.a.a.a(GsonConverterFactory.java:64)
at h.m.a(Retrofit.java:330)
at h.m.b(Retrofit.java:313)
at h.n$a.c(ServiceMethod.java:736)
... 21 more
Thanks

Use this rule
-keep class com.tenor.android.core.** { *; }
This will keep away all classed inside com.tenor.android.core package from getting proguarded

Related

How to get path to current class file in Kotlin in Android app without getProtectionDomain

I need to get 2 things logged from the current line of code:
the current class which is currently executed
the full path to the file of this class
In Kotlin, I can get class by
this::class
or
this::class.java
Then, I should be able to get path to the file of the class via
class.getProtectionDomain().getCodeSource().getLocation().getPath()
As is advised e. g. here.
The problem is getProtectionDomain returns null for Android Activity:
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:414)
at android.view.View.performClick(View.java:7288)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View.performClickInternal(View.java:7258)
at android.view.View.access$4000(View.java:808)
at android.view.View$PerformClick.run(View.java:28019)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7615)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:409)
at android.view.View.performClick(View.java:7288) 
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119) 
at android.view.View.performClickInternal(View.java:7258) 
at android.view.View.access$4000(View.java:808) 
at android.view.View$PerformClick.run(View.java:28019) 
at android.os.Handler.handleCallback(Handler.java:883) 
at android.os.Handler.dispatchMessage(Handler.java:100) 
at android.os.Looper.loop(Looper.java:214) 
at android.app.ActivityThread.main(ActivityThread.java:7615) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964) 
Caused by: java.lang.NullPointerException: this::class.java.protectionDomain must not be null
Meanwhile the class is of course not null because I can successfully see its name
log(this::class.java.name)
So how can i get class file path without getProtectionDomain?

LOGCAT showing this error while running my app

LOGCAT error prevents me from opening the MAP activity and stops
working.
2019-07-03 17:12:01.642 29273-29273/com.example.ess E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.ess, PID: 29273
java.lang.IllegalStateException: Could not find method map(View) in a parent or ancestor Context for android:onClick attribute defined on view class android.support.v7.widget.AppCompatImageView with id 'imageView5'
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.resolveMethod(AppCompatViewInflater.java:424)
at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:381)
at android.view.View.performClick(View.java:6993)
at android.view.View$PerformClick.run(View.java:26512)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:7025)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
You applied the android:onClick=map attribute in your layout xml.
As you can see in the log it's on the ImageView android.support.v7.widget.AppCompatImageView with the android:id=#+id/imageView5
So either:
remove this line: android:onClick="map" and handle clicks with an OnClickListener
create this method in the Activity where you applied the layout:
public void map(View v) {}

Unable to start activity ComponentInfo{...} after installing Android SDK Build-Tools 26

I upgraded Android Studio to 2.3.3
and then I installed Android SDK Build-Tools 26
and Android 8.0 (O)
and set compileSdkVersion and targetSdkVersion on 26
and buildToolsVersion on "26.0.0"
and then I changed all the libraries version from 25.3.1 to 26.0.0-alpha1
Now I have the below RunTime Exception:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mysite.myapp/com.mysite.myapp.MainActivity}: android.view.InflateException: Binary XML file line #35: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2417)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2480)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5725)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1030)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:825)
Caused by: android.view.InflateException: Binary XML file line #35: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.mysite.myapp.MainActivity.onCreate(MainActivity.java:65)
at android.app.Activity.performCreate(Activity.java:6018)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2480) 
at android.app.ActivityThread.access$800(ActivityThread.java:151) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:155) 
at android.app.ActivityThread.main(ActivityThread.java:5725) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1030) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:825) 
Caused by: java.lang.IllegalArgumentException: Setting FragmentDrawer{28990c1 #0 id=0x7f0f0095} as the target of FragmentDrawer{28990c1 #0 id=0x7f0f0095} would create a target cycle
at android.support.v4.app.Fragment.setTargetFragment(Fragment.java:636)
at com.mysite.myapp.Fragments.FragmentDrawer.onCreate(FragmentDrawer.java:83)
at android.support.v4.app.Fragment.performCreate(Fragment.java:2226)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1290)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1502)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1737)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3512)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:120)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:330)
at android.support.v4.app.BaseFragmentActivityApi14.onCreateView(BaseFragmentActivityApi14.java:39)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:75)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:733)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289) 
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
at com.mysite.myapp.MainActivity.onCreate(MainActivity.java:65) 
at android.app.Activity.performCreate(Activity.java:6018) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1130) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2370) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2480) 
at android.app.ActivityThread.access$800(ActivityThread.java:151) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1377) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:155) 
at android.app.ActivityThread.main(ActivityThread.java:5725) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1030) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:825) 
the (MainActivity.java:65) and (FragmentDrawer.java:83) are displayed as link.
MainActivity.java:65 content:
setContentView(R.layout.activity_main);
FragmentDrawer.java:83 content:
setTargetFragment(FragmentDrawer.this, 100);
before MainActivity there is a SplashActivity and it runs without any problem!
I've just downgraded SDK Build-Tools, compileSdkVersion, targetSdkVersion, buildToolsVersion and libraries version to run again and test. there is no problem using previews versions.
Can anyone help me? How can I run my App using new SDK Version?
The problem is here:
java.lang.IllegalArgumentException:
Setting FragmentDrawer{28990c1 #0 id=0x7f0f0095} as the target of
FragmentDrawer{28990c1 #0 id=0x7f0f0095} would create a target cycle
at android.support.v4.app.Fragment.setTargetFragment(Fragment.java:636)
setTargetFragment has changed in 26.0.0. Before, it simply set the target fragment plus request code. From 26.0.0 onwards, it contains two checks before doing that:
- it checks whether the current fragment and the target fragment belong to the same fragment manager
- it checks whether setting the target fragment would create a loop, by scanning the list of target fragments in this fragment and see if the target fragment is already there.
So somehow you are setting a target fragment that you set before. That is no longer allowed.

android page transition laybrary integration null pointer exception

Hello everyone i've got this error a nullPointerException error after i tried to integrate the android-page-transition and i couldn't find it's cause
this is the code where the error is shown PS: it's the same exact caude in the library i just integrated the code into mywork
/**
* Réglage Menu immersive title
*/
private void dealStatusBar() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
int statusBarHeight = getStatusBarHeight();
ViewGroup.LayoutParams lp = positionView.getLayoutParams();
lp.height = statusBarHeight;
positionView.setLayoutParams(lp);
}
}
this is the error i get when i run
11-19 12:11:30.781 16089-16089/mobile.esprit.tn.mobileteam E/AndroidRuntime: FATAL EXCEPTION: main
Process: mobile.esprit.tn.mobileteam, PID: 16089
java.lang.RuntimeException: Unable to start activity ComponentInfo{mobile.esprit.tn.mobileteam/mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2693)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.ViewGroup$LayoutParams android.view.View.getLayoutParams()' on a null object reference
at mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews.dealStatusBar(PrjectsCardViews.java:129)
at mobile.esprit.tn.mobileteam.Activities.Project.PrjectsCardViews.onCreate(PrjectsCardViews.java:54)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758) 
at android.app.ActivityThread.access$900(ActivityThread.java:177) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:5942) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 
the PrjectsCardViews.java:129 is the code i posted above
ok i found the problem it was a dump fault caused by the copy and paste , i dident refere the oncreate to the necessary activity layout
You might have copied the projet but you may forgotten to change
<com.stone.transition.DragLayout
android:id="#+id/drag_layout" when you merged the code in your project check this out it will work

WiFi Scan No Such Instance field 'ChannelWidth'

Using
wifiManager.startScan();
ScanResultsList scanresultsList = wifiManager.getScanResults();
I obtain a list of scan results defined by ScanResult objects.
Problem:
Refering to scanResult.channelWidth I am presented with an error:
scanResult.channelWidth = No such instance field: 'channelWidth'
and
Exception
java.lang.NoSuchFieldError: No instance field channelWidth of type I
in class Landroid/net/wifi/ScanResult; or its superclasses
(declaration of 'android.net.wifi.ScanResult' appears in
/system/framework/framework.jar)
Stacktrace:
06-14 02:57:19.732 27116-27116/com.cynetstudios.frequencyselector E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.cynetstudios.frequencyselector, PID: 27116
java.lang.NoSuchFieldError: No instance field channelWidth of type I in class Landroid/net/wifi/ScanResult; or its superclasses (declaration of 'android.net.wifi.ScanResult' appears in /system/framework/framework.jar)
at com.cynetstudios.frequencyselector.main.initWiFiArrays(main.java:161)
at com.cynetstudios.frequencyselector.main.access$000(main.java:35)
at com.cynetstudios.frequencyselector.main$1$1.run(main.java:115)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5291)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
I require this int value for further processing,
what is causing this no instance field?
This may be useful,check this link
https://developer.android.com/reference/android/net/wifi/ScanResult.html>

Categories

Resources